Project outline
Staying with the situation that you operate a (small) used car sales agency, the requirements are somewhat similar to the ones in the previous chapters. You will build a backend for a web app that displays information and pictures of cars that are for sale. Unlike the previous chapters, now you will use an ODM, and you will include email sending and OpenAI integration, which will be handled by FastAPI’s background tasks.
The car data model will be handled by Pydantic and Beanie. The application will need authenticated users and, while you will use JSON Web Tokens (JWTs) again in the backend, on the frontend, which you will develop in the next chapter, they will be handled by cookies, with the help of a package called iron-session
.
Finally, you will integrate an LLM API (in this case, OpenAI) to help create useful car model descriptions, list the pros and cons of the newly inserted car model for the marketing pages, and send tailored emails to specified...