https://github.com/insafmin/library_management_api
Library storage management system using API
https://github.com/insafmin/library_management_api
alembic docker fastapi postgres sqlalchemy
Last synced: 2 months ago
JSON representation
Library storage management system using API
- Host: GitHub
- URL: https://github.com/insafmin/library_management_api
- Owner: InsafMin
- License: mit
- Created: 2024-12-04T14:19:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-12T12:35:48.000Z (over 1 year ago)
- Last Synced: 2025-02-10T08:47:56.982Z (over 1 year ago)
- Topics: alembic, docker, fastapi, postgres, sqlalchemy
- Language: Python
- Homepage:
- Size: 73.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Async Library Management System with FastAPI, SQLAlchemy Postgres, Alembic, Docker
___
This is a prototype of a simple Web REST API built with [FastAPI](https://fastapi.tiangolo.com/) and an async Postgres database. To connect to the database, [SQLAlchemy 2.0](https://docs.sqlalchemy.org/en/20/) and [Asyncpg](https://magicstack.github.io/asyncpg/current/) are used. [Alembic](https://alembic.sqlalchemy.org/en/latest/index.html) is used for migrations.
To set up the connection to the database and launch the API, use docker-compose.
## Getting Started
___
### Installing
First, make sure you have the latest version of Docker.
Then, to get this repository from GitHub and open the project folder, do this:
```
git clone https://github.com/InsafMin/library_management_api
cd library_management_api
```
### Applying Database Migrations
Before launching the docker container, you need to apply all migrations:
```
docker-compose run backend alembic upgrade head
```
### Launch with Docker
To work with this section you must have docker and docker-compose tools installed. To run the program, spin up the containers with:
```
docker-compose up
```
If this is the first time bringing up the project, you need to build the images first:
```
docker-compose up --build
```
### Web Routes & Documentation
All routes are available on /docs. In your browser, navigate to
```
http://0.0.0.0:8000/docs
```