What problem does it solve?
Developers often struggle to implement consistent, scalable FastAPI patterns, leading to duplicated code and maintenance bottlenecks.
Core Features & Use Cases
- Async-first endpoints: All handlers use async def for non-blocking I/O.
- Strong data validation: Pydantic v2 models with validators for request/response data.
- Dependency injection: Centralized DB connections, auth, and config via Depends().
- Robust error handling: Centralized HTTPException handlers and structured error models.
- Modular routing: APIRouter usage with prefixes and tags for clean organization.
- Configuration & observability: CORS settings, logging, and lifespan events for startup/shutdown.
- Documentation readiness: Explicit OpenAPI tags and descriptions for auto-generated docs.
Quick Start
Create a minimal FastAPI app following these patterns, define a sample model, register it with a router, enable CORS for allowed origins, and run the app with uvicorn main:app --reload.