https://cordovez.github.io/el-cordovezA point of departure for my development. 2023-08-19T16:10:52+02:00 Juan Carlos Cordovez-Mantilla https://cordovez.github.io/ Jekyll © 2023 Juan Carlos Cordovez-Mantilla /assets/img/favicons/favicon.ico /assets/img/favicons/favicon-96x96.png 04 Access to your back-end is transactional2023-08-19T15:47:06+02:00 2023-08-19T15:47:06+02:00 https://cordovez.github.io/posts/auth-intro/ Juan Carlos Cordovez-Mantilla Without getting too explicit about authorisation to this back-end, suffice it to say that the front-end will require a token for access. If this token is accepted, the front-end is then free to allow it’s user access to his junk. The entry point Because authorization relies on third-parties and specific security standards, it helps to think of this process in broad strokes before writing code... 03 Creating our first document in the database with the UserMongoDB model2023-05-24T10:35:44+02:00 2023-05-24T10:35:44+02:00 https://cordovez.github.io/posts/creating-documents/ Juan Carlos Cordovez-Mantilla It is important to revisit the structure of the project and the responsibilities of each of the folders within, because as the project grows we move back and forth between these: config: handles the connection to MongoDB controllers: holds the logic for manipulating data in the database models: contains the “shape” of the data routes: is where your front-end will find the different ac... 02 Beanie Models and database design2023-05-05T10:35:44+02:00 2023-05-24T15:33:41+02:00 https://cordovez.github.io/posts/working-with-beanie-models/ Juan Carlos Cordovez-Mantilla The most important fact to remember is that Beanie models are a special type of Pydantic model that has been customised to play nice with MongoDB. Your FastAPI server will work with Pydantic except when sending data to Mongo. So we will import both modules. Create a file inside the models directory and name it user_models.py with the following imports: from beanie import Document, Link from py... 01 FastAPI routes set up2023-04-24T14:31:13+02:00 2023-05-24T15:33:41+02:00 https://cordovez.github.io/posts/01-fastapi-setup/ Juan Carlos Cordovez-Mantilla FastAPI is the interface that you use to connect to your database, in our case MongoDB, to create, read, update and delete (CRUD) each instance of an object that you save to your database. MongoDB calls these documents. To begin this process make sure that you have set up your free account with MongoDB. They do a good job at guiding you through the process but roughly, the steps are: Sign ... 00 FastAPI, MongoDB, Cloudinary : An Introduction2023-04-21T15:09:49+02:00 2023-05-24T15:33:41+02:00 https://cordovez.github.io/posts/fastapi-mongo-beanie-tutorial/ Juan Carlos Cordovez-Mantilla If you are like me, you have flitted from tutorial to tutorial in an effort to master Python and then attempted to finish a project only to realise that, while the tutorial exercise worked perfectly, your use case is different and you don’t know how to solve the million errors that prop up when you go solo. The problem with these tutorials is that they are simplistic. Yes, they teach you the b...