Building a Backend with FastAPI
In the previous chapters, you learned the basic mechanics of authentication and authorization, and now you are ready to implement it and secure a web API, built with FastAPI. In this chapter, you will put this knowledge to good use and create a simple, yet fully functional REST API showcasing used cars and their pictures.
In this chapter, you will learn about the following actions, which can be thought of as a loosely coupled blueprint when creating a REST API with FastAPI.
This chapter will cover the following topics:
- Connecting the FastAPI instance to MongoDB Atlas by using the Python Motor driver
- Defining the Pydantic models according to the specification and initial creation of the FastAPI application
- Creating the API router and implementing CRUD operations
- Securing the API with a JWT
- Deployment to Render