Skip to content
/ pantrio Public

AI-powered fridge inventory app that scans your fridge with a photo and catalogs everything inside.

Notifications You must be signed in to change notification settings

knovu/pantrio

Repository files navigation

pantrio 🧊

AI-powered fridge inventory app that scans your fridge with a photo and catalogs everything inside.

Demo

Demo


What is this?

Pantrio is a combination of user built scaffolding and pieces of Claude Code to help tighten the loose ends. It demonstrates how quickly you can go from zero to a working, production-quality web app using AI-assisted development.

The app lets you take a photo of your fridge, upload it, and have Claude's vision model automatically identify every food item inside — categorizing each one, estimating its condition, and saving your inventory locally. From there, a dashboard gives you a breakdown of what you have and compares estimated retail prices across popular grocery stores.


Features

  • AI Fridge Scanner — drag & drop or browse to upload a fridge photo; Claude (claude-sonnet-4-6) identifies every visible item and returns structured data
  • Smart Categorisation — items are tagged with a category (dairy, produce, meat, beverages, condiments, leftovers, frozen, other) and a condition (fresh, expiring soon, unknown)
  • Card & List Views — toggle between a visual card grid and a compact list layout
  • Edit & Delete — manually correct any item's name, quantity, category, condition, or price via an inline dialog
  • Persistent Inventory — your fridge data is saved to localStorage and survives page refreshes
  • Dashboard & Analytics — see at-a-glance stats (total items, fresh vs expiring, categories) and a price comparison table across Walmart, Kroger, and Whole Foods
  • Dark Mode — full light/dark theme support via next-themes

Tech Stack

Layer Technology
Framework Next.js 16 (App Router)
Language TypeScript 5
UI Library Chakra UI v3
Styling Emotion (CSS-in-JS)
AI / Vision Anthropic SDKclaude-sonnet-4-6
Theming next-themes
Icons react-icons
Package Manager pnpm
Testing Jest + Testing Library
Linting & Formatting ESLint + Prettier

Getting Started

Prerequisites

  • Node.js 18+
  • pnpm
  • An Anthropic API key

Installation

git clone https://github.com/your-username/pantrio.git
cd pantrio
pnpm install

Environment Variables

Create a .env.local file in the project root:

ANTHROPIC_API_KEY=your_anthropic_api_key_here

Optionally override the prompts sent to Claude:

FRIDGE_SYSTEM_PROMPT="<example_prompt>..."
FRIDGE_USER_PROMPT="<example_prompt>..."

Run Locally

pnpm dev

Open http://localhost:3000 in your browser.


Project Structure

pantrio/
├── app/
│   ├── api/
│   │   └── scan-fridge/route.ts   # Next.js API route — calls Claude vision API
│   ├── dashboard/page.tsx          # Analytics dashboard + price comparison
│   ├── fridge/page.tsx             # Fridge scanner + inventory management
│   └── layout.tsx                  # Root layout with Chakra + theme providers
├── components/
│   ├── Navbar.tsx                  # Top navigation
│   └── ui/                         # Shared UI primitives (Provider, Toaster, Tooltip)
└── lib/
    └── fridge.ts                   # Inventory types + localStorage helpers

How It Works

  1. You upload a photo of your fridge (JPEG, PNG, or WEBP)
  2. The image is resized client-side (max 1568px) and base64-encoded
  3. It's sent to /api/scan-fridge, which passes it to Claude claude-sonnet-4-6 with a structured prompt
  4. Claude returns a JSON array of every visible food item with name, quantity, category, and condition
  5. The inventory is saved to localStorage and displayed on screen
  6. Navigate to /dashboard to see stats and estimated price comparisons across major grocery stores

Future Improvements

  • Expiry date tracking — let Claude attempt to read visible best-before dates, with manual override
  • Real grocery pricing — integrate a live price API (e.g. Kroger API) to replace simulated estimates
  • Recipe suggestions — use the current inventory to suggest meals via Claude
  • Multi-fridge support — manage pantry, fridge, and freezer as separate inventories
  • Shopping list generator — automatically flag low or expiring items and build a shopping list
  • User accounts & cloud sync — replace localStorage with a database so inventory persists across devices
  • Mobile camera integration — take a photo directly in the browser on mobile rather than uploading from gallery
  • Nutrition insights — estimate macros and nutritional balance of the current fridge contents
  • Weekly history — track how your fridge changes over time with scan history

License

MIT

About

AI-powered fridge inventory app that scans your fridge with a photo and catalogs everything inside.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published