How viethuy1602/assistant-nutrisnap works
NutriSnap is a multimodal nutrition-logging and habit-coaching application. Users authenticate, capture or enter a meal, review the proposed foods and portions, then save a log whose nutrition is calculated from food-reference data; the app also provides personalized AI coaching and progress features. The graph preserves the documented nutrition lookup order and major coaching, planning, social, health-sync, and reporting capabilities. Some feature routers and pages were not sampled, so their internal call paths are not asserted; dashed links indicate unverified frontend/API integration.
Main entry points: assistant_tools.py Assistant tools · orchestrator.py AI orchestrator · main.py FastAPI application · assistant_router.py Assistant endpoints
Components 24
User experience
- App routing
src/frontend/src/App.tsx - Frontend API client
src/frontend/src/api/client.ts
Meal ingestion
- Meal capture and review
src/frontend/src/pages/MealDiaryPage.tsx - Meal API client
src/frontend/src/api/mealApi.ts - Meal endpoints
src/backend/routers/meal_router.py - Meal preview
src/backend/main.py
AI and coaching
- Assistant endpoints
src/backend/routers/assistant_router.py - AI orchestrator
src/ai/orchestrator.py - Gemini client
src/ai/llm_client.py - Assistant tools
src/backend/services/assistant_tools.py
Nutrition and wellbeing
- Nutrition calculations
src/backend/services/nutrition_service.py - Food references
src/backend/models/schema.py - Goals and authentication
src/backend/routers/auth_goal_router.py - Analytics and progress
src/backend/services/analytics_service.py - Food preferences
src/backend/services/preference_service.py - Habits, plans, rewards
src/backend/services/habit_service.py - Buddy and challenges
src/backend/routers/buddy_router.py - Reports and recap
src/backend/routers/report_router.py - Health sync
src/backend/services/health_sync_service.py
Backend platform
- Account service
src/backend/services/auth_service.py - Session security
src/backend/services/auth_guard.py - Application database
src/backend/models/database.py - FastAPI application
src/backend/main.py
Other components
- User
Connections 23
- User → App routing: uses
src/frontend/src/App.tsx - App routing → Meal capture and review: routes to
src/frontend/src/App.tsx - Meal capture and review → Meal API client: submits meal
- Meal API client → Meal endpoints: calls API
- FastAPI application → Meal endpoints: registers routes
src/backend/main.py - FastAPI application → Meal preview: serves preview
src/backend/main.py - Meal preview → Nutrition calculations: uses nutrition logic
src/backend/main.py - Nutrition calculations → Food references: reads references
src/backend/services/nutrition_service.py - User → Assistant endpoints: asks assistant
- FastAPI application → Assistant endpoints: registers routes
src/backend/main.py - Assistant endpoints → AI orchestrator: dispatches chat
src/backend/routers/assistant_router.py - AI orchestrator → Gemini client: requests generation
src/ai/orchestrator.py - AI orchestrator → Assistant tools: dispatches tools
src/ai/orchestrator.py - Assistant endpoints → Assistant tools: executes tools
src/backend/routers/assistant_router.py - Goals and authentication → Account service: registers accounts
src/backend/routers/auth_goal_router.py - Goals and authentication → Session security: authenticates routes
src/backend/routers/auth_goal_router.py - Session security → Application database: loads user
src/backend/services/auth_guard.py - Assistant tools → Nutrition calculations: uses calculations
src/backend/services/assistant_tools.py - Assistant tools → Analytics and progress: uses insights
src/backend/services/assistant_tools.py - Assistant tools → Habits, plans, rewards: uses habit data
src/backend/services/assistant_tools.py - AI orchestrator → Food preferences: loads preferences
src/ai/orchestrator.py - Meal endpoints → Application database: persists meals
- Frontend API client → FastAPI application: exchanges API data