Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🧠 Adaptive Fitness & Energy Balance Engine

A daily energy balance modeling engine built as a local-first fitness tracker.

A personal engineering project focused on modeling real-world energy expenditure systems using simplified physiological approximations.

Unlike traditional fitness apps that assume a fixed TDEE, this system recalculates daily energy expenditure based on real user activity, transforming calorie tracking from a static estimate into a dynamic behavioral model.

🔗 Live demo: https://workout-tracker-mu-plum.vercel.app

TL;DR: React app that models daily energy expenditure dynamically (BMR + NEAT + MET + VO₂) instead of using a fixed multiplier. Tracks workouts, nutrition (23 micronutrients), and body weight. No backend, no account — runs entirely in the browser.


📸 Preview

Dashboard


🏗️ Architecture

Architecture


⚙️ Core Concept

Most fitness applications assume a constant daily energy expenditure:

"Your body burns X calories per day."

This project reframes it as:

"Energy expenditure is a function of daily behavior and training load."

TDEE becomes a dynamic state updated from real inputs rather than a fixed value.


🔥 Energy Model (Engine Logic)

Daily energy expenditure is computed as the sum of multiple physiological components:

1. Basal Metabolic Rate (BMR)

Mifflin-St Jeor equation:

BMR = 10W + 6.25H - 5A + 5

2. NEAT (Steps Component)

stepsKcal = steps * weight * 0.0005

3. Resistance Training Energy (MET-based model)

Training intensity is approximated using total "hard sets" volume:

Sets MET
≥ 18 sets 6.0
12–17 sets 5.5
8–11 sets 5.0
< 8 sets 4.5
liftingKcal = MET * weight * durationHours

4. Cardio Energy (VO2-based estimation)

Uses ACSM-derived VO2 approximation based on speed and incline:

VO2 → kcal conversion per minute

5. Daily Energy Balance

activeTDEE = BMR + steps + lifting + cardio + abs
energyBalance = activeTDEE - foodIntake

🧠 Design Philosophy

Most calorie tracking systems fail because they:

  • Assume constant daily expenditure
  • Ignore training variability
  • Treat rest days and training days identically

This system models energy expenditure as a dynamic daily function of workload, not a fixed constant.


🚀 Features

Workout tracking

  • ✅ 3 workout types: Upper, Legs, Rest — with predefined exercise templates
  • ✅ Per-set logging: weight, reps, duration
  • ✅ Cardio tracking: speed, incline, duration (VO2-based calorie estimation)
  • ✅ Automatic Personal Record (PR) detection with 1RM estimation
  • ✅ Warmup calculator per exercise
  • ✅ Copy previous session functionality

Nutrition tracking

  • ✅ Food database with 16 pre-loaded foods + custom entries
  • ✅ Full macro tracking: calories, protein, carbs, fat
  • ✅ 23 micronutrients: vitamins A/B/C/D/E/K, minerals (Ca, Fe, Mg, Zn, etc.)
  • ✅ Daily supplement tracking

Energy model

  • ✅ Dynamic TDEE estimation engine (BMR + NEAT + MET + VO2)
  • ✅ Real-time energy balance: TDEE vs food intake
  • ✅ AI Coach — rule-based feedback engine that classifies energy balance, protein intake, and training volume as good/warn/bad using configurable thresholds, with contextual text recommendations

Progress & history

  • ✅ Body weight log with 7-day rolling average
  • ✅ Progress photo storage (local)
  • ✅ Full workout + nutrition history per date
  • ✅ Local-first persistence — no backend, no account required

🧱 Tech Stack

Layer Technology Role
Frontend React (hooks-based) UI architecture
Logic JavaScript (ES6+) Energy model engine
Build Vite Bundling + dev server
Storage localStorage API Persistent client state
Deployment Vercel Hosting

📊 Model Calibration & Assumptions

The energy model is calibrated for a single user profile (author's own data) and validated informally over several weeks of personal use. Key assumptions:

Component Assumption Limitation
BMR Mifflin-St Jeor ±10% accuracy Does not account for body composition
NEAT Linear step-to-kcal approximation Ignores terrain, pace variation
MET Hard sets as intensity proxy Ignores rest periods, exercise selection
VO₂ ACSM treadmill formula Only valid for steady-state cardio

This is not a medical tool. Models are simplified for usability and personal tracking — not clinical accuracy.


⚖️ Design Tradeoffs

Decision Reason
No backend Zero setup friction, no multi-device sync
No external APIs Fully manual input for flexibility and offline use
Simplified physiology models Optimized for usability, not medical accuracy
localStorage only No account required, instant setup

🚀 Quick Start

git clone https://github.com/katanna13/workout-tracker
cd workout-tracker
npm install
npm run dev

📌 Future Improvements

  • Wearable integration (Apple Health / Google Fit)
  • Backend sync (Supabase / Firebase)
  • Regression-based calibration of calorie estimates
  • Visual analytics dashboard (fatigue + progress trends)
  • Dark/light theme toggle

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages