The application uses fastAPI and MongoDB as backend servers to implement a simple REST API.
I have used asynchronous functions in most places.
FastAPI provides amazing support for asynchronous programming.
For Database Asynchronous operations, I have used Motor python package for MongoDB.
The API provides a simple API for a student database. The API is capable of performing
- Retrieve all students (GET)
- Retrieve single student using student-id (GET)
- Add a student (POST)
- Update a student info (PUT)
- Delete a student from Database
MongoDB local server is required to run the project. You can download the same from here. MongoDB Community Server.
Clone the repositiory and move to the repo-folder.
Install the required version appropriate for your os and get follow the instructions provided in the docs.
Note - Use Virtual Environment for Python installs.
pip install -r requirements.txt
To run the application follow these instruction. if you are inside the root folder, then move into the app folder.
then execute the following command.
python main.py
This will start the server in localhost:8000
To access the api endpoints, we have used the FastAPI built-in interface.
go to this url for that purpose.
localhost:8000/docs
test the API endpoints as much as you like!
Karan Mittal
Thanks for checking the repo out. Please share your thoughts or if you had any problems running the code.





