← back to projects
Final project · University of Haifa

FitVision AI

A web information system that watches a workout through the phone camera, coaches technique in real time, and turns every set into an analytical progress report for the trainer.

The demo runs on a free server that sleeps when idle, so the first load takes about 30 seconds.

Project
Final project · University of Haifa
Team
4 students · Scrum
My role
Lead full-stack developer
Status
MVP live · field-tested

the idea

The problem

Many people train without a coach next to them, at home or in an open gym. They repeat exercises with poor form and get no objective feedback, which raises the risk of injury. Trainers, on their side, have no systematic way to follow trainees remotely and rely on what the trainee reports.

The solution

  • Pose detection in the browser, straight from the phone camera
  • Rep counting and form feedback on screen and by voice, as you train
  • Every workout logged at the set, rep and error-event level
  • Automatic reports, trends and alerts for the trainer
  • Video never leaves the phone – only numbers reach the server

my role

I was the lead full-stack developer, responsible for the system architecture and the database. In practice that meant owning the server side and the design documents behind it:

ArchitectureOverall system design, chapter 4 of the specification: DFD (levels 0 and 1), ERD, business rules and the permission model.
DatabaseA normalized 17-table SQL Server schema, versioned with Alembic migrations.
APIThe FastAPI server: authentication with JWT, role-based access control for trainees, trainers and admins.
Reports engineAutomatic post-workout reports with trends, exported to RTL PDF and Excel by background workers.

how it works

The heavy work happens on the trainee's phone. The server only receives the numeric results of each set, which keeps the system fast and private by design.

counting a rep

A rep is a state machine over a joint angle, not a single threshold. This is what stops noise and half-reps from being counted. Example: the knee angle in a squat.

Standingstart / end of a rep
angle drops below 150°
Downchecks descent rules
below the 100° depth threshold
Bottomrecords the lowest angle
rises 10° from the minimum
Upchecks ascent rules
above 160° → rep +1

Going back up without reaching the bottom is a partial rep and is not counted. All thresholds live in the database (TechniqueRules), so each exercise can be tuned without changing code.

data model

Seventeen normalized tables, in five groups. The core is a strict hierarchy: a session holds sets, a set holds reps, and every form mistake is stored as an event on the rep where it happened. That level of detail is what makes the trainer reports possible.

People & access
  • Users
  • TraineeProfiles
  • TrainerProfiles
  • TrainerTraineeAssignments
  • AuditLog
Plans
  • Goals
  • WorkoutPlans
  • PlanExercises
Exercise catalog
  • Exercises
  • TechniqueRules
Workout data
  • WorkoutSessions
  • ↳ ExerciseSets
  •   ↳ Repetitions
  •     ↳ FormErrorEvents
Reporting
  • Reports
  • TrainerNotes
  • ReportDeliveries

the app

Trainee screens on the phone: home, camera setup and the live workout with skeleton overlay and form alerts. The interface is in Hebrew, right to left.

FitVision AI trainee screens: live workout, setup, home
FitVision AI trainer dashboard
Trainer dashboard on desktop

testing with a real user

After the MVP was built we ran it on a real Android phone and read the results straight from the database. The data showed problems that no test on paper had caught:

What the data showed
What we changed
A squat set logged 10 reps, but 3 were noise – twitches of 200–300 ms when entering the frame.
A movement shorter than 0.6 s, or one that doesn't go 10° past the threshold, is no longer counted.
In bicep curls not a single rep passed – the thresholds were too strict for a side-view camera.
Recalibrated 50° → 75° and 20° → 35°, shipped as a database migration, not a code release.
The same correction repeated on every frame, even after it was fixed.
A coaching layer: one cue per rule per rep, rotating phrasings, plus "go all the way down" prompts and milestones.
From 2–3 meters away the on-screen text was hard to read.
Voice feedback on by default, in Hebrew or English, with a short sound for every good rep.

engineering

17
database tables
66
automated tests in CI
3
databases tested: SQL Server, PostgreSQL, SQLite
0
frames of video sent to the server

key insights

Privacy is an architecture decision

Running pose detection on the device meant the server never needs video. That one choice solved privacy, bandwidth and server cost together.

Rules belong in data, not code

Storing technique thresholds as database rows turned the post-trial recalibration into a migration, and lets an admin add exercises without a developer.

Real users beat assumptions

One session on a real phone exposed noise, wrong thresholds and unreadable screens. Reading the raw data showed exactly where to fix.

Let constraints pick the tools

Hebrew PDFs ruled out WeasyPrint, so reports print through Chromium. Slow report jobs moved to a Redis queue to keep the API fast.

what's next

Accuracy
Validation against 40 labeled videos, with a target of at least 95% rep-count accuracy and 85% recall on form errors for every exercise.
Pilot
A pilot with 5 trainers and 15 trainees, aiming for a SUS usability score of 70 or more.
Exercises
More exercises beyond the four in the MVP (squat, lunge, bicep curl, shoulder press) – added as data through TechniqueRules.
Showcase
Live demo, poster and presentation at the department's project conference, June 2028.

tech stack

React 19TypeScriptPWAMediaPipe PoseWeb WorkersIndexedDB Python 3.12FastAPISQLAlchemyAlembicSQL ServerPostgreSQL Redis & RQJWT & RBACPlaywrightpytestVitestDockerGitHub Actions
← previousBomberman next →yakov.LLM

get in touch

Questions about a project, the code or the way it was built? I'm always happy to talk about it.