Makefile Commands¶
Quick reference for all development commands.
Setup¶
| Command | Description |
|---|---|
make setup |
Run the one-time template setup wizard |
Examples¶
Development¶
| Command | Description |
|---|---|
make dev |
Start FastAPI development server with hot reload |
make celery-dev |
Start Celery worker for background tasks |
make celery-beat-dev |
Start Celery beat scheduler |
Examples¶
# Start the API server
make dev
# In another terminal, start Celery
make celery-dev
# For scheduled tasks
make celery-beat-dev
Database¶
| Command | Description |
|---|---|
make migrate |
Apply database migrations |
make makemigrations |
Create new migrations from model changes |
Examples¶
Code Quality¶
| Command | Description |
|---|---|
make format |
Format code through prek hooks |
make lint |
Run all prek checks except tests |
make test |
Run tests with coverage |
make update-dependencies |
Update uv lock, dependency bounds, CI pins, and container image pins |
Examples¶
# Before committing
make format
make lint
# Run tests
make test
# Update dependency bounds and CI action pins
make update-dependencies
Documentation¶
| Command | Description |
|---|---|
make docs |
Serve documentation with live reload |
make docs-build |
Build static documentation |
Examples¶
Command Details¶
make dev¶
Runs:
- Hot reloading enabled
- Accessible at http://localhost:8000
- API docs at http://localhost:8000/docs
make setup¶
Runs:
- Renames the checkout folder to the project slug, then renames the project and Python package
- Writes
.envand updates committed environment examples - Configures SQLite, local Docker PostgreSQL, or remote PostgreSQL
- Configures local Docker Redis or remote Redis
- Configures local filesystem, local MinIO, or remote S3-compatible storage
- Rewrites the README for the generated app
- Sets optional public origins, repository metadata, ports, and Logfire defaults
- Infers repository metadata from GitHub template checkouts and preserves their
origin - Can reinitialize Git for direct template clones, set
originfrom the repository URL, and create a generated setup commit - Can remove template docs and setup-only files
make update-dependencies¶
Runs:
- Runs
uv lock --upgrade - Syncs direct dependency lower bounds in
pyproject.tomlfromuv.lock - Updates GitHub Action pins and supported CI tool versions in
.github/workflows - Updates Dockerfile and Docker Compose image pins, including matching docs references
- Runs
uv lockagain after pyproject changes - Prints progress while it checks package indexes, GitHub, and container registries
Preview without writing files:
Hide progress messages:
make celery-dev¶
Runs:
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES uv run watchmedo auto-restart \
--directory=src \
--pattern='*.py' \
--recursive \
-- celery -A fastdjango.entrypoints.celery.app worker --loglevel=DEBUG
- Processes background tasks
- Requires Redis to be configured and reachable
- Logs to console
make celery-beat-dev¶
Runs:
uv run watchmedo auto-restart \
--directory=src \
--pattern='*.py' \
--recursive \
-- celery -A fastdjango.entrypoints.celery.app beat --loglevel=DEBUG
- Schedules periodic tasks
- Requires Redis to be configured and reachable
- Must run alongside worker
make format¶
Runs:
uv run prek run trailing-whitespace end-of-file-fixer ruff-check-fix ruff-format-fix --all-files --hook-stage manual
- Formats Python files through local Ruff hooks
- Fixes Ruff lint issues where possible
- Normalizes trailing whitespace and final newlines
make lint¶
Runs code quality checks:
- Runs the full repository, matching CI
- Use
uv run prek runto check only staged files mypy --strictis the only type checker
make test¶
Runs:
- Requires 80%+ code coverage
- Generates an HTML coverage report in
htmlcov/ - Fails if coverage is below threshold
make migrate¶
Runs:
- Applies all pending migrations
- Requires database running
make makemigrations¶
Runs:
- Detects model changes
- Creates migration files in
migrations/directories
make docs¶
Runs:
- Serves docs at http://localhost:8000
- Live reload on file changes
make docs-build¶
Runs:
- Builds static HTML to
site/ - Validates all links
Common Workflows¶
Starting Fresh¶
# Customize the template and generate .env
make setup
# Install dependencies
uv sync --locked --all-groups
# Start local infrastructure for the choices made in setup
docker compose up -d postgres redis
# If you selected local MinIO storage
docker compose up -d minio
docker compose up minio-create-buckets
# Run migrations
make migrate
# Start server
make dev
Before Committing¶
Working with Celery¶
# Terminal 1: API
make dev
# Terminal 2: Worker
make celery-dev
# Terminal 3: Scheduler (if needed)
make celery-beat-dev
Creating a New Feature¶
Troubleshooting¶
Command Not Found¶
Ensure you have make installed:
Permission Denied¶
If using Docker:
Database Connection Error¶
If you selected local Docker PostgreSQL, ensure it is running:
Redis Connection Error¶
If you selected local Docker Redis, ensure it is running: