How bhuvanchebrolu/foodloop_frontend works
FoodLoop is a React application for managing household food and coordinating food sharing. Users authenticate, enter the protected app, and work with pantry items; they can also share food, manage requests, and view alerts and analytics. Administrative screens cover users, apartments, shares, and reports. The frontend uses service modules to make authenticated API requests, with a separate Firebase messaging path for push notifications. The README is a Vite template and documents no product capabilities; this map reflects the supplied source index and excerpts, so backend behavior is not described.
Main entry points: AppRoutes.jsx Route dispatch · api.js HTTP client · HomePage.jsx Pantry dashboard · useAuth.js Auth hook
Components 26
Application and identity
- Route dispatch
src/routes/AppRoutes.jsx - Session state
src/contexts/AuthContext.jsx - Auth hook
src/hooks/useAuth.js - Sign in
src/pages/LoginPage.jsx - Profile settings
src/pages/ProfilePage.jsx
Pantry management
- Pantry dashboard
src/pages/HomePage.jsx - Food state
src/hooks/useFoods.js - Add food
src/pages/AddFoodPage.jsx - Food operations
src/services/foodService.js - Consumption records
src/services/consumptionService.js - Waste records
src/services/wasteService.js - Food alerts
src/pages/AlertsPage.jsx
Community sharing
- Publish food
src/pages/ShareFoodPage.jsx - Community feed
src/pages/CommunityPage.jsx - Sharing operations
src/services/shareService.js - Community reports
src/services/reportService.js
Insights and administration
- Analytics
src/pages/AnalyticsPage.jsx - Admin console
src/pages/AdminPage.jsx - Admin operations
src/services/adminService.js
API and notifications
- HTTP client
src/services/api.js - Authentication API
src/services/authService.js - User API
src/services/userService.js - Push messaging
src/firebase/messaging.js - Device registration
src/services/deviceService.js
Other components
- Application backend
- Firebase messaging
Connections 43
- Route dispatch → Sign in: routes to
src/routes/AppRoutes.jsx - Route dispatch → Pantry dashboard: routes to
src/routes/AppRoutes.jsx - Route dispatch → Add food: routes to
src/routes/AppRoutes.jsx - Route dispatch → Food alerts: routes to
src/routes/AppRoutes.jsx - Route dispatch → Publish food: routes to
src/routes/AppRoutes.jsx - Route dispatch → Community feed: routes to
src/routes/AppRoutes.jsx - Route dispatch → Profile settings: routes to
src/routes/AppRoutes.jsx - Route dispatch → Analytics: routes to
src/routes/AppRoutes.jsx - Route dispatch → Admin console: routes to
src/routes/AppRoutes.jsx - Sign in → Auth hook: uses
src/pages/LoginPage.jsx - Auth hook → Session state: reads
src/hooks/useAuth.js - Session state → Authentication API: authenticates with
src/contexts/AuthContext.jsx - Session state → User API: loads settings
src/contexts/AuthContext.jsx - Profile settings → Auth hook: uses
src/pages/ProfilePage.jsx - Profile settings → Push messaging: configures push
src/pages/ProfilePage.jsx - Pantry dashboard → Auth hook: uses
src/pages/HomePage.jsx - Pantry dashboard → Food state: loads pantry
src/pages/HomePage.jsx - Food state → Food operations: fetches and changes
src/hooks/useFoods.js - Add food → Food state: edits pantry
src/pages/AddFoodPage.jsx - Pantry dashboard → Consumption records: records consumption
src/pages/HomePage.jsx - Pantry dashboard → Waste records: records waste
src/pages/HomePage.jsx - Food alerts → Consumption records: uses
src/pages/AlertsPage.jsx - Food alerts → Waste records: uses
src/pages/AlertsPage.jsx - Food alerts → Food operations: uses
src/pages/AlertsPage.jsx - Publish food → Food operations: loads food
src/pages/ShareFoodPage.jsx - Publish food → Sharing operations: publishes shares
src/pages/ShareFoodPage.jsx - Community feed → Sharing operations: manages requests
src/pages/CommunityPage.jsx - Community feed → Community reports: submits reports
src/pages/CommunityPage.jsx - Community feed → Auth hook: uses
src/pages/CommunityPage.jsx - Analytics → Application backend: loads analytics
- Admin console → Admin operations: manages platform
src/pages/AdminPage.jsx - Food operations → HTTP client: sends requests
src/services/foodService.js - Consumption records → HTTP client: sends requests
src/services/consumptionService.js - Waste records → HTTP client: sends requests
src/services/wasteService.js - Sharing operations → HTTP client: sends requests
src/services/shareService.js - Community reports → HTTP client: sends requests
src/services/reportService.js - Admin operations → HTTP client: sends requests
src/services/adminService.js - Authentication API → HTTP client: sends requests
src/services/authService.js - User API → HTTP client: sends requests
src/services/userService.js - HTTP client → Application backend: HTTP requests
src/services/api.js - Push messaging → Device registration: registers token
src/firebase/messaging.js - Device registration → HTTP client: sends requests
src/services/deviceService.js - Push messaging → Firebase messaging: uses messaging
src/firebase/messaging.js