https://github.com/t1m4/fastapi-recommendations
Recommendation project(FastAPI + SQLAlchemy core 1.4)
https://github.com/t1m4/fastapi-recommendations
celery fastapi kafka sentry sqlalchemy-core typer
Last synced: 25 days ago
JSON representation
Recommendation project(FastAPI + SQLAlchemy core 1.4)
- Host: GitHub
- URL: https://github.com/t1m4/fastapi-recommendations
- Owner: t1m4
- Created: 2022-12-02T07:24:54.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T07:25:30.000Z (over 3 years ago)
- Last Synced: 2025-01-14T15:40:46.211Z (over 1 year ago)
- Topics: celery, fastapi, kafka, sentry, sqlalchemy-core, typer
- Language: Python
- Homepage:
- Size: 70.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Recommendation service
## Run project
There are two ways to run service using docker-compose (recommended):
```shell
docker-compose up app
```
or running using poetry:
1. Update poetry to 1.2.0 version (once)
```shell
poetry self update --preview
```
2. Create file with env variables (once):
```shell
cp .env.example .env
```
3. Run docker related services:
```shell
docker-compose up db kafka
```
4. Run service:
```shell
poetry run docker/start.sh
```
## Prepare database
To have some test data on the developer environment,
you can recreate the database from backups of the database on staging.
1. Login to aws:
```shell
aws sso login --profile profile_name
```
2. Download backups
```shell
./docker/dumps-download.sh
```
3. Remove database volumes
```shell
docker-compose down --volumes
```
### Run tests
```shell
docker-compose run --rm test
```
### Database migration
* autogenerate migration
```shell
docker-compose run --rm alembic-autogenerate "Migration message"
```
* upgrade to latest version
```shell
docker-compose run --rm alembic upgrade heads
```
* upgrade to previous version
```shell
docker-compose run --rm alembic downgrade -1
```