This is a simple API for a library management system built using FastAPI and SQLAlchemy.
- Create and manage books
- Create and manage students
- Handle borrowing and returning of books
-
Clone the repository:
git clone https://github.com/ritmodevoficial/api-sistema-de-gerenciamento-de-biblioteca.git
-
Navigate to the directory:
cd library-management-api
-
(Optional) Create a virtual environment:
python -m venv venv
And activate it:
-
On Unix or MacOS:
source venv/bin/activate
-
On Windows:
.\venv\Scripts\activate
-
-
Install the requirements:
pip install -r requirements.txt
-
Create a Postgres database for the application:
CREATE DATABASE lmsdb;
-
Restore the database from dumpfile
psql -U postgres -d lmsdb < dumpfile.sql
-
Update the database connection settings in
database/__init__.py
according to your PostgreSQL setup.
Run the application:
uvicorn main:app --reload
This will start the application on http://127.0.0.1:8000. You can explore the API via the built-in Swagger UI at http://127.0.0.1:8000/docs.
http://localhost:8000/docs#/ - Swagger UI can be investiaged for the endpoints.