Inspiration

One of our teammates kept spraining their ankle, and rehab between appointments was hard to stick with. Without a therapist watching, it's easy to skip reps, do them wrong, or lose track of the plan. Physical therapy only works if you actually do the work, and most of that work happens at home, alone, with nobody to say "that rep didn't count." We wanted to bring a little of the clinic home.

What it does

Therapy In Question turns your webcam into a guided home-exercise coach. Your therapist builds your program with exercises, sets, reps, and movement targets, and you follow it between visits.

Supported exercises

  • Seated knee extension
  • Straight leg raise
  • Sit-to-stand

For patients

  • Get your program: See the exercises, sets, reps, and targets your therapist assigned.
  • Get set up right: A framing check blocks the session until your whole body is in view, so tracking is reliable from the first rep.
  • Follow your routine: Open each exercise and move in front your camera. The app counts reps, detects holds, and measures joint angles in real time, with live feedback as you move.
  • Stay hands-free: Raise a hand to pause and resume, so you never have to leave your position to tap a screen.
  • Review your movement: Play back a skeleton recording of your session to see how you moved.
  • Hear from your therapist: Read follow-up messages in your patient inbox. AI drafts the messages, but they only reach you after your therapist approves them.

For therapists

  • Build exercise programs and assign them to patients.
  • Review, edit, and approve AI-drafted messages before anything is sent.

Private by design: Camera frames are processed in your browser and never saved as video. Only skeleton movement data is stored.

How we built it

  • Frontend: SvelteKit with TypeScript, built with Vite and Bun. Pose tracking runs entirely client-side. A One Euro filter smooths landmark jitter, geometry and angle math produces 3D joint angles, and quality checks reject unreliable readings.
  • Backend: Python and FastAPI on Uvicorn, managed with uv. It handles auth (JWT in a cookie), programs, exercises, durable patient sessions, and messaging.
  • Data: PostgreSQL (TimescaleDB) for structured data and time-series rep metrics, and MongoDB for the raw per-session movement recordings that power skeleton playback.
  • AI: Google Gemini drafts therapist messages, and nothing is sent until a therapist signs off.
  • Infrastructure: Docker Compose with a Traefik reverse proxy that routes /api to the backend and everything else to the frontend. GitHub Actions deploys main to a Vultr server.

Challenges we ran into

  • Architecture and deployment: Wiring up the Vultr deployment and composing the full stack with Docker took real effort, including Traefik path routing, HTTPS (browsers block webcam access on non-localhost HTTP), and getting the frontend to reach the backend both from the browser and server-side.
  • Noisy pose data: Raw pose landmarks jitter, especially at the edges of the frame or when a limb is partly hidden. Rep counting on raw data double-counted and missed reps until we added smoothing and quality gating.
  • Tracking dropouts: The tracker occasionally loses a landmark for a few frames, which used to kill an exercise mid-rep. We had to make sessions tolerate brief gaps without letting bad data slip through as real reps.
  • Measuring honestly: A single webcam can't give clinical-grade angles from every viewpoint. We spent time deciding when a reading is trustworthy, when to reject it, and how to tell users about the limits of the measurement instead of overpromising.
  • Choosing what to store: We wanted playback and progress tracking without recording video, which meant designing a recording format that captures movement but not the person's home or face.
  • Merging fast: Several of us built overlapping session, recording, and feedback features at once, so we reconciled competing approaches and consolidated them into one guided-session flow.

Accomplishments that we’re proud of

  • Real-time rep counting, hold detection, and joint-angle tracking that runs entirely in the browser, with no video recorded.
  • Smoothed 3D joint angles with automatic rejection of low-quality readings, so the numbers shown to patients can be trusted.
  • Hands-free control: raising a hand pauses and resumes a session, so patients can stay in position.
  • A therapist-in-the-loop messaging flow, so AI helps without speaking for the clinician.
  • Skeleton playback of recorded sessions, which gives patients and therapists a privacy-preserving way to review movement.
  • A full stack, from landing page to deployment pipeline, shipped in a weekend and deployed to a live server.
  • The drive to Massachusetts.

What we learned

  • Computer vision in the real world is mostly about handling imperfect data: filtering noise, deciding when to trust a reading, and failing gracefully.
  • Running inference client-side is a strong privacy story and removes the need to stream video, but it means every device has to keep up in real time.
  • How much of a project's difficulty lives in deployment and architecture, not just the code.
  • Healthcare-adjacent tools need honest limits. Telling users what a webcam can and can't measure is a feature, not a weakness.
  • How to work with API keys, secrets, and environment configuration across local, Docker, and production setups.

What's next for Therapy In Question

  • More exercises: Ankle pumps, heel slides, calf raises, balance holds, and shoulder and hip programs, so the library covers the common rehab protocols, starting with the ankle rehab that inspired the project.
  • Form correction in real time: Spoken and on-screen cues like "straighten your knee more" or "slow down on the way back."
  • Progress dashboards for therapists: Range-of-motion trends, adherence streaks, and rep-quality scores over time, powered by time-series data in TimescaleDB, with alerts when a patient plateaus or stops showing up.
  • Smarter, adaptive programs: Suggested progressions drawn from each patient's recorded performance, always subject to therapist approval.
  • Pain and effort check-ins: A quick after-session prompt that feeds into the therapist's view and the AI's message drafts.
  • Telehealth mode: Let a therapist watch a live skeleton stream during a video visit and adjust targets on the spot.
  • Mobile and offline support: A phone-first experience for propping a device against a wall, with on-device processing for low-connectivity homes.
  • Clinical validation: Partnering with physical therapists to test accuracy against goniometer measurements and refine the clinical limits notices.
  • Accessibility: Voice control, larger-text modes, and support for seated and limited-mobility variations.
  • A personal goal: Our teammate with the recurring ankle sprains plans to use it for their own rehab.

Built with

SvelteKit TypeScript Vite Bun Python FastAPI Uvicorn PostgreSQL TimescaleDB MongoDB Google Gemini Docker Traefik GitHub Actions Vultr JWT

Built With

Share this project:

Updates

Submission history