Blog

62 posts on engineering, architecture, and technical craft.

Tutorial

FastAPI Auth: The Decision Framework — Choosing the Right Approach

Eight authentication and authorization methods, one decision tree. Here is the comparison matrix, production combination patterns, and pre-launch security checklist that turns auth knowledge into shipping decisions.

11 min read
Tutorial

Clean Code Python: Type Safety with Protocols Over ABCs

Python's ABC machinery adds inheritance overhead you do not need. Protocols give you structural subtyping — type-safe duck typing with zero coupling between your repository interfaces and implementations.

8 min read
Tutorial

Clean Code Python: Structured Error Handling Across the Stack

Scattered try/except blocks and generic 500 errors signal a system that was not designed. Here is how to define domain exceptions, translate them to HTTP responses, and give your API clients errors they can act on.

7 min read
Tutorial

Clean Code Python: Dependency Injection Without Magic

FastAPI's Depends() is the most underused tool in the framework. Here is how to use it to wire repositories, services, and authentication into your route handlers with no global state and no service locator pattern.

7 min read
Tutorial

Clean Code Python: Async Patterns That Actually Scale

asyncio.gather() is not always the answer. Here is when to parallelize database calls, when NOT to, and how to avoid the most common SQLAlchemy async session mistakes that cause subtle production bugs.

9 min read