Makefile Commands¶
Quick reference for all development commands.
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 with ruff |
make lint |
Run all linters (ruff, ty, pyrefly, mypy) |
make test |
Run tests with coverage |
Examples¶
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 celery-dev¶
Runs:
- Processes background tasks
- Requires Redis running
- Logs to console
make celery-beat-dev¶
Runs:
- Schedules periodic tasks
- Requires Redis running
- Must run alongside worker
make format¶
Runs:
- Formats Python files
- Auto-fixes lint issues where possible
make lint¶
Runs multiple type checkers:
- All must pass for CI
mypy --strictis the primary checker
make test¶
Runs:
- Requires 80%+ code coverage
- Generates coverage report
- 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
docs/site/ - Validates all links
Common Workflows¶
Starting Fresh¶
# Install dependencies
uv sync --locked --all-groups
# Copy environment
cp .env.example .env
# Start infrastructure
docker compose up -d postgres redis minio 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¶
Ensure PostgreSQL is running:
Redis Connection Error¶
Ensure Redis is running: