Chapter 5: Structuring FastAPI Applications

In the last four chapters, we looked at the basic steps involved in understanding FastAPI and creating a FastAPI application. The application that we have built so far is a single-file todo application that demonstrates the flexibility and power of FastAPI. The key takeaway from the preceding chapters is how easy it is to build an application using FastAPI. However, there is a need for proper structuring of an application with increased complexity and functionalities.

Structuring refers to the arrangement of application components in an organized format, which can be modular to improve the readability of the application’s code and content. An application with proper structuring enables faster development, ...

Get Building Python Web APIs with FastAPI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.