How dayumcodes/calorie-tracker works
Calorie Tracker is a nutrition-tracking web app: users set up a profile and goals, record meals, then review daily intake and progress. AI food analysis and personalized insights support that loop; separate features generate diet plans and manage reminders. The README describes local persistence, while the sampled notification routes explicitly use Supabase for subscriptions. Some page and hook implementations were not sampled, so uncertain internal wiring is omitted.
Main entry points: app/page.tsx Dashboard · route.ts Notification API · manual/page.tsx Manual Logging · photo/page.tsx Photo Logging
Components 26
Food Tracking
- Dashboard
src/app/page.tsx - Manual Logging
src/app/log-food/manual/page.tsx - Photo Logging
src/app/log-food/photo/page.tsx - Barcode Logging
src/app/log-food/barcode/page.tsx - Food Text Analysis
src/ai/flows/analyze-food-text-flow.ts - Food Photo Analysis
src/ai/flows/analyze-food-photo.ts - Daily Log State
src/hooks/use-daily-log.ts - Smart Insights
src/components/dashboard/smart-insights.tsx
Plans And Progress
- Onboarding
src/app/onboarding/page.tsx - Profile State
src/hooks/use-user-profile.ts - Goal Tracking
src/hooks/use-goals.ts - Progress View
src/app/progress/page.tsx - Diet Chart
src/app/diet-chart/page.tsx - Indian Diet Generator
src/ai/flows/generateIndianDietChartFlow.ts
Accounts And State
- Authentication
src/components/auth/auth-form.tsx - Supabase Client
src/lib/supabase/client.ts
Reminders
- Reminder Settings
src/app/reminders/page.tsx - Reminder State
src/hooks/use-reminder-settings.ts - Subscription API
src/app/api/notifications/subscribe/route.ts - Notification API
src/app/api/notifications/send/route.ts - Push Service Worker
public/service-worker.js
Health Content
- Nutrition Articles
src/app/blog/page.tsx - Article Content
src/data/blog-content.ts
Other components
- User
- Supabase
- Web Push Service
Connections 26
- User → Dashboard: views
- User → Manual Logging: logs meals
- User → Photo Logging: submits photo
- User → Barcode Logging: scans food
- Manual Logging → Food Text Analysis: analyzes text
- Photo Logging → Food Photo Analysis: analyzes photo
- Dashboard → Daily Log State: reads log
- Smart Insights → Daily Log State: reads patterns
- User → Onboarding: sets up profile
- Onboarding → Profile State: updates profile
- Dashboard → Goal Tracking: shows targets
- User → Progress View: reviews progress
- User → Diet Chart: requests plan
- Diet Chart → Indian Diet Generator: generates chart
- User → Authentication: signs in
- Authentication → Supabase Client: calls auth
- Supabase Client → Supabase: authenticates
- User → Reminder Settings: configures reminders
- Reminder Settings → Reminder State: uses settings
- Subscription API → Supabase: stores subscription
- Notification API → Supabase: reads subscriptions
- Notification API → Web Push Service: sends push
- Web Push Service → Push Service Worker: delivers push
- Push Service Worker → User: shows notification
- User → Nutrition Articles: reads articles
- Nutrition Articles → Article Content: loads content