FastAPI Cheatsheet 04 — Dependency Injection

Cheatsheet: Depends, yield-deps, sub-deps, class deps, security deps, dependency_overrides for tests, lifespan.

May 11, 2026 · 3 min · 453 words · Manvendra Rajpoot

FastAPI Textbook Ch. 4 — Response Models, Serialization, and Output Discipline

Output side of FastAPI: response_model, response shaping, custom encoders, status codes, response classes (JSON, HTML, Streaming, File).

May 6, 2026 · 5 min · 897 words · Manvendra Rajpoot

Integration Cheatsheet 05 — Auth Stack (Password / JWT / Session)

Cheatsheet: full auth stack — User model, login endpoint, token deps, refresh, password hashing.

May 16, 2026 · 3 min · 599 words · Manvendra Rajpoot

FastAPI Cheatsheet 05 — Authentication and Authorization

Cheatsheet: argon2 hashing, OAuth2 password flow, refresh tokens, sessions, API keys, scopes, RBAC, resource-level authz.

May 11, 2026 · 4 min · 700 words · Manvendra Rajpoot

FastAPI Textbook Ch. 5 — Dependency Injection in Depth

Dependency injection in FastAPI: Depends, scopes, sub-deps, class-based deps, lifecycle (startup/shutdown), and the patterns from production.

May 6, 2026 · 6 min · 1170 words · Manvendra Rajpoot

Integration Cheatsheet 06 — Multi-Tenancy Across the Stack

Cheatsheet: tenant context, RLS policies, per-request session, isolation tests.

May 16, 2026 · 3 min · 627 words · Manvendra Rajpoot

FastAPI Cheatsheet 06 — Async, Concurrency, and the Threadpool

Cheatsheet: async def vs def, AnyIO/TaskGroup, to_thread, blocking traps, semaphores, timeouts, cancellation.

May 11, 2026 · 3 min · 430 words · Manvendra Rajpoot

FastAPI Textbook Ch. 6 — Authentication and Authorization

Auth and authz in FastAPI: passwords, JWT, OAuth2 / OIDC, sessions, passkeys, RBAC, scopes, and security best practices.

May 6, 2026 · 6 min · 1129 words · Manvendra Rajpoot

Integration Cheatsheet 07 — Background Jobs Across the Stack

Cheatsheet: enqueue from request, worker with DB session, outbox + LISTEN/NOTIFY wake-up.

May 16, 2026 · 3 min · 631 words · Manvendra Rajpoot

FastAPI Cheatsheet 07 — WebSockets and SSE

Cheatsheet: WebSocket handlers, auth patterns, broadcast (single + multi-process), SSE, NDJSON, heartbeats.

May 11, 2026 · 3 min · 467 words · Manvendra Rajpoot