How hemnath-kandasamyk/calorie-tracker works
This repository is an AI diet recommendation system with a FastAPI interface. Its main user flow accepts body metrics and activity level, calculates BMI/BMR/TDEE and daily macronutrient targets, then returns ranked foods; a separate endpoint can produce a meal plan. Recommendation code also supports goal-based filtering, macro matching, ranking, and an offline-trained model capability. The graph follows documented routes and capabilities plus the source index; unsampled implementation details are not treated as verified call relationships.
Main entry points: app.py FastAPI routes · recommendation.py Recommendation engine · recommendation_utils.py Recommendation utilities · processed_food_dataset.csv Processed food dataset
Components 16
API and orchestration
- FastAPI routes
backend/app.py - Backend configuration
backend/config.py
Health calculations
- BMI calculator
src/health/bmi.py - BMR calculator
src/health/bmr.py - TDEE calculator
src/health/tdee.py - Macro targets
src/health/nutrition.py
Food recommendations
- Recommendation engine
src/recommendation/recommendation.py - Goal food filters
src/recommendation/food_filter.py - Nutrition matching
src/recommendation/nutrition_match.py - Food ranking
src/recommendation/ranking.py - Meal planner
src/recommendation/meal_planner.py - Recommendation utilities
src/recommendation/recommendation_utils.py - Density predictor
src/recommendation/predictor.py
Nutrition data and models
- Processed food dataset
datasets/processed/processed_food_dataset.csv - Trained regression models
trained_models
Other components
- User
Connections 19
- User → FastAPI routes: submits profile
README.md - FastAPI routes → BMI calculator: calculates BMI
README.md - FastAPI routes → BMR calculator: calculates BMR
backend/app.py - FastAPI routes → TDEE calculator: calculates TDEE
backend/app.py - FastAPI routes → Macro targets: gets macro targets
backend/app.py - FastAPI routes → Recommendation engine: requests recommendations
README.md - FastAPI routes → Meal planner: requests meal plan
backend/app.py - FastAPI routes → Processed food dataset: loads food data
backend/app.py - Backend configuration → Processed food dataset: sets dataset path
backend/config.py - Backend configuration → Trained regression models: sets model directory
backend/config.py - Recommendation engine → Goal food filters: filters foods
README.md - Recommendation engine → Nutrition matching: scores macro fit
README.md - Recommendation engine → Food ranking: ranks foods
README.md - Recommendation engine → Processed food dataset: uses food records
README.md - Meal planner → Recommendation utilities: uses shared helpers
src/recommendation/meal_planner.py - Goal food filters → Recommendation utilities: uses shared helpers
src/recommendation/food_filter.py - Nutrition matching → Recommendation utilities: uses shared helpers
src/recommendation/nutrition_match.py - Food ranking → Recommendation utilities: uses shared helpers
src/recommendation/ranking.py - Density predictor → Trained regression models: loads model
src/recommendation/predictor.py