Blog

62 posts on engineering, architecture, and technical craft.

Tutorial

Clean Code Python: API Versioning and Backward-Compatible Evolution

A breaking API change that 'only' affects 5% of tenants still breaks real businesses. Without versioning, you can never evolve your API. Here is how to version a multi-tenant FastAPI backend with per-tenant version pinning, deprecation workflows, and contract testing.

12 min read
Tutorial

Clean Code Python: From git init to Production Traffic

Theory without deployment is fiction. This capstone assembles all 22 prior patterns into a deployed, monitored, incident-ready multi-tenant Python backend — from Docker Compose to runbooks to your first production incident.

22 min read
Tutorial

FastAPI Auth: The Security Mental Model You Need First

Authentication and authorization are two different problems that most tutorials conflate. Here is the mental model, threat landscape, and FastAPI security toolkit you need before writing a single line of auth code.

9 min read
Tutorial

FastAPI Auth: API Key Authentication for Machine Clients

API keys are the most misused auth mechanism in production. Here is how to generate, scope, rotate, and rate-limit API keys in FastAPI — with the patterns that separate toy projects from production systems.

9 min read
Tutorial

FastAPI Auth: JWT Tokens — Stateless Authentication

JWTs eliminate session storage but introduce revocation challenges. Here is how to build access tokens, refresh tokens, and token rotation in FastAPI — with the security pitfalls that tutorials never mention.

10 min read
Tutorial

FastAPI Auth: Password Authentication Done Right

Password hashing is not security — it is one layer. Here is how to build registration, login, session management, and brute-force protection in FastAPI without the mistakes that lead to credential breaches.

12 min read
Tutorial

FastAPI Auth: OAuth 2.0 — The Authorization Framework

OAuth 2.0 is not authentication — it is authorization. Here are the four grant types, why PKCE is now mandatory, and how to implement the authorization code flow in FastAPI with working code and sequence diagrams.

9 min read
Tutorial

FastAPI Auth: OpenID Connect and Single Sign-On

OAuth 2.0 does not tell you who the user is. OpenID Connect adds the identity layer. Here is how to implement Google SSO, validate ID tokens, and understand when OIDC beats SAML.

9 min read
Tutorial

FastAPI Auth: Authorization Patterns — RBAC, ABAC, and Beyond

Authentication answers who. Authorization answers what. Here are three authorization models — RBAC, ABAC, and ReBAC — implemented as FastAPI dependencies with decision flows, comparison tables, and production patterns.

10 min read