FitGen - AI Smart Workout & Macro Diet Generator
An AI fitness planner where the model is structurally incapable of inventing an exercise, a food, or a calorie.

Problem
A workout plan off the internet doesn't know you train at home with two dumbbells, that your knee gives out under load, or that you're vegetarian and allergic to peanuts. So it prescribes squats you can't perform and food you won't eat. Asking ChatGPT instead is worse: it invents exercises that don't exist, cites videos that 404, and states calorie counts that contradict its own macros — confidently, with no way for you to tell.
Solution
FitGen splits the problem on a deliberate line. The AI decides only what's genuinely subjective — which exercises pair within a session, which foods compose a meal. Everything factual is code: exercise names, nutrition values, BMR, TDEE, macros, portion sizes, 1RM, body fat.
The model is handed a pre-filtered shortlist and may only select from it. After the response arrives, a grounding stage drops anything whose identifier isn't on that list — never repairs it, because a silent substitution would hide the failure. The guarantee therefore survives the model ignoring every instruction it was given. Injuries filter the candidate pool before generation, so an unsafe exercise is never even an option. When the AI is unavailable, a rule-based engine builds the plan from the same shortlist and the UI says which engine ran.
My contribution
- Sole developer - full-stack architecture, implementation and testing.
- Designed the hybrid "AI + verified data" architecture that is the project's core idea: partitioning every decision into one owned by a language model or one owned by deterministic code, then enforcing that boundary in software rather than in prompts.
- Built the complete backend — 60+ REST endpoints, 8 MongoDB collections, Google OAuth token-flow verification, JWT sessions, RBAC middleware, and a Zod validation boundary on every write
- Built the full React frontend — 15 lazy-split pages, a six-step onboarding wizard with live target preview, accessible charts, and PDF export
- Implemented both generation engines as a four-stage retrieve → generate → ground → fallback pipeline, with a deterministic rule-based engine behind each
- Implemented RAG from scratch — TF-IDF weighting, cosine similarity, stemming, synonym expansion and a multi-term relevance threshold — plus a safety-triage gate that refuses medical questions before any processing runs
- Implemented all physiological math deterministically: Mifflin–St Jeor BMR, TDEE, macro splits with safety floors, three-pass portion scaling, Epley 1RM, U.S. Navy body fat
- Decided deliberately not to use AI for injury filtering and load progression, because physical safety demands that identical input always yields identical output
- Wrote 578 assertions across 14 suites, including an adversarial suite that injects fabricated model responses — which caught a real bug where malformed LLM output crashed both generators instead of triggering fallback
Screenshots
Related projects
FeaturedFull StackPersonalCode Together
Code Together is a collaborative code editor for pair programming, interviews, and learning. Share a file, see every change live, and run it in your browser
- JavaScript
- React
- Tailwind CSS
- Redux
FeaturedFull StackPersonalReview Pulse AI
Review Pulse AI turns thousands of App Store and Google Play reviews into a scheduled, AI-written action report, delivered to your own Google Doc and Gmail.
- Next.js
- React
- TypeScript
- JavaScript