The Library Management System is a backend application built using FastAPI and MongoDB. It provides APIs for managing student records in a library.
- Create, read, update, and delete student records
- Filter students by country and minimum age
- Connects to MongoDB Atlas for data storage
- Python
- FastAPI
- MongoDB
- PyMongo
library_management_system/
├── app/
│ ├── database.py
│ ├── models.py
│ ├── controllers.py
│ ├── routes.py
├── main.py
├── requirements.txt
├── venv
└── .env
-
Clone the repository:
git clone https://github.com/himacharan128/library-api.git
-
Install dependencies:
cd library-api pip install -r requirements.txt
-
Set up environment variables:
MONGODB_URI=your_mongodb_uri
-
Start the server:
uvicorn main:app --reload
Visit http://127.0.0.1.8000 in your web browser to access the Library Management System.
- POST
/students
- Request Body:
{ "name": "Sham", "age": 25, "address": { "city": "Noida", "country": "IND" } }
- GET
/students
- Query Parameters:
- country (optional): Filter students by country
- age (optional): Filter students by minimum age
- GET
/students/{id}
- PATCH
/students/{id}
- Request Body:
{ "name": "string", "age": 0, "address": { "city": "string", "country": "string" } }
- DELETE
/students/{id}
Contributions are welcome! Feel free to submit issues and pull requests.
This project is licensed under the MIT License.