https://github.com/utkarsh1504/api-bacosmo
https://github.com/utkarsh1504/api-bacosmo
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/utkarsh1504/api-bacosmo
- Owner: Utkarsh1504
- Created: 2024-04-05T10:22:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-05T17:48:31.000Z (over 2 years ago)
- Last Synced: 2025-10-28T00:11:31.516Z (9 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Backend for Library Management System
This project is an API backend for the Library Management System. It provides endpoints to manage student records in the library system using FastAPI and MongoDB. Additionally, the backend is deployed and accessible [here](#deployed-backend).
## Table of Contents
- [Project Structure](#project-structure)
- [Setup](#setup)
- [API Documentation](#api-documentation)
- [Environment Variables](#environment-variables)
- [Dependencies](#dependencies)
## Project Structure
The project follows a modular structure with the following directories:
- `config/`: Contains configuration files for database connection settings.
- `models/`: Defines data models used in the application, such as the `Student` model.
- `routes/`: Contains route handlers for different API endpoints.
- `schema/`: Defines Pydantic schemas for serialization and deserialization.
- `main.py`: Entry point of the FastAPI application.
- `.env.sample`: Sample `.env` file for configuring environment variables.
- `requirements.txt`: List of Python dependencies required by the project.
- `.gitignore`: Specifies files and directories to be ignored by Git.
## Setup
1. Clone the repository:
```bash
git clone https://github.com/Utkarsh1504/api-bacosmo.git
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Rename `.env.sample` to `.env` and configure environment variables.
5. Start the FastAPI server:
```bash
uvicorn main:app --reload
```
## API Documentation
The API endpoints are documented using Swagger UI. Once the server is running, you can access the documentation at:
```
http://localhost:8000/docs
```
## Environment Variables
The following environment variables can be configured in the `.env` file:
- `MONGO_URL`: MongoDB connection URL.
## Dependencies
The project uses the following main dependencies:
- [FastAPI](https://fastapi.tiangolo.com/): Web framework for building APIs with Python.
- [PyMongo](https://pymongo.readthedocs.io/): Python driver for MongoDB.
- [python-dotenv](https://pypi.org/project/python-dotenv/): For loading environment variables from a `.env` file.