A privacy-first movement-screening app: deterministic biomechanics computed entirely on-device, explained by on-device Movement Guidance.
FieldMD turns a phone or laptop camera into a movement-screening station — with everything processed and stored locally. An athlete performs a short, guided movement; on-device pose estimation extracts joint kinematics; transparent, deterministic biomechanics compute assessment-specific findings; and a local guidance mapper translates those findings into plain-language explanations and practice suggestions. Results save to on-device history for progress tracking. No wearables, no lab, no account, no cloud upload, nothing ever leaves your device.
FieldMD is a movement-screening prototype, not a medical device. It reports camera-derived movement observations. It does not diagnose injuries, predict injury probability, or replace professional evaluation.
| Assessment | Status | Measures |
|---|---|---|
| Single-Leg Squat | ✅ Supported | Knee tracking, squat depth, pelvic stability, trunk control, left/right symmetry |
| Single-Leg Balance | ✅ Supported | Postural sway, stability-loss events, hold completion, trunk control, side difference |
- Drop Landing — planned metrics: landing knee flexion, frontal knee displacement, left/right landing asymmetry, trunk position at impact, stabilization time.
- Lateral Step-Down — planned metrics: stance-knee tracking, pelvic drop, trunk compensation, movement depth, side-to-side consistency.
- Featherless interpretation layer — a validated LLM coaching layer exists in the codebase (
src/ai/,api/analyze.ts) behind the disabledFEATURE_FEATHERLESSflag (src/flags.ts); the public product ships with deterministic local guidance only. - Team rosters and shared coach dashboards.
flowchart LR
subgraph Device["On device (browser) — everything"]
CAM[Camera] --> POSE["MediaPipe Pose<br/>33 landmarks"]
POSE --> ANAT["Anatomical side mapping<br/>(vision/anatomy.ts)"]
ANAT --> BIO["Deterministic biomechanics<br/>angles · tilt · sway"]
BIO --> RULES["Assessment-specific rules<br/>thresholds → findings"]
RULES --> GUIDE["Movement Guidance<br/>local finding→advice mapper"]
GUIDE --> UI["Report UI"]
UI --> HIST["Local history<br/>(localStorage)"]
HIST --> PROG["Progress trends"]
end
subgraph Optional["Behind disabled flag (FEATURE_FEATHERLESS)"]
API["/api/analyze → Featherless"]
end
RULES -. "not used in public product" .-> API
Measure first, explain second — the product's core principle:
- Every number (joint angle, tilt, sway, symmetry) is computed locally with plain geometry. Same input → same output. Every finding names its value and threshold.
- Movement Guidance is a deterministic local mapper (
src/guidance.ts): each finding maps to a plain-language explanation and vetted, low-risk practice suggestions. Same findings → same guidance. No model output reaches the public UI.
FieldMD is built privacy-first, by design, not as an afterthought:
- Camera video, frames, and raw landmarks never leave the device — all pose tracking and biomechanics run in your browser.
- Assessment history and your optional details live only in this browser's local storage; clearing browser data removes them permanently.
- There is no account, no sign-in, and no cloud upload of any kind. FieldMD has no server-side user data, no database, and nothing to breach.
- Nothing is collected: no email, no name, no analytics, no tracking.
cd baton
npm install
npm run dev # the full product — everything runs locally
npm test # regression tests (anatomy, state machines, stores)FieldMD needs no environment variables to run. The table below only applies if you re-enable the disabled, experimental Featherless integration.
| Variable | Purpose |
|---|---|
FEATHERLESS_API_KEY |
Experimental disabled flag only; server-side, never bundled. |
FEATHERLESS_MODEL / FEATHERLESS_BASE_URL |
Experimental flag only; optional overrides. |
Never commit .env or .env.local. .env.example documents the contract.
npm run build # tsc (strict) + vite build → dist/
npm run preview # serve the built app locally- Import the
baton/directory as a Vercel project (Vite is auto-detected; outputdist/). - Deploy. Hash-based routes (
/#/app, …) work from the deployed site with no rewrite rules. The product is fully static — no environment variables, no database, no server-side user data. - Custom
.xyzdomain: Project → Settings → Domains → Add → enter your domain → follow Vercel's DNS instructions at your registrar (A/CNAME records). HTTPS is provisioned automatically. (Domain purchase/configuration is manual and intentionally not automated.)
The experimental
api/analyze.tsEdge function ships in the repo but is unused by the product (gated by the disabledFEATURE_FEATHERLESSflag). It only becomes active if you enable that flag and setFEATHERLESS_API_KEY.
The service worker is network-first for the app shell, so a new deploy is picked up on the next page load — users are never trapped on stale code.
- Open the deployed site in Safari on iOS.
- Tap Share → Add to Home Screen.
- Launch from the home-screen icon — FieldMD runs standalone (no browser chrome).
The app shows a small, dismissible install hint on iOS Safari. Note: the first load (including the pose model) requires a network connection; afterwards the runtime and model are cached.
- Vite + strict TypeScript — no UI framework; hand-rolled hash router and DOM views
- MediaPipe Tasks Vision (
@mediapipe/tasks-vision) — BlazePose 33-landmark tracking, on device - Canvas 2D — camera rendering, skeleton + measurement overlays
- Local guidance mapper (
src/guidance.ts) — deterministic finding → advice, on device localStorage— details + assessment history, per browser, never uploaded- PWA — manifest + service worker (installable; app shell cached)
- Vitest — targeted regression tests
- Experimental (disabled): Vercel Edge function + Featherless LLM coaching, behind
FEATURE_FEATHERLESS— not used by the public product
- Single 2D camera view: out-of-plane motion is approximated; true 3D angles are out of scope.
- Thresholds are literature-informed defaults, not person-specific norms.
- Landmark quality depends on lighting, clothing, and framing.
- First load requires a network connection for the MediaPipe runtime/model (cached thereafter).
- Details and history live only in this browser's
localStorage— there is no cross-device sync, by design; clearing browser data removes them permanently. - iOS installation is Safari-only (Share → Add to Home Screen); there is no install prompt API on iOS.
- Not clinically validated. Requires further validation with clinicians and athletes.
FieldMD provides educational movement observations from a camera-based screen. It is not a medical diagnosis, does not predict injuries, and must not be used to make treatment decisions. If you have pain, a prior injury, or any health concern, consult a qualified professional.