Extensive FastAPI with MongoDB example — part1
Introduction
This is going to be quite a lot to cover so I will split it into a series of articles to make it more digestible. The series consist of nine parts, every part adding something new to the previous parts, extending the total sum into something that is usable. It can be used in a production environment that consists of non-public (no incoming Internet traffic) system that protected behind a firewall.
The root of my example is derived from an example that Arjan have shown in a YouTube video, the corresponding code is available in this GitHub repo.
If you are looking for something that can be used in a public environment, then you need to increase the authentication to use OAuth2 to be on the safe side and put it behind a battle-hardened web server like Nginx. There might be more things to think of that I’ve not mentioned, but this series of articles does not have someone like Google as its target audience (by that I mean the humongous amounts of requests per second that they have).
Here’s a brief outline of the article parts:
- basic RESTful API (this article)
- Extending validation and documentation in the code
- How to handle configuration data
- Normalized log handling