How johnpbell7/whats_in_my_fridge works
Fridge is a phone-friendly fridge inventory PWA: users track food and expiry, then use scans or meal/chat suggestions to decide what to cook or buy. The main flow runs through the app shell into inventory, shopping, scan, or chat features, with browser-backed state and optional account sync. The server exposes AI, account, and billing operations. The README documents photo/receipt recognition and production serverless handlers; their detailed implementation wiring is not fully sampled, so those links are kept at the documented boundary.
Main entry points: App.jsx App shell · index.js Local API · api.js API client · core.js AI handlers
Components 20
App experience
- App shell
src/App.jsx
Food workflows
- Inventory
src/components/InventoryScreen.jsx - Photo scan
src/components/ScanScreen.jsx - Meal chat
src/components/ChatScreen.jsx - Shopping list
src/components/ShoppingScreen.jsx - Saved meals
src/components/SavedMeals.jsx
State and accounts
- Inventory store
src/lib/store.js - Shopping state
src/lib/shopping.js - Cloud sync
src/lib/cloud.js - Auth state
src/lib/useAuth.js
API and AI
- API client
src/lib/api.js - Local API
server/index.js - AI handlers
server/core.js - Usage and accounts
server/auth.js - Billing handlers
server/stripe.js - Production API
api
External services
- Supabase
src/lib/supabase.js - Anthropic Claude
- Stripe
Other components
- Fridge user
Connections 23
- Fridge user → App shell: uses
- App shell → Inventory: opens
- App shell → Photo scan: opens
- App shell → Meal chat: opens
- App shell → Shopping list: opens
- App shell → Saved meals: opens
- App shell → Inventory store: initializes
- App shell → Shopping state: initializes
- Inventory → Inventory store: reads and updates
- Photo scan → API client: requests recognition
- Meal chat → API client: requests suggestions
- Shopping list → Shopping state: reads and updates
- API client → Local API: sends requests
- Local API → AI handlers: dispatches AI calls
- Local API → Usage and accounts: checks accounts
- Local API → Billing handlers: dispatches billing
- AI handlers → Anthropic Claude: calls models
- Usage and accounts → Supabase: verifies and meters
- Auth state → Supabase: reads session
- Cloud sync → Supabase: syncs data
- Production API → AI handlers: exposes handlers
- Production API → Billing handlers: exposes billing
- Billing handlers → Stripe: manages payments