Before running the FastAPI app, ensure you have the following installed:
- Python 3.x
- pip (Python package installer)
-
Clone the repository:
git clone [email protected]:5h15h1r/Library-Management-System.git cd Library-Management-System
-
Create a virtual environment (optional but recommended):
- On Windows:
python -m venv venv
- On macOS and Linux:
python3 -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
To start the app locally, follow these steps:
-
Make sure you are in the root directory of the project.
-
Run the following command to start the Uvicorn server:
uvicorn app.server.app:app --reload
OR
python3 app/main.py
-
Open your web browser and navigate to
http://localhost:8000
The following environment variables can be used to configure the FastAPI app:
MONGO_URI
: The Mongo connection URI used to connect to a self-hosted MongoDB standalone deployment or Mongo Atlas (format:mongodb+srv://[username:password@]host[/[defaultauthdb][?options]]
).
You can set these variables as needed before starting the server.
Documentation for the API can be accessed through the URL
- For SwaggerUI
http://localhost:8000/docs
- For Redoc
http://localhost:8000/redoc