Pokeria is structured as a modular monorepo. Local development can run directly on the host machine while leveraging Docker for PostgreSQL.
Ensure Python 3.12+ is installed:
# 1. Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate
# 2. Upgrade packaging tools
pip install --upgrade pip
# 3. Install Pokeria in editable mode with development dependencies
pip install -e ".[dev]"Alternatively, if using uv:
uv sync --extra dev
source .venv/bin/activatecd apps/web
npm install
cd ../..You can run only the database in Docker while running the application locally:
docker compose up -d postgresEnsure .env matches your local database port (e.g. POSTGRES_PORT=5432 or DB_PORT=5439):
# Execute all schema migrations to latest revision
alembic upgrade headWhen adding or altering SQLAlchemy models in apps/api/app/infrastructure/database/models/:
alembic revision --autogenerate -m "describe_schema_change"Always inspect the newly generated migration file in apps/api/migrations/versions/ before applying it.
Run the automated dev launcher (scripts/dev.sh):
./scripts/dev.shThis script:
- Applies pending Alembic migrations.
- Launches the durable background worker in the background.
- Starts the FastAPI server on
http://127.0.0.1:8000with hot reload. - Starts the Next.js dev server on
http://127.0.0.1:3000. - Gracefully kills background sub-processes on
Ctrl+C.
source .venv/bin/activate
export PYTHONPATH=apps/api:$PYTHONPATH
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadsource .venv/bin/activate
export PYTHONPATH=apps/api:$PYTHONPATH
python3 -m apps.worker.maincd apps/web
npm run devPokeria enforces strict automated quality gates. Code formatting and linting should be executed before pushing code:
# 1. Format code according to style rules
ruff format .
# 2. Run linter and import sorter
ruff check . --fix
# 3. Static type analysis (strict mode)
mypy apps/api/app tests/Install git pre-commit hooks to automate formatting and verification on commit:
pre-commit installRun the comprehensive verification script (scripts/check.sh):
./scripts/check.shThis runs Ruff format checks, Ruff lint checks, Pytest backend tests, Vitest frontend tests, and Next.js production builds.