All posts
Tag

dependency-injection

2 posts

Tutorial

Clean Code Python: Full-Stack DI with dependency-injector, FastAPI, and SQLAlchemy

FastAPI's Depends() handles per-request wiring. dependency-injector handles everything else — configuration, singletons, factories, and a declarative container that makes your entire object graph visible in one file.

15 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