Skip to content

Features

Zoff edited this page Feb 23, 2026 · 1 revision

Features

1. Pantry Tracker

Main component: src/components/PantryTracker.jsx

This module lets users:

  • add food items with category, quantity, and expiration date
  • view active (not consumed) items
  • mark items as consumed
  • delete items
  • see "expiring soon" alerts for items with 0 to 3 days remaining

Implementation notes:

  • loads data from localStorage on mount
  • saves automatically to localStorage after every update
  • expired items display an Expired badge

2. Add Food Form

Component: src/components/AddFoodForm.jsx

Available fields:

  • name (required)
  • category (required)
  • quantity (optional)
  • expiryDate (required)

Important rule:

  • if expiryDate is empty, changing the category pre-fills a date based on estimated shelf life

3. Recipe Generator

Component: src/components/RecipeGenerator.jsx

This module:

  • lists active ingredients
  • highlights items expiring within 7 days
  • allows selecting ingredients
  • generates a recipe locally (mocked)

Current state:

  • no OpenAI API call in the current code
  • includes a 1.5s simulated API delay

4. Impact Dashboard

Component: src/components/ImpactDashboard.jsx

Displayed KPIs:

  • Food Saved (lbs)
  • CO2 Prevented (kg)
  • Water Saved (gallons)
  • Money Saved ($)

Current formulas per consumed item:

  • foodSaved += 0.5
  • co2Prevented += 2.5
  • waterSaved += 50
  • moneySaved += 4

The dashboard also includes:

  • saved vs wasted progress bars
  • environmental context cards
  • achievements

Clone this wiki locally