Skip to content

Latest commit

 

History

History
98 lines (67 loc) · 1.45 KB

File metadata and controls

98 lines (67 loc) · 1.45 KB

Backend

Setup

Install UV then setup the virtual environment

uv venv

Install ffmpeg (required for Whisper model)

# Ubuntu
sudo apt update && sudo apt install ffmpeg

# MacOS
brew install ffmpeg

Install PostgreSQL

# Ubuntu
apt install postgresql

# MacOS
brew install postgresql

Install Docker and verify installation

docker

Install project dependencies. Specify either cpu or gpu.

# Pytorch w/ CPU
uv sync --extra cpu

# Pytorch w/ GPU
uv sync --extra gpu

Install pre commit hooks and format files

pre-commit install
pre-commit run --all-files

Create .env file and set variables

cp .env.example .env

Create dbs

# Dev db
createdb -h localhost -p 5432 -U postgres 'rpg-encounters'

# Test db
createdb -h localhost -p 5432 -U postgres 'rpg-encounters-test'

Manage db

# Create
uv run python -m app.db.init_db

# Migrate 
uv run alembic -c alembic.ini upgrade head

# Seed defaults
uv run python -m tests.fixtures.seed_data

# Seed defaults for specific email
uv run python -m tests.fixtures.seed_data --email <USER_EMAIL>

Launch backend services following usage instructions and verify with tests

uv run pytest

Admin

Create migration revision

uv run alembic -c alembic.ini revision -m "describe_change"