- FastAPI – Designing the REST API
Turning endpoints into an API someone else can use. Resource naming, PATCH versus PUT, response_model and what it hides, and giving a state change its own endpoint instead of making it a writable field. Then pagination done properly — a generic Page[T] envelope, bounded page sizes, and the ORDER BY that stops page two repeating rows from page one.
- FastAPI – SQLAlchemy, Sessions and Migrations
A real data layer. The engine and one session per request, typed SQLAlchemy 2.0 models, the repository pattern, and who owns the transaction. Then Alembic: naming constraints so a downgrade can refer to them, and never editing an applied migration. Includes the N+1 problem, eager loading, and why expire_on_commit=False matters specifically in FastAPI.
- FastAPI – Dependency Injection in Practice
The feature FastAPI is built on. Depends(), dependencies that yield so setup and teardown live together, sub-dependencies, and collapsing the whole thing into one readable Annotated alias so a route signature states its own security rules. Then dependency_overrides, which is what makes any of it testable — and the reason an override keyed on the wrong function object silently does nothing.
- FastAPI – Project Structure That Survives Growth
The question the official docs answer least well. How a single main.py becomes routes, services, repositories, schemas and models — what belongs in each layer, and the rules that keep them apart: routes own HTTP, services own the rules, and repositories never commit because only the caller knows where a transaction ends. Plus typed settings read once, so a misspelt variable is a startup error.
- FastAPI – Pydantic Models and Validation
Pydantic v2 as FastAPI actually uses it. Field constraints, field and model validators, computed fields for values that change at midnight, and separating the model you store from the model you return. Includes the snake_case-to-camelCase boundary that lets Python and TypeScript each keep their own conventions, and a field named `property` that breaks the `property` builtin twenty lines later.