- Fork and clone the repo
python -m venv venv && venv\Scripts\activate(orsource venv/bin/activate)pip install -r requirements.txt -r requirements-dev.txtcd client && npm ci --ignore-scripts && cd ..
Serving needs no ML framework. Only add -r requirements-ml.txt if you intend
to retrain or re-export the model.
The API reads models/weights.npz and models/scaler.json, which are generated
from model.keras and scaler.save. After retraining, regenerate them in the
same commit as the new model:
pip install -r requirements-ml.txt
python scripts/export_model.pytests/test_model_artifacts.py pins the prediction for a fixed input. A
legitimate retrain will change it -- update GOLDEN_PREDICTION alongside the new
artifacts, and say so in the PR. An unexpected change means something else
moved, so investigate before touching the constant.
Python: Black, isort, Ruff -- enforced via pre-commit hooks:
pip install -r requirements-dev.txt
pre-commit installFrontend: Prettier (npm run format in client/).
# Backend (59 tests)
python -m pytest tests/
# Frontend (19 tests)
cd client && npm testAll tests must pass before submitting a PR.
Human-editable pins live in requirements.txt (runtime), requirements-ml.txt
(TensorFlow/Keras) and requirements-dev.txt (tooling). pyproject.toml
mirrors them so uv.lock can resolve the full tree.
requirements.lock.txt and requirements-ml.lock.txt are generated and carry
hashes for every transitive dependency; the Docker build installs them with
--require-hashes. After changing any pin, refresh them:
uv lock
uv export --no-dev --no-emit-project --format requirements-txt -o requirements.lock.txt
uv export --no-dev --no-emit-project --extra ml --format requirements-txt -o requirements-ml.lock.txtPython is pinned to 3.12 (runtime.txt, .python-version, render.yaml,
Dockerfile) because TensorFlow 2.21 publishes no 3.13+ wheels. Keep those in
sync.
app/-- backend package (config, schemas, services, utils)main.py-- FastAPI entry pointclient/-- React frontendscripts/-- utility scripts (data fetching, model download)notebooks/-- training notebooktests/-- pytest test suite
- Create a feature branch:
git checkout -b feature/my-feature - Make changes, write tests
- Run
pre-commit run --all-files - Run
python -m pytest tests/andcd client && npm test - Commit with descriptive messages (
feat:,fix:,docs:) - Open a PR with a clear description
Include: steps to reproduce, expected vs actual behavior, OS/Python version, error logs.