Monorepo for a Teddy Hospital X-Ray workflow:
backend/: FastAPI + TypeScript-compatible API contract (OpenAPI via/docs)frontend/: SvelteKit + TypeScript web appnginx/: reverse proxy template (/api-> backend,/-> frontend)tests/: backend pytest suitedocker/: Dockerfiles for dev/prod
cd backend
cp .env.example .env
python -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
uvicorn app.main:app --reload --port 8000cd frontend
cp .env.example .env
npm install
npm run dev -- --port 3000Frontend expects PUBLIC_BACKEND_URL in frontend/.env.
Default example points to http://localhost:8000.
cd backend
pip install -r requirements-dev.txt
cd ..
pytestcd frontend
npm install
npx playwright install --with-deps chromium
npm run test:e2ecp .env.example .env
cp backend/.env.example backend/.env
docker compose -f compose.dev.yaml up --buildHost-network development compose is the only supported dev setup.
- Backend:
http://localhost:8000 - Frontend:
http://localhost:3000 - Runner: connect an external real runner to
http://127.0.0.1:8000
If you need the old local mock runner setup, use:
docker compose -f compose.dev-dummy.yaml up --buildThe runner package lives in ./runner with sources under ./runner/src/runner. It can be installed independently (for example on a GPU machine) with pip install ./runner. It exposes tbk-runner --workflow dummy.
For the chroma workflow, install additional dependencies with pip install -r runner/requirements-chroma.txt and run with tbk-runner --workflow chroma.
The dummy workflow polls /api/worker/jobs/next, waits 5 seconds per case, performs a simple image manipulation, and submits the result back to /api/worker/jobs/{case_id}/results.
Optional runner env vars:
RUNNER_POLL_SECONDS(default2)RUNNER_HTTP_TIMEOUT_SECONDS(default30)
Chroma workflow VLM settings are passed explicitly via runner CLI options:
--vlm-server--vlm-server-key(optional)--vlm-model-name
cp .env.example .env
cp backend/.env.example backend/.env
docker compose -f compose.prod.yaml up --build -dNginx exposes:
- HTTP
:80 - HTTPS
:443
Upload limit is set to 100MB.
- Shared-password JWT auth
- QR batch generation and PDF download
- Case upload with metadata + QR content
- Worker job polling/submission protocol
- Review decisions: confirm, retry, cancel
- Storage abstraction with providers:
- Local filesystem (default)
- Seafile
- Fracture API/UI no-op flow
- Carousel with autoplay/manual controls
FastAPI autogenerated OpenAPI:
- Swagger UI:
http://localhost:8000/docs - OpenAPI JSON:
http://localhost:8000/openapi.json