FastAPI is a fantastic tool for building REST APIs in Python. However, many tutorials, guides, and project templates set developers up for failure as their APIs grow in scope and complexity. A quick search for “FastAPI project templates” reveals a recurring pattern:
my_fastapi_project/
├── app/
│ ├── __init__.py
│ ├── main.py
│ ├── dependencies.py
│ ├── routers/
│ │ ├── __init__.py
│ │ ├── users.py
│ │ └── items.py
│ ├── internal/
│ │ ├── __init__.py
│ │ └── admin.py
│ ├── core/
│ │ ├── __init__.py
│ │ ├── config.py
│ │ └── security.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── user.py
│ │ └── item.py
│ ├── schemas/
│ │ ├── __init__.py
│ │ ├── user.py
│ │ └── item.py
│ ├── services/
│ │ ├── __init__.py
│ │ ├── user_service.py
│ │ └── item_service.py
│ └── db/
│ ├── __init__.py
│ ├── database.py
│ └── migrations/
├── tests/
│ ├── __init__.py
│ ├── test_main.py
│ ├── test_users.py
│ ├── test_items.py
├── .env
├── .gitignore
├── requirements.txt
├── README.md
└── run.sh
While this setup is fine for smaller projects, our team has found that the developer ergonomics suffer as the API expands. This is primarily because developers are forced to jump between multiple directory trees to work on related logic.



![Cover Image An Unexpected [Linux] Journey](/website/posts/linux-desktop/tux.jpg)