How lohith400/nutrition_traker works
NutriSync is an Indian-food nutrition coach: users set up a profile, log meals or water, review nutrition and activity, and can ask an optional AI coach for suggestions or actions. The dashboard calls a FastAPI service; deterministic nutrition logic and food matching support the coach and logging, while profile and history persist in SQLite or Turso. The README documents reminders, grocery planning, restaurant search, and fitness integration. Some frontend-to-API and unsampled feature relationships are documented rather than verified in source excerpts.
Main entry points: orchestrator.py Coach orchestrator · app.py HTTP API · reminders.py Reminders · math_engine.py Nutrition calculations
Components 23
Dashboard
- Dashboard pages
frontend/app - Coach chat
frontend/app/chat/page.tsx - Voice chat
frontend/app/hooks/useVoiceChat.ts - Navigation shell
frontend/app/components/Shell.tsx - Access gate
frontend/app/components/AccessGate.tsx
API
- HTTP API
backend/app.py - Coach orchestrator
backend/orchestrator.py
Nutrition
- Nutrition calculations
backend/math_engine.py - Food resolver
backend/rag_resolver.py - Food quality rules
backend/food_quality.py - Meal planner
backend/menu_planner.py
Persistence
- Profile and meal memory
backend/memory_agent.py - SQLite or Turso
backend/database.py - Food database builder
backend/db_setup.py
Integrations
- Grocery planning
backend/grocery.py - Reminders
backend/reminders.py - Google Fit sync
backend/google_fit.py - Restaurant search
backend/places_finder.py - LLM provider config
backend/llm_config.py
Other components
- User
- Google Fit
- LLM provider
- Notification services
Connections 36
- User → Dashboard pages: uses
README.md - Dashboard pages → HTTP API: calls API
README.md - Coach chat → Voice chat: uses
frontend/app/chat/page.tsx - Dashboard pages → Navigation shell: renders
frontend/app/grocery/page.tsx - Dashboard pages → Access gate: gates access
frontend/app/layout.tsx - HTTP API → Profile and meal memory: routes profile
backend/app.py - HTTP API → Reminders: routes reminders
backend/app.py - HTTP API → Coach orchestrator: imports
backend/app.py - HTTP API → Nutrition calculations: imports
backend/app.py - HTTP API → Meal planner: imports
backend/app.py - HTTP API → Food resolver: imports
backend/app.py - HTTP API → Google Fit sync: imports
backend/app.py - Coach orchestrator → LLM provider config: requests completion
backend/orchestrator.py - Coach orchestrator → Nutrition calculations: uses calculations
backend/orchestrator.py - Coach orchestrator → Profile and meal memory: uses profile data
backend/orchestrator.py - Coach orchestrator → Meal planner: uses suggestions
backend/orchestrator.py - Coach orchestrator → Food resolver: resolves foods
backend/orchestrator.py - Coach orchestrator → Grocery planning: checks groceries
backend/orchestrator.py - Coach orchestrator → Restaurant search: searches restaurants
backend/orchestrator.py - Coach orchestrator → Reminders: handles reminders
backend/orchestrator.py - Coach orchestrator → Google Fit sync: reads fitness
backend/orchestrator.py - LLM provider config → LLM provider: configures access
- Google Fit sync → Google Fit: fetches activity
backend/google_fit.py - Reminders → Notification services: sends notices
README.md - Reminders → Food resolver: resolves foods
backend/reminders.py - Reminders → Nutrition calculations: calculates macros
backend/reminders.py - Reminders → Profile and meal memory: logs meals
backend/reminders.py - Profile and meal memory → SQLite or Turso: reads and writes
backend/memory_agent.py - Nutrition calculations → SQLite or Turso: reads food and logs
backend/math_engine.py - Nutrition calculations → Food quality rules: uses diet rules
backend/math_engine.py - Food resolver → SQLite or Turso: reads food rows
backend/rag_resolver.py - Food resolver → Food quality rules: filters diet
backend/rag_resolver.py - Meal planner → SQLite or Turso: reads food data
backend/menu_planner.py - Meal planner → Food quality rules: uses quality rules
backend/menu_planner.py - Food database builder → SQLite or Turso: uses adapter
backend/db_setup.py - Food database builder → Food quality rules: grades food rows
backend/db_setup.py