This project uses uv to manage dependencies, etc.
At first, install dependencies:
uv sync --no-project-installYou'll also need a running Postgres instance. Project was tested with the 17th version of the PostgreSQL.
Create and modify the .env file(add your Postgres settings, etc.):
cd e-check
cp example.env .env
vim .envYou'll need to create tables in the Database. Alembic package is managing the DB migrations of the project. To upgrade the DB scheme to the latest changes, activate the virtual environment and run alembic command:
source .venv/bin/activate
alembic upgrade heador execute the command with uv without the venv activation:
uv run alembic upgrade headTo start the app, execute the Uvicorn command:
source .venv/bin/activate
uvicorn --app-dir=src e_check.main:appor using uv:
uv run uvicorn --app-dir=src e_check.main:appEnsure your .env configured correctly. Note POSTGRES_DB=db is required.
Docker compose will pick it and pass variables to services.
docker compose upAfter starting your application, you may find the API's interactive documentation on http://localhost:8000/docs or on http://localhost:8080/docs if you're using docker-compose.
Alternatively, you could use the Redoc read only documentation on http://localhost:8000/redoc or on http://localhost:8080/redoc for docker compose.
To run tests, either active the virtual environment or use uv run from the project root directory:
source .venv/bin/activate
pytestuv run pytestNote
Tests use the testcontainers package(for Postgres), that uses Docker under the hood, so you'll need Docker to be installed to run tests.