Quick Start
Get from zero to a running API in under 5 minutes.
Prerequisites
- Docker and Docker Compose installed
- Git
Step 1 — Clone the repo
git clone https://github.com/plasmacat420/fastapi-production-boilerplate
cd fastapi-production-boilerplate
Step 2 — Configure environment
Open .env and at minimum change:
Generate a secure key:
Step 3 — Start everything
This starts: - postgres — database on port 5432 - redis — cache/broker on port 6379 - api — FastAPI on port 8000 (runs migrations automatically) - worker — Celery worker - beat — Celery beat scheduler
Step 4 — Verify it's running
Open the interactive docs: http://localhost:8000/docs
Step 5 — Create your first admin user
python scripts/create_admin.py \
--email admin@example.com \
--password securepassword123 \
--name "Admin User"
Step 6 — Register and authenticate
# Register a new user
curl -X POST http://localhost:8000/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"mypassword123","full_name":"John Doe"}'
# Returns:
# {"access_token":"eyJ...","refresh_token":"eyJ...","token_type":"bearer"}
# Store the access token
TOKEN="eyJ..."
# Get your profile
curl http://localhost:8000/users/me \
-H "Authorization: Bearer $TOKEN"
# Refresh when access token expires
curl -X POST http://localhost:8000/auth/refresh \
-H "Content-Type: application/json" \
-d '{"refresh_token":"<your_refresh_token>"}'