API service for providing the user with access to various literary works.
Stack: Python, Aiohttp, PostgreSQL, SQLAlchemy
- MinIO - You need to have MinIO up.
- PostgreSQL - You need to have PostgreSQL up.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
-
Clone the repository
-
Use poetry to install dependencies:
poetry install
-
Create or use existing
.env
file in the/environment
directory of the project.
Set environment variables from.env
file:set -a && source environment/local.env && set +a
-
Make migrations for consistency database:
python src/manage.py migrate
-
Start service :
python src/manage.py start
- Build the Docker image:
docker build -t bws_app .
- Run the Docker container:
docker run -p 8080:8080 --env-file environment/local.env bws_app
- Start all side-app containers
docker-compose up
-
Route:
/readiness
Description: This endpoint is used to check the readiness of the API. -
Route: GET
/liveness
Description: This endpoint is used to check the liveness of the API. -
Route: GET | POST
/api/v1/books
Description: This endpoint is used to retrieve and send information about books. -
Route: GET
/api/v1/book_files/{id}
Description: This endpoint is used to download files associated with a specific book. -
Route: POST
/api/v1/book_files/{id}
Description: This endpoint is used to upload files associated with a specific book.
Tests are not ready yet for running in such a way!
- Edit environment variables in
tests/conftest.py
- Run tests
pytest .
- Write connection with S3 in async way
- Add fixtures for integrity tests
- CI/CD. Write a pipeline for automated testing and code quality checks
- CI/CD. Write a pipeline for quality checks (flake8, mypy)
- Set up logging in better way
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Author 1 - Initial work - Author1
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details.