So far in this book, we have seen that the FastAPI web app is contained in a single Python script (conventionally main.py). All the path operation routes, their respective operation functions, the models, all the required imports, etc., are put in the same code file.
Things will become messier if the application involves handling of more than one resources. Take the case of an ecommerce app where CRUD operations on books as well as music albums are to be performed. Putting all the HTTP operations ...