- Python 3.13+
- uv (Modern Python packaging tool)
- Docker (optional, for containerization)
- Kubernetes cluster (optional, for production deployment)
- Make (for automation commands)
# 1. Initialize development environment
make init
# 2. Start the server (using uv)
uv run -- fastapi dev src/app/main.py
# or fastapi run
uv run -- fastapi run --workers 4 src/app/main.py# Activate virtual environment
source .venv/bin/activate # Linux/macOS
.venv/Scripts/activate # Windows
# Change to application directory
cd src/app
# Choose your preferred server:
# A. Uvicorn
uvicorn main:app --host 0.0.0.0 --port 8080
# B. Hypercorn (HTTP/2 Support)
uv add hypercorn
hypercorn main:app --bind 0.0.0.0:8080
# Development environment
make dev
# Production deployment
make prod
Interactive API documentation is available at:
- 📚 Swagger UI: http://localhost:8080/docs
- 📖 ReDoc: http://localhost:8080/redoc
Choose the appropriate server based on your needs:
| Server | Best For | Key Features |
|---|---|---|
| Uvicorn | Development | Fast reload, Easy debugging |
| Hypercorn | HTTP/2 Requirements | HTTP/2, WebSocket support |
| Gunicorn | Production Deployment | Process management, Stability |
import multiprocessing
bind = "0.0.0.0:8080"
worker_class = "uvicorn.workers.UvicornWorker"
workers = multiprocessing.cpu_count() * 2 + 1
threads = multiprocessing.cpu_count() * 2gunicorn main:app