How krishnakant333/shelflife works
ShelfLife serves consumer households and food businesses through separate authenticated workspaces. Users maintain inventory; deterministic expiry, quantity, unit, and FIFO logic supports alerts, analytics, waste tracking, and safe consumer recipe generation, while AI assists with extraction and recommendations. The graph includes marketing, authentication, inventory operations, and intelligence capabilities. Some features are documented but their implementation was not sampled, so those branches are shown without asserted call relationships; the graph reflects only visible or documented connections.
Main entry points: dashboard/page.tsx Consumer dashboard · auth.ts Credentials auth · dashboard/page.tsx Business dashboard · AddProductFlow.tsx Product entry flow
Components 28
Public experience
- Marketing site
src/app/(marketing)/page.tsx
Access and workspaces
- Credentials auth
src/auth.ts - Consumer dashboard
src/app/dashboard/page.tsx - Business dashboard
src/app/business/dashboard/page.tsx - Postgres data
src/prisma/db.ts
Inventory operations
- Consumer inventory read
src/lib/inventory.ts - Business inventory
src/lib/business-inventory.ts - Inventory actions
src/lib/actions/inventory.ts - Business inventory actions
src/lib/actions/business-inventory.ts - Inventory workspace
src/components/dashboard/InventoryView.tsx - Product entry flow
src/components/dashboard/AddProductFlow.tsx - Inventory status
src/lib/inventory-status.ts - Unit normalization
src/lib/normalization.ts - CSV and invoice intake
src/lib/import - Product image storage
src/lib/storage.ts - Image lifecycle
src/lib/storage-lifecycle.ts - Vercel Blob
Food intelligence
- Label and invoice AI
src/lib/actions/label-scan.ts - Recipe generation
src/lib/actions/recipes.ts - Recipe workspace
src/app/dashboard/recipes/page.tsx - Groq AI
- Inventory analytics
src/app/dashboard/analytics/page.tsx - Waste tracking
src/app/dashboard/waste/page.tsx - Activity notifications
src/app/dashboard/notifications/page.tsx - Open Food Facts
Other components
- Visitor
- Consumer
- Business user
Connections 32
- Visitor → Marketing site: visits
src/app/(marketing)/page.tsx - Consumer → Credentials auth: signs in
README.md - Business user → Credentials auth: signs in
README.md - Credentials auth → Postgres data: checks credentials
src/auth.ts - Consumer dashboard → Credentials auth: validates session
src/app/dashboard/page.tsx - Business dashboard → Credentials auth: validates session
src/app/business/dashboard/page.tsx - Consumer dashboard → Consumer inventory read: loads inventory
src/app/dashboard/page.tsx - Business dashboard → Business inventory: loads inventory
src/app/business/dashboard/page.tsx - Consumer dashboard → Inventory status: classifies stock
src/app/dashboard/page.tsx - Business dashboard → Inventory status: classifies stock
src/app/business/dashboard/page.tsx - Consumer inventory read → Credentials auth: checks ownership
src/lib/inventory.ts - Consumer inventory read → Postgres data: reads items
src/lib/inventory.ts - Business dashboard → Inventory workspace: renders workspace
src/app/business/dashboard/page.tsx - Consumer dashboard → Inventory workspace: renders workspace
src/app/dashboard/page.tsx - Product entry flow → Inventory actions: submits changes
src/components/dashboard/AddProductFlow.tsx - Product entry flow → Business inventory actions: submits changes
src/components/dashboard/AddProductFlow.tsx - Product entry flow → Label and invoice AI: scans labels
src/components/dashboard/AddProductFlow.tsx - Product entry flow → Unit normalization: normalizes units
src/components/dashboard/AddProductFlow.tsx - Inventory actions → Image lifecycle: cleans image assets
src/lib/actions/inventory.ts - Image lifecycle → Postgres data: checks references
src/lib/storage-lifecycle.ts - Image lifecycle → Product image storage: deletes assets
src/lib/storage-lifecycle.ts - Product image storage → Vercel Blob: stores images
src/lib/storage.ts - CSV and invoice intake → Inventory actions: imports inventory
- CSV and invoice intake → Label and invoice AI: extracts invoices
- Label and invoice AI → Groq AI: extracts label data
README.md - Recipe workspace → Recipe generation: requests recipes
- Recipe generation → Consumer inventory read: filters ingredients
src/lib/actions/recipes.ts - Recipe generation → Groq AI: generates recipes
src/lib/actions/recipes.ts - Consumer dashboard → Inventory analytics: opens reports
README.md - Consumer dashboard → Waste tracking: tracks waste
README.md - Consumer dashboard → Activity notifications: views activity
README.md - Inventory actions → Open Food Facts: looks up imagery
README.md