How abirami-mj/smart_grocery_planner_ui works
Smart Grocery Planner is a React application for tracking grocery freshness, reducing waste, and supporting accessible food decisions, backed by a device-scoped API. The main flow is user entry of groceries, state/API synchronization, expiry and health calculations, then dashboard, alert, consume-today, and analytics views. Settings provide elder mode and voice/sound accessibility. The backend stores items and computes analytics in memory. Feature pages beyond the sampled excerpts are included from the README and source index; their internal implementation links are omitted where not evidenced.
Main entry points: App.jsx Routes and layout · GroceryContext.jsx Inventory and expiry state · GroceryItem.jsx Grocery item actions · Dashboard.jsx Health dashboard
Components 20
Application
- Routes and layout
src/App.jsx
Grocery lifecycle
- Add groceries
src/components/Grocery/GroceryForm.jsx - Inventory and expiry state
src/context/GroceryContext.jsx - Grocery item actions
src/components/Grocery/GroceryItem.jsx - Freshness display
src/components/UI/ProgressBar.jsx
Freshness insights
- Health dashboard
src/pages/Dashboard.jsx - Expiry tracker
src/pages/ExpiryTracker.jsx - Smart alerts
src/pages/SmartAlerts.jsx - Consume today
src/pages/ConsumeToday.jsx - Waste analytics
src/pages/WasteAnalytics.jsx
Accessibility settings
- Elder mode
src/pages/ElderMode.jsx - Settings controls
src/pages/Settings.jsx - Accessibility preferences
src/context/SettingsContext.jsx
Backend services
- Frontend API client
src/services/api.js - Grocery API routes
backend/main.py - Inventory and analytics store
backend/database.py - Grocery data models
backend/models.py
Other components
- Grocery planner
- API service
- Browser localStorage
Connections 32
- Grocery planner → Routes and layout: opens app
src/App.jsx - Routes and layout → Health dashboard: routes to
src/App.jsx - Routes and layout → Add groceries: routes to
src/App.jsx - Routes and layout → Expiry tracker: routes to
src/App.jsx - Routes and layout → Smart alerts: routes to
src/App.jsx - Routes and layout → Consume today: routes to
src/App.jsx - Routes and layout → Waste analytics: routes to
src/App.jsx - Routes and layout → Elder mode: routes to
src/App.jsx - Routes and layout → Settings controls: routes to
src/App.jsx - Add groceries → Inventory and expiry state: adds item
src/components/Grocery/GroceryForm.jsx - Add groceries → Frontend API client: submits item
src/components/Grocery/GroceryForm.jsx - Inventory and expiry state → Frontend API client: syncs inventory
src/context/GroceryContext.jsx - Expiry tracker → Grocery item actions: renders items
src/pages/ExpiryTracker.jsx - Health dashboard → Grocery item actions: renders items
src/pages/Dashboard.jsx - Smart alerts → Grocery item actions: renders items
src/pages/SmartAlerts.jsx - Consume today → Grocery item actions: renders items
src/pages/ConsumeToday.jsx - Grocery item actions → Inventory and expiry state: updates actions
src/components/Grocery/GroceryItem.jsx - Grocery item actions → Frontend API client: records actions
src/components/Grocery/GroceryItem.jsx - Health dashboard → Inventory and expiry state: reads metrics
src/pages/Dashboard.jsx - Expiry tracker → Inventory and expiry state: reads inventory
src/pages/ExpiryTracker.jsx - Smart alerts → Inventory and expiry state: reads inventory
src/pages/SmartAlerts.jsx - Consume today → Inventory and expiry state: reads suggestions
src/pages/ConsumeToday.jsx - Waste analytics → Inventory and expiry state: reads waste stats
src/pages/WasteAnalytics.jsx - Health dashboard → Freshness display: shows freshness
src/pages/Dashboard.jsx - Grocery item actions → Freshness display: shows expiry
src/components/Grocery/GroceryItem.jsx - Settings controls → Accessibility preferences: updates preferences
src/pages/Settings.jsx - Elder mode → Accessibility preferences: updates preferences
src/pages/ElderMode.jsx - Accessibility preferences → Browser localStorage: persists settings
src/context/SettingsContext.jsx - API service → Grocery API routes: serves requests
- Frontend API client → Grocery API routes: sends HTTP requests
src/services/api.js - Grocery API routes → Inventory and analytics store: reads and writes
backend/main.py - Inventory and analytics store → Grocery data models: creates responses
backend/database.py