Skip to content

feat(backend): dx improvements#47

Merged
ivanskv2000 merged 7 commits into
mainfrom
feat(backend)/dx-improvements
May 19, 2026
Merged

feat(backend): dx improvements#47
ivanskv2000 merged 7 commits into
mainfrom
feat(backend)/dx-improvements

Conversation

@ivanskv2000
Copy link
Copy Markdown
Owner

DX Improvements: Dev Sessions, Auto-Seeding, and Test Users

This PR introduces several quality-of-life improvements for developers:

  1. Non-expiring sessions in Dev: JWT access tokens now have a 100-year expiration when running in dev mode, reducing the need for repeated logins.
  2. Automated Test Users: A new startup module ensures that user@example.com (password: 12345678) exists on application start in dev mode. This is designed to be easily extendable for future roles.
  3. Automatic Database Seeding: The database is now automatically seeded on startup if it's empty (30 events, 12 fields, 7 tags), eliminating the manual seeding step from the UI.

Changes

  • backend/app/modules/auth/token.py: Modified create_access_token to handle long-lived dev tokens.
  • backend/app/core/startup.py: Added new module for startup tasks (user creation, seeding).
  • backend/app/factory.py: Integrated startup tasks into the FastAPI lifespan.

Verification Results

  • make format and make lint passed.
  • make test passed with 90 tests successful (including new startup tests).
  • app/core/startup.py coverage reached 86%.
  • Manual verification of auto-seeding logic in dev mode.

@sonarqubecloud
Copy link
Copy Markdown

@ivanskv2000 ivanskv2000 merged commit 047560c into main May 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant