Handbook

FastAPI Handbook

From ASGI and Pydantic to auth, async databases, queues, production and architecture — six volumes, 135 pages, every snippet run.

6
volumes
135
pages
129
page topics
A4
print-ready
Who it is for
Backend engineers from first API to senior system design — learners, Flask / Django switchers and interview candidates.
Each page has
a diagram, code that was actually run, tables, production rules, common mistakes and interview questions.
Format
A4 notebook pages. Read them in the browser, print them or save as PDF.
Updates
Lifetime access. New and revised volumes appear in your library free.

01The volumes

Buy them together, or one at a time.

Each volume stands on its own. The handbook price covers all of them, and any volume added later.

  1. Volume 1 · 20 pages

    Core FastAPI & Pydantic

    ASGI and Starlette, routing, path, query and body parameters, responses and response models, Pydantic v2 models, validation and a tested mini app.

  2. Volume 2 · 20 pages

    Dependencies, Middleware, Errors & Auth

    Depends and yield dependencies, overrides, middleware and CORS, error handling, OAuth2, JWT, password security, RBAC and API keys.

  3. Volume 3 · 23 pages

    API Design, Async & Databases

    Pagination, idempotency, long jobs, uploads, streaming, WebSockets, lifespan, async and blocking calls, SQLAlchemy 2, transactions and N+1.

  4. Volume 4 · 23 pages

    Queues, Security, OpenAPI & Testing

    Redis and caching, Celery, queues and the outbox, rate limiting, input security, CSRF, OpenAPI, and unit, integration and contract testing.

  5. Volume 5 · 21 pages

    Performance, Observability & Production

    Profiling and the event loop, logging, metrics, health checks, graceful shutdown, config, Docker, CI/CD, Alembic, scaling and multi-tenancy.

  6. Volume 6 · 28 pages

    Architecture, Systems & Interviews

    Service layer, DDD, distributed systems, reliability patterns, webhooks, payments, anti-patterns, code review, case studies and senior interview questions.

02What is inside

Every page, by topic.

129 page topics across 6 volumes, taken from the books' own page titles.

Vol 1 · Core FastAPI & Pydantic20 pages · 19 topics
  • 01How to use this book
  • 02FastAPI at a glance
  • 03ASGI
  • 04Starlette
  • 05App creation & config
  • 06Routing
  • 07APIRouter
  • 08Path parameters
  • 09Query parameters
  • 10Request bodies
  • 11Headers, cookies, forms
  • 12Response handling
  • 13Response models
  • 14Pydantic I
  • 15Pydantic II
  • 16Data modeling
  • 17Validation
  • 18Mini app
  • 19Vol 1 Cheat Sheet
Vol 2 · Dependencies, Middleware, Errors & Auth20 pages · 19 topics
  • 01How to use this book
  • 02Dependency injection
  • 03Dependency design
  • 04Yield dependencies
  • 05Dependency overrides
  • 06Request context
  • 07Middleware I
  • 08Middleware II
  • 09CORS
  • 10Exception handling
  • 11Status codes
  • 12Authentication
  • 13OAuth2
  • 14JWT
  • 15Password security
  • 16Authorization
  • 17API keys & service auth
  • 18Mini app
  • 19Vol 2 Cheat Sheet
Vol 3 · API Design, Async & Databases23 pages · 22 topics
  • 01How to use this book
  • 02API design
  • 03API versioning
  • 04Pagination
  • 05Idempotency
  • 06Long-running operations
  • 07File uploads
  • 08Streaming responses
  • 09WebSockets
  • 10Lifespan
  • 11External HTTP clients
  • 12Async programming
  • 13Blocking calls
  • 14Concurrency & parallelism
  • 15Database integration
  • 16SQLAlchemy 2 I
  • 17SQLAlchemy 2 II
  • 18Async SQLAlchemy
  • 19Transactions
  • 20ORM query optimisation
  • 21Mini app
  • 22Vol 3 Cheat Sheet
Vol 4 · Queues, Security, OpenAPI & Testing23 pages · 22 topics
  • 01How to use this book
  • 02Redis
  • 03Caching
  • 04Background tasks
  • 05Celery & job queues
  • 06Message queues & events
  • 07Transaction + queue consistency
  • 08API rate limiting
  • 09Input security
  • 10API security headers
  • 11CSRF
  • 12OpenAPI
  • 13API documentation quality
  • 14Testing with TestClient
  • 15Async testing
  • 16Unit testing
  • 17Integration testing
  • 18Contract testing
  • 19Mocking
  • 20Test data
  • 21Mini app
  • 22Vol 4 Cheat Sheet
Vol 5 · Performance, Observability & Production21 pages · 20 topics
  • 01How to use this book
  • 02Performance engineering
  • 03FastAPI performance
  • 04Event loop performance
  • 05Profiling
  • 06Observability
  • 07Logging
  • 08Health checks
  • 09Graceful shutdown
  • 10Application configuration
  • 11Production process model
  • 12Reverse proxy & HTTPS
  • 13CI/CD
  • 14Docker
  • 15Database migrations
  • 16Alembic
  • 17Horizontal scaling
  • 18Multi-tenancy
  • 19Mini app
  • 20Vol 5 Cheat Sheet
Vol 6 · Architecture, Systems & Interviews28 pages · 27 topics
  • 01How to use this book
  • 02Architecture styles
  • 03Service layer
  • 04Repository pattern
  • 05Domain-driven design
  • 06Event-driven architecture
  • 07Distributed systems I
  • 08Distributed systems II
  • 09Reliability patterns
  • 10External integrations
  • 11Webhooks
  • 12Payments & ledgers
  • 13API state machines
  • 14Anti-patterns I
  • 15Anti-patterns II
  • 16Code review I
  • 17Code review II
  • 18System design: E-commerce API
  • 19System design: file processing
  • 20System design: notifications
  • 21System design: AI backend
  • 22Multi-worker & cloud-native
  • 23Senior Qs I
  • 24Senior Qs II
  • 25Priority map & projects
  • 26Production debugging
  • 27Series Cheat Sheet

03Around it

Learn it, look it up, then keep the handbook.

The same subject is on the site as a course and a cheatsheet. The handbook is the printable version for revision.

?Questions

Before you start

What exactly do I get?
Access to the handbook in your library: every page, readable in the browser and printable as PDF. You pay once; there is no subscription.
Can I read before I buy?
Yes. Every volume has free sample pages. Sign in with a free account, open any volume, and the first pages are yours to read.
Will I get updates?
Yes. When a volume is revised, or a new volume is added to a handbook you own, it appears in your library at no cost.
How do I pay?
UPI, cards and netbanking through Razorpay. You enter an email; sign in with it to read.
Refunds?
Digital goods are not refundable once the full book is opened. If a file is broken or not as described, write to us within 7 days and we will fix it or refund you.

Read a few pages first.

Sample pages are free with an account.