How mdtoufiq-dev/nutriguard works
NUTRIGUARD combines a React nutrition-planning app with an Express API for plans, chat, calendar, scanning, restaurants, maps, and user endpoints. The principal user flow is entering preferences in the landing-page sandbox, revealing the app, and navigating its dashboard and nutrition features. The README documents several interactions as placeholders or future integrations, so the graph distinguishes those documented UI capabilities from backend calls visible in the sampled source. Unsampled backend routes and database behavior are represented only at their supported directory level.
Main entry points: App.jsx App routing · app.js Express API · Meals.jsx Meal plans · Dashboard.jsx Health dashboard
Components 31
Nutrition app
- App routing
src/App.jsx - Preferences form
src/components/Hero.jsx - Health dashboard
src/components/Dashboard.jsx - Meal plans
src/components/Meals.jsx - Nutrition chat
src/features/chat/ChatView.jsx - Adherence calendar
src/features/calendar/CalendarView.jsx - HTTP client
src/services/api.js - Loader state
src/contexts/LoaderContext.jsx - Toast state
src/contexts/ToastContext.jsx
Plans and health
- Health profile
src/integration/getHealthProfile.js - Current user
src/integration/useCurrentUser.js - Plan API client
src/services/planService.js - Plan generator
src/utils/planGenerator.js - Meal library
src/data/mealLibrary.js - Safety checks
src/utils/safetyChecker.js
Food discovery
- Restaurant radar
src/features/radar/RadarView.jsx - Food scanner
src/features/scanner/ScannerView.jsx - Delivery client
src/services/deliveryService.js - Scanner client
src/services/scannerService.js
API and AI
- Express API
server/src/app.js - Plan endpoints
server/src/routes/plans.js - Calendar endpoints
server/src/routes/calendar.js - Scan endpoints
server/src/routes/scan.js - Restaurant endpoints
server/src/routes/restaurants.js - Maps endpoints
server/src/routes/maps.js - Chat endpoint
server/src/routes/chat.js - LLM service
server/src/services/llmService.js - Geocoding service
server/src/services/geocodingService.js - Delivery service
server/src/services/deliveryService.js - Domain models
server/src/db/models
Other components
- User
Connections 36
- User → Preferences form: sets preferences
- Preferences form → App routing: reveals app
src/App.jsx - App routing → Health dashboard: routes to
src/App.jsx - App routing → Nutrition chat: routes to
src/App.jsx - App routing → Adherence calendar: routes to
src/App.jsx - App routing → Restaurant radar: routes to
src/App.jsx - App routing → Food scanner: routes to
src/App.jsx - App routing → Meal plans: routes to
src/App.jsx - Health dashboard → Current user: reads user
src/components/Dashboard.jsx - Health dashboard → Plan API client: requests plans
src/components/Dashboard.jsx - Meal plans → Current user: reads user
src/components/Meals.jsx - Meal plans → Plan API client: requests plans
src/components/Meals.jsx - Meal plans → Plan generator: generates plan
src/components/Meals.jsx - Plan generator → Meal library: selects meals
src/utils/planGenerator.js - Nutrition chat → Health profile: reads profile
src/features/chat/ChatView.jsx - Nutrition chat → Plan API client: requests plans
src/features/chat/ChatView.jsx - Restaurant radar → Health profile: reads profile
src/features/radar/RadarView.jsx - Restaurant radar → Delivery client: searches restaurants
src/features/radar/RadarView.jsx - Food scanner → Health profile: reads profile
src/features/scanner/ScannerView.jsx - Food scanner → Scanner client: submits scans
src/features/scanner/ScannerView.jsx - Food scanner → Safety checks: checks safety
src/features/scanner/ScannerView.jsx - Plan API client → HTTP client: sends requests
src/services/planService.js - Delivery client → HTTP client: sends requests
src/services/deliveryService.js - Scanner client → HTTP client: sends requests
src/services/scannerService.js - Express API → Plan endpoints: mounts route
server/src/app.js - Express API → Calendar endpoints: mounts route
server/src/app.js - Express API → Scan endpoints: mounts route
server/src/app.js - Express API → Restaurant endpoints: mounts route
server/src/app.js - Express API → Maps endpoints: mounts route
server/src/app.js - Express API → Chat endpoint: mounts route
server/src/app.js - Chat endpoint → LLM service: requests response
server/src/routes/chat.js - Maps endpoints → Geocoding service: geocodes locations
server/src/routes/maps.js - Restaurant endpoints → Delivery service: requests delivery
server/src/routes/restaurants.js - Restaurant endpoints → Domain models: uses order and favorite models
server/src/routes/restaurants.js - Health dashboard → Loader state: uses loading state
src/components/Dashboard.jsx - Meal plans → Toast state: uses notifications
src/components/Meals.jsx