When starting a FastAPI project, one of the first questions is:
How should we organize our application?
Should we have a routers folder? Where should services and clients go? What is the difference between schemas, models, and domain objects? Why do some projects have multiple exception folders? And what exactly belongs in core ?
These questions become more important as an application grows.
Let's understand these concepts by designing a production-ready learning project: a Weather Service API using FastAPI and Open-Meteo .
We will use Open-Meteo's free APIs to search for locations and retrieve current weather and forecast information.
The objective is not to create the maximum number of folders. It is to understand the responsibility of each layer, why it exists, and how the layers communicate.
1.β¦