Additional Settings
Production-Ready Authentication¶
This template comes with a pre-configured authentication system, allowing you to start building your application with user management features immediately.
Hot Reload in Development¶
The project includes two hot reload processes while running the application, one for the backend and one for the frontend. These automatically restart the local servers when changes are detected, ensuring the application is always up to date without manual restarts.
- Backend hot reload monitors changes in the backend code.
- Frontend hot reload monitors changes in the frontend code and the
openapi.jsonschema generated by the backend.
Manual Execution of Hot Reload Commands¶
You can manually execute the same commands that hot reloads call when they detect a change:
- To export the
openapi.jsonschema:
cd api && uv run python -m commands.generate_openapi_schema
or using Docker:
docker compose run --rm --no-deps -T backend uv run python -m commands.generate_openapi_schema
- To generate the frontend client:
or using Docker:
cd ui && pnpm run generate-clientdocker compose run --rm --no-deps -T frontend pnpm run generate-client
Testing¶
To run the tests, you need to start the test database container:
make docker-up-test-db
Then run the tests locally:
make test-backend
make test-frontend
Or using Docker:
make docker-test-backend
make docker-test-frontend
Pre-Commit Configuration¶
To maintain code quality and consistency, the project includes two separate pre-commit configuration files:
.pre-commit-config.yamlis used to run pre-commit checks locally..pre-commit-config.docker.yamlis used to run pre-commit checks inside Docker.
Installing and Activating Pre-Commit Hooks¶
To activate the pre-commit hooks, run the following commands for each configuration file:
- For the local configuration file:
pre-commit install -c .pre-commit-config.yaml
- For the Docker configuration file:
pre-commit install -c .pre-commit-config.docker.yaml
Local Mail Server Configuration¶
To configure the mail server locally, you need to start MailHog by running the following command:
make docker-up-mailhog
- Mail Client: Access the email at
http://localhost:8025.
Running Pre-Commit Checks¶
To manually run pre-commit checks on all files, use:
pre-commit run --all-files -c .pre-commit-config.yaml
or
pre-commit run --all-files -c .pre-commit-config.docker.yaml
Updating Pre-Commit Hooks¶
To update the hooks to their latest versions, run:
pre-commit autoupdate
Alembic Database Migrations¶
If you need to create a new database migration:
make docker-db-schema migration_name="migration_name"
then apply the migration to the database:
make docker-migrate-db
GitHub Actions¶
This project has a pre-configured GitHub Actions setup to enable CI/CD. Workflow configuration files are located inside the .github/workflows directory. You can customize these workflows to better suit your project's needs.
Secret Configuration¶
For workflows to function correctly, add the secret keys to your GitHub repository settings. Navigate to Settings > Secrets and variables > Actions and add the following keys:
DATABASE_URL: The connection string for your main database.
TEST_DATABASE_URL: The connection string for your test database.
ACCESS_SECRET_KEY: The secret key for generating access tokens.
RESET_PASSWORD_SECRET_KEY: The secret key for password reset functionality.
VERIFICATION_SECRET_KEY: The secret key for email or user verification.
Makefile¶
This project includes a Makefile that provides a set of commands to simplify day-to-day tasks, such as starting backend and frontend servers, running tests, building Docker containers, and more.
Available Commands¶
make help
Some common commands:
make install-skills: Install AI skills for the project.make start-api: Start the backend server.make start-ui: Start the frontend server.