FastAPI follows the UNIX philosophy of "do one thing, and do it well". By using Starlette and Pydantic, FastAPI provides you with powerful tools to build a beautiful API. This gives you a lot of freedom to decide how you organise the rest of your codebase. The level of freedom also comes with some challenges once a codebase grows.
In this talk we explore some of the common challenges in building FastAPI apps, and share how we solved them:
- Minimizing the global state with dependency injection
- Reducing the complexity of testing a FastAPI app
- Pitfalls of async FastAPI
- Supporting multiple authentication schemes
- Modelling the relations between patch, response and database models
- 🎁 Bonus: Using Hypothesis to test your API
I am reasonably skilled Python developer. In the past I've worked quite a lot with Django. 2 years ago I started using FastAPI and was impressed by the powerful combination of Starlette and Pydantic to quickly build a well documented API.
At InvestSuite I work on multiple microservices: public & private API's, streaming financial data, machine learning models, etc.