You will need uv and bun installed to test this application.
-
Copy
.env.exampleto.envandchris-frontend/.env.exampletochris-frontend/.envthen modify the values within to use your configuration. -
Run
docker compose -f docker-compose-dev.yml up -d --buildthen go to localhost:8080. Log in withadmin:admin. -
Within Keycloak create a new realm with the
chris-realm-export.jsonexport. Click into the chris-realm Realm, and then click into Clients and go to chris-backend. Then regenerate the Client Secret and paste it into thechris-backend/.envfile. -
Next in Keycloak go into Identity Providers and paste your Discord client secret.
-
Keycloak is now fully configured. Run
docker compose -f docker-compose-dev.yml up -d --build web api. to rebuild just the frontend and backend technically you only need to rebuild the api but it's good to know this command for development. -
Load the latest migrations to the api
docker compose exec api /migrate.sh upgrade -
Your app should now be fully configured. Open localhost:5173 to get started.
You can use docker compose down web && cd chris-frontend && bun run dev for live reloading on the frontend after successful application startup.
-
Python:
uv run ruff format ./ && uv run isort --profile black ./ && uv run ruff check --fix ./ -
Python Type Checking:
uv run mypy chris/ --config-file pyproject.toml -
TypeScript:
cd chris-frontend && bun run lint
- turn off all running containers then start up only the api and db containers
docker compose down -vdocker compose up -d --build api db - upgrade the database schema to latest
docker compose exec api /migrate.sh upgrade - creating a new migration run
docker compose exec api /migrate.sh autogen "description"- after this step you will need to extract the migrations file generated manually from the docker container with
docker compose exec api /bin/bashthen navigate to chris/migrations/ and copy the file generated and bring it back to your local machine to be committed to the repository.
- after this step you will need to extract the migrations file generated manually from the docker container with
- modify the migration file locally and test it with
docker compose exec api /migrate.sh upgrade - once migration is successful, commit the migration file.
docker compose exec api /migrate.sh upgradeis the standard method of deploying migrations in prod
| Command | Description |
|---|---|
/migrate.sh upgrade |
Apply all pending migrations |
/migrate.sh current |
Show current migration status |
/migrate.sh autogen "Description" |
Generate new migration (dev only) |
/migrate.sh stamp head |
Mark DB as current without running migrations |