Live demo: https://trialspine.fly.dev/
The name is a hint: a lightweight backbone for cognitive tasks—sessions, trial rows, summaries, and CSV export.
Demo backend for browser cognitive tasks: Postgres holds sessions, trial rows, summaries, QC flags, and CSV export.
Built-in task: simple reaction time at /tasks/simple_rt/. Optionally mount open TestMyBrain HTML tests and take their POST /run submissions.
Independent demo — not affiliated with The Many Brains Project or testmybrain.org. Not for clinical use.
- simple_rt — static page plus
/v1/sessionsAPI (create → append trials → complete → export). Scoring: SCORING.md. - Open TMB (optional) — serve upstream HTML from
/tmb/…; storedata/score/outcomesonPOST /run. Tables: data_dictionary.md. - UI —
/hub,/dashboardlist and session detail.
- Docker and Docker Compose v2
- Open TMB only: git clone of TestMyBrainCodeRepo
git clone https://github.com/haowu0802/trialspine.git
cd trialspine
docker compose up --build| URL | |
|---|---|
/ |
Hub |
/tasks/simple_rt/ |
Simple RT |
/dashboard |
Sessions |
/docs |
OpenAPI |
docker-compose.tmb.yml bind-mounts your clone read-only at /tmb in the API container.
git clone https://github.com/manybrainsproject/TestMyBrainCodeRepo.git vendor/TestMyBrainCodeRepo
docker compose -f docker-compose.yml -f docker-compose.tmb.yml up --buildThe hub links to /tmb/… with ?demo=true (upstream short run — a few trials).
Upstream posts to /run when URL params showresults, autosave, and filename are not set; those params switch to local CSV/download instead. Some tests stop at a “Test complete!” alert without calling tmbSubmitToServer; HTML from /tmb/ gets tmb_submit_bridge.js injected to POST anyway.
Other clone path: copy .env.example to .env, set TMB_HOST_PATH.
| Variable | Default | |
|---|---|---|
DATABASE_URL |
in docker-compose.yml |
Postgres |
TMB_REPO_PATH |
/tmb |
Path inside container |
TMB_HOST_PATH |
./vendor/TestMyBrainCodeRepo |
Host mount (overlay compose only) |
simple_rt
POST /v1/sessionsPOST /v1/sessions/{id}/trialsPOST /v1/sessions/{id}/complete—scoring.py→ summary rowGET /v1/sessions/{id}/export.csv
Also GET /v1/sessions/{id}, GET /v1/sessions/{id}/summary, GET /health.
TMB submit
POST /run— form:data(JSON array),score, optionaloutcomes(JSON). Clientscoreis stored; trials are flattened intmb_adapt.py(best-effort, not the same path as simple_rt scoring).
backend/app/ FastAPI, models, scoring, TMB adapter
tasks/simple_rt/ built-in task
docker-compose.yml
docker-compose.tmb.yml
Compose bind-mounts backend/app and tasks/. After edits:
docker compose restart apiRebuild the image if requirements.txt or the Dockerfile changes.
MIT — LICENSE. Mounting TestMyBrain tests is optional; they stay under their upstream licenses in your clone.