How vudigapranav/fridge works
FRIDGe helps a household track kitchen inventory, scan items, find recipes constrained by that inventory, and cook them while tracking freshness and estimated calories. The main flow runs from the Expo client through the API to inventory-aware recipe generation and back to recipe detail or Cook Mode. The README documents the validation, calorie, and deduction safeguards; sampled excerpts do not show the implementation of most route handlers or stores, so uncertain internal wiring is omitted.
Main entry points: app.ts Express app · app App screens · suggestions.ts Suggestion engine · api.ts API client
Components 24
Mobile client
- App screens
app/app - Recipe detail
app/app/recipe/[id]/index.tsx - Cook Mode
app/app/recipe/[id]/cook.tsx - Auth store
app/src/store/auth.ts - Inventory store
app/src/store/inventory.ts - Recipes store
app/src/store/recipes.ts - API client
app/src/lib/api.ts
API service
- Express app
api/src/app.ts - Auth routes
api/src/routes/auth.ts - Item routes
api/src/routes/items.ts - Scan routes
api/src/routes/scan.ts - Catalog routes
api/src/routes/catalog.ts - Suggestion routes
api/src/routes/suggestions.ts - Recipe routes
api/src/routes/recipes.ts - Image processing
api/src/lib/image.ts
Recipe intelligence
- Suggestion engine
api/src/ai/suggestions.ts - Inventory validation
api/src/ai/validate.ts - Calorie ranges
api/src/lib/calories.ts - Inventory deduction
api/src/lib/deduct.ts
Persistence and catalog
- Ingredient catalog
api/src/data/catalog.ts - Prisma access
api/src/lib/prisma.ts
Other components
- Household user
- Postgres
- OpenAI
Connections 31
- Household user → App screens: uses
- App screens → Auth store: manages session
- App screens → Inventory store: views inventory
- App screens → Recipes store: requests recipes
- Recipe detail → Recipes store: loads recipe
- Recipe detail → Cook Mode: starts cooking
- Auth store → API client: requests auth
- Inventory store → API client: requests inventory
- Recipes store → API client: requests recipes
- API client → Express app: sends JSON
- Express app → Auth routes: dispatches
- Express app → Item routes: dispatches
- Express app → Scan routes: dispatches
- Express app → Catalog routes: dispatches
- Express app → Suggestion routes: dispatches
- Express app → Recipe routes: dispatches
- Auth routes → Prisma access: reads and writes
- Item routes → Prisma access: accesses data
- Catalog routes → Ingredient catalog: serves catalog
- Scan routes → Image processing: processes image
- Scan routes → OpenAI: sends image
- Suggestion routes → Suggestion engine: requests suggestions
- Suggestion engine → OpenAI: requests structured recipes
- Suggestion engine → Inventory validation: checks recipes
- Suggestion routes → Calorie ranges: computes ranges
- Recipe routes → Inventory deduction: deducts ingredients
- Suggestion engine → Ingredient catalog: matches ingredients
- Inventory validation → Ingredient catalog: checks quantities
- Calorie ranges → Ingredient catalog: uses nutrition data
- Inventory deduction → Prisma access: updates inventory
- Prisma access → Postgres: reads and writes