
Install Python from python.org and MongoDB community edition with the MongoDB Compass client. Then clone the repository, set up a virtual environment in your IDE, and connect to MongoDB.
Set up a FastAPI project with MongoDB, install necessary packages, structure code with config, models, and schemas, run a server with auto-reload, and access built-in docs to explore CRUD endpoints.
Set up a get api and connect to MongoDB in a FastAPI app by configuring a database module, defining the student model and schema, and exposing /students with async endpoints.
Create and apply a converter to map MongoDB documents to JSON by building a student model and schema for single and list responses in a FastAPI CRUD app.
Implement create API for students by converting database records to JSON via schemas, inserting into a MongoDB collection, and returning the updated list of students.
Implement update and delete endpoints for a student in a FastAPI and MongoDB CRUD app, using find one and update and find one and delete patterns.
In this course, you will learn to develop Rest API using FAST API, Python and MongoDB.
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints.
We will develop REST API using HTTP methods like GET, POST, PUT and DELETE, and respond data in JSON format with proper HTTP status codes.
We will connect MongoDB with our FastAPI application and perform the required CRUD operation.
FAST API is the fastest way to create RestFul webservices, it has high performance.
The key features are:
Fast: Very high performance, on par with NodeJS and Go (thanks to Starlette and Pydantic). One of the fastest Python frameworks available.
Fast to code: Increase the speed to develop features by about 200% to 300%. *
Fewer bugs: Reduce about 40% of human (developer) induced errors. *
Intuitive: Great editor support. Completion everywhere. Less time debugging.
Easy: Designed to be easy to use and learn. Less time reading docs.
Short: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
Robust: Get production-ready code. With automatic interactive documentation.
Standards-based: Based on (and fully compatible with) the open standards for APIs: OpenAPI (previously known as Swagger) and JSON Schema.