The Decision Support API module is designed for a startup acceleration platform, assisting in ranking help measures for the current project using sBERT embeddings and cosine distance.
- Asynchronous API with swagger documentation
- Caching with Redis
- Interaction with the database using SQLalchemy and async driver aiomysql
- Migrations using Alembic
- Module for converting data from a database into text with ORM
- Module for text preprocessing
- Module for text ranking using sBERT embedding and cosine distance
- Autotests for API and database with pytest (with full database creation)
- Logging with Python JSON logger
- Sentry integration
- Monitoring with Grafana
- Linters with GitHub CI
- Fully containerized application
-
Change .env data to your development database configuration
-
Change .env.prod data to your production database configuration
-
Replace docker-compose db service with a real database
-
Run services
docker-compose up
-
Bring services down
docker-compose down
go to the local host address: http://127.0.0.1:8000/
-
Create a Python virtual environment and activate it.
-
Go to the folder with main.py
cd backend -
Install requirements:
python3 -m pip install --user -r requirements.txt
-
Run pytest
pytest
-
Run server using gunicorn:
uvicorn main:app --reload
go to the local host address: http://127.0.0.1:8000/