Skip to content
 
 

Repository files navigation

Setup

Install UV Package Manager

curl -LsSf https://astral.sh/uv/install.sh | sh

Install Python Using UV

uv python install 3.12

Install Dependencies

Local Env

uv sync

On Deployment

uv sync --no-dev

Database Setup

The setup uses alembic (aleady installed by uv with uv sync). Ideally to develop locally in a more reliable/easy way you should use docker.

Run MySQL on Docker

docker run -d \
  --name mysql \
  -e MYSQL_ROOT_PASSWORD=reportsdone \
  -e MYSQL_DATABASE=reports \
  -e MYSQL_USER=bd \
  -e MYSQL_PASSWORD=reportsdone \
  -p 3306:3306 \
  mysql:latest

Replace the values with whatever you are using in your .env file.

Apply Previous Migrations Into The DB

alembic upgrade head

This is included as a step during deployment to always keep the DB up to date.

Apply New Migration

uv run alembic revision --autogenerate -m "some_commit_mesage"

Finish off with:

alembic upgrade head

Delete Migration

Revert the latest migration:

alembic downgrade -1

Remove the newly generated migration script:

rm alembic/versions/<migration_filename>.py

Run Application

Run the Backend

uv run main.py

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages