Tech Stack
Architecture
Browser camera feed -> MediaPipe Pose (client-side) -> Joint angle calculation -> Rep counting state machine -> Gemini for food photo analysis (API call only for this). Hosting: Vercel static deploy = $0/month.Most AI fitness apps charge $10-30/month because they run everything server-side. FitTrack AI costs $0/month to host because all the heavy AI runs in your browser.
The Client-Side Architecture: MediaPipe Pose runs entirely in the browser via WebAssembly. It extracts 33 body landmarks from your camera feed at 30fps. No video ever leaves your device. Joint angles are calculated client-side using basic trigonometry — elbow angle for bicep curls, knee angle for squats, hip angle for deadlifts.
The Rep Counter State Machine: A simple state machine tracks exercise phases: starting position -> eccentric (lowering) -> bottom position -> concentric (lifting) -> top position -> count++. The thresholds are exercise-specific and tuned from real workout data.
The Only API Call: Food photo analysis uses Gemini's vision API — this is the one server-side call. You take a photo of your meal, Gemini estimates calories and macros. This could also run client-side with a smaller model, but Gemini's accuracy on Indian food (dal, roti, biryani) is significantly better.
Why This Matters: Zero infrastructure cost means zero scaling problems. Whether 10 people or 10,000 people use FitTrack AI, my hosting bill stays at $0. The Vercel free tier handles static file serving indefinitely. This is the architecture pattern I recommend for any AI product where privacy and cost matter.
Live at fitness.aiwithdhruv.com — try it with your camera right now.
Want to build something like this?
I architect and deploy end-to-end AI systems — from MVP to revenue.
Let's Talk