| Tool | Minimum version |
|---|---|
| Python | 3.14 |
| Node.js | 20 LTS |
| Docker | 24 |
| Docker Compose | v2 (bundled with Docker Desktop) |
| Git | 2.40 |
git clone <repo-url>
cd QueryGatewaycd backend
python -m venv .venv
# Linux/macOS:
. .venv/bin/activate
# Windows:
.venv\Scripts\activate
pip install -r requirements.txt
# Copy and edit environment variables
cp .env.example .envcd frontend
npm install
# Copy environment config (if present)
# cp .env.example .env# Copy root env example
cp .env.example .env
# Generate the required secrets (run with the backend environment activated)
python -c "import secrets; print(secrets.token_urlsafe(48))"
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
cd backend
python -c "from getpass import getpass; from app.auth.hashing import hash_password; print(hash_password(getpass('Admin password: ')))"
cd ..
# Edit .env to set JWT_SECRET_KEY, ENCRYPTION_KEY, ADMIN_USERNAME, and
# ADMIN_PASSWORD_HASH. Paste the generated bcrypt hash; never store plaintext.
docker compose up -d --buildCompose runs the one-shot migrate service before the API starts, so a fresh local db_data volume is initialized automatically.
To rerun migrations without restarting the whole stack:
make docker-migrateTo include a local Oracle XE instance:
docker compose --profile oracle up -dcd backend && uvicorn app.main:app --reloadAPI is available at http://localhost:8000. Interactive docs at http://localhost:8000/api/docs.
cd frontend && npm run devSPA is available at http://localhost:5173. Requests to /api/* are proxied to the backend.
Run these before opening a PR:
# Backend
cd backend
ruff check .
mypy .
pytest
# Frontend
cd frontend
npm run eslint
npm run prettier:check
npm run test
# Docker
docker compose buildOr use the Makefile at the repo root:
make check # run all checks
make check-backend
make check-frontend
make docker-build- Create a branch:
git checkout -b feat/<scope>. - Make minimal, scoped changes.
- For schema changes: add an Alembic migration (
alembic revision --autogenerate -m "describe change"). - For API changes: maintain
/api/v1/*compatibility or introduce a/api/v2/*route. - Run all checks for the area you changed.
- Update
docs/if you changed API contracts, config, or significant behavior. - Open a PR against
main.
For endpoint parameter, schedule binding, or snapshot filtering changes, update
the canonical parameter contract and keep the related root and
.github/instructions/ agent guidance aligned.
| Job | Checks |
|---|---|
| Backend | ruff check, mypy, pytest |
| Frontend | eslint, prettier --check, vitest |
| Docker | backend + frontend image builds, docker compose config |
All jobs are required to pass before a PR can be merged.
See docs/conventions.md for full details on:
- Branch/PR rules and commit hygiene
- API versioning and deprecation policy
- Database migration workflow
- Security constraints (SQL safety, auth, secrets)
- Logging standards
- Code style (Python and TypeScript)