fastapi with pydantic v2, strict mvc. state is in-memory for now, so a restart clears it; postgres is the planned next step.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000openapi docs at http://localhost:8000/docs.
/cv/* imports the shared vision package from the sibling folder. the
comparator itself only needs numpy; install the vision requirements only if
you plan to run server-side tracking.
pip install -r requirements-dev.txt
python -m pytest testscovers routes, controllers, services, and core, with integration tests running against the real app through a test client.
GET /healthGET /lessonsPOST /cv/evaluatescores 21 landmarks against a reference gestureGET /cv/results?limit=N&user_id=Xrecent evaluations, optionally filtered to one userGET /routines,GET /routines/{id}POST /routinescreate a custom routine (owner increated_by)PUT /routines/{id}update; the body must carry the owner'screated_by, anything else gets a 403DELETE /routines/{id}?created_by=Xsame ownership rule, via query param since delete has no bodyPOST /progresslog an attempt; accepts an idempotency key (replays return the original response) and the client'stz_offset_minutesso streak days follow the learner's clockGET /progress/{profile_id}?limit=Nsummary plus recent recordsPUT /progress/{profile_id}/goalset the daily goal target (1 to 50)GET /profiles,POST /profiles,GET /profiles/{id}GET /analytics/{profile_id}accuracy trend, weak gestures, finger heatPOST /study/sessionstally a camera-free study session (browse or quiz)GET /study/{profile_id}study totals per deck plus quiz accuracy
all optional in dev. see .env.example for the full list.
HIGHFIVE_ENVenvironment label (dev, staging, prod)HIGHFIVE_CORS_ORIGINScomma-separated allowed originsHIGHFIVE_RATE_LIMITtoken bucket for the open POST endpoints, format<requests>/<window-seconds>per client ip; unset means disabled
main.py app factory plus middleware composition
core/ config, request ids, rate limit, server timing,
idempotency cache
routes/ http layer, thin, no logic
controllers/ orchestrate services into responses
services/ business logic (progress, analytics, profiles,
routines, cv)
models/ domain types
views/ request/response schemas
tests/ pytest suite
every response carries an x-request-id for log correlation and a
server-timing header with the in-app duration.