Book: Hexagonal Architecture in Python
Companion code: hexagonal-python-examples — every listing from the book, free on GitHub
My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools
Me: xgabriel.com | GitHub
You add "cancel an order" to a FastAPI service. The pull request touches routers/orders.py , services/order_service.py , repositories/order_repository.py , schemas/orders.py and tests/test_orders.py . That's five files in five folders for one feature, and the reviewer has to open every one of them to see what the feature does. The next feature touches the same five files again, so two branches working on orders collide in the same service class.
That layout starts in the docs. FastAPI's Bigger Applications guide splits code into an app/routers/ package with one module per resource, and plenty of teams carry that one step further into services/ and repositories/ folders. It works fine for small services.…