DEV Community

Cover image for Pantrybridge
780
780

Posted on

Pantrybridge

DEV Weekend Challenge: Generosity Edition Submission 💜

This is a submission for Weekend Challenge: Generosity Edition

I wanted to build something for this challenge that didn't just talk about generosity but actually meant something, and felt beneficial. This tool can make it easier to go from "I have food to donate" to "I'm donating food".

You take a picture of your pantry shelf, Gemini figures out what's actually in it, and the app turns that into a recipe for whoever receives it, a handwritten-style note of kindness, a real way to find a food bank near you, and a printable manifest to hand over at drop-off.

What I Built

Pantrybridge landing page

PantryBridge is a small AI-powered toolkit for food donation. The flow is:

1. Scan your pantry.

Upload a photo (or pick one of three one-click sample hauls if you don't have a pantry photo handy). Gemini does multimodal image analysis and returns a structured inventory: item names, categories, estimated quantities, dietary tags, urgency, and packaging condition.
Scanning flow

(Sorry, GIPHY messed up my gif)

2. Review the inventory.

Everything shows up in a clean table with donation-readiness stats and a volunteer tip generated specifically for that haul. (If you need to, you can delete or add items!)

Scanned pantry

3. Find a real drop-off location.

Enter your zip code and the app confirms your city/state (via a real geocoding lookup) and links you straight to Feeding America's actual food bank locator, so you're finding a real place to donate, not a mock one.
Drop off flow

4. Get a recipe and a kindness note.

Gemini writes a short recipe using mostly what you're donating, plus a genuinely warm, non-patronizing note to include with the box.
Recipe + kindness note

5. Print a donation manifest.

A little printable card with the itemized contents and a mock barcode/QR for quick intake logging, with confetti when you pledge or print.
Donation card

Demo

Try the Live App

If you'd rather run it yourself:

git clone https://github.com/780s/pantrybridge.git
cd pantrybridge
npm install
npm run dev
Enter fullscreen mode Exit fullscreen mode

Drop a GEMINI_API_KEY into .env.local to hit the real Gemini API. Without one, every route quietly falls back to realistic mock data instead of erroring out, so the app is never actually broken, it's just running on canned data until you add a key.

Code

GitHub logo 780s / pantrybridge

A submission to the DEV.to Generosity Weekend Challenge

PantryBridge

AI-powered food donation and mutual-aid toolkit built for the DEV Weekend Challenge: Generosity Edition (Best Use of Google AI).

Snap a photo of your pantry shelf and PantryBridge uses Gemini to detect items, match them against local food bank shortages, generate a family recipe from the donated staples, write a heartfelt kindness note, and produce a printable donation manifest.

Getting Started

npm install
npm run dev
Enter fullscreen mode Exit fullscreen mode

Open http://localhost:3000.

Google AI (Gemini) integration

Add your key to .env.local:

GEMINI_API_KEY=your_gemini_api_key_here
Enter fullscreen mode Exit fullscreen mode

Without a key, both API routes (/api/analyze-pantry, /api/generate-kit) gracefully fall back to realistic mock data, so the app is always fully demoable.

Project structure

  • src/app/api/analyze-pantry — multimodal pantry photo analysis (Gemini 3.6 Flash)
  • src/app/api/generate-kit — recipe + kindness note generation
  • src/components — UI building blocks (uploader, inventory table, matcher, recipe/kindness cards, printable manifest)
  • src/lib — Gemini client, mock data/fallbacks, food-bank matching logic





How I Built It

It's a Next.js 16 (App Router) app with Tailwind v4 and shadcn/ui, talking to Gemini through @google/generative-ai.

A few decisions I'm actually proud of, past the obvious "call Gemini with a prompt" version:

The vision prompt is opinionated, not just "list the items."

Early on, Gemini would miss stacked items, double-count identical products, or slap dietary tags on things it couldn't actually justify. I rewrote the prompt as an explicit rulebook: scan the whole frame including backgrounds, group identical products into one entry with an accurate count instead of five duplicate rows, only tag something "Gluten-Free" if the packaging says so or it's an unambiguous fact about that exact product, and never invent an item that isn't visible. I also switched to Gemini's structured responseSchema instead of just asking nicely for JSON, so the output is actually guaranteed to match the app's types instead of occasionally almost matching them.

The food bank feature used to be fake, and I fixed that.

My first pass had three made-up local food banks with made-up addresses and a distance calculator that computed real mileage to those fictional places. It looked great in a demo and was completely wrong. I ripped it out and replaced it with something smaller but honest: a real zip-code geocode (via a free public API) to confirm your city, and a direct link to Feeding America's actual food bank locator. Less flashy, but it doesn't quietly lie to anyone who actually tries to use it.

Nothing is allowed to hard-fail during a demo.

Both Gemini routes fall back to curated mock data if the API key is missing or a call errors out, so judges (or anyone without a key) never hit a broken screen. The three sample pantry photos resolve to hand-written mock analyses instantly rather than round-tripping through the model, which makes the one-click demo path fast and consistent.

The UI went through a real design pass, not just "add Tailwind classes."

I migrated the hand-rolled components over to shadcn/ui, then deliberately stripped out the stuff that makes modern websites look the same: sparkle icons, gradient-filled icon boxes, numbered circle badges, bouncy hover animations on things that aren't even clickable. What's left is flatter, quieter, and has an actual typographic hierarchy (Space Grotesk for headings, Inter for body, a handwritten font just for the kindness note).

Deployment took a couple of tries.

This has three server-side API routes calling Gemini and a geocoding API, so it needed somewhere that actually runs a Node server, not a static host. It landed on Railway: connect the repo, add the env var, done.

Prize Categories

I am submitting to the Best Use of Google AI subcategory.

Gemini does two distinct jobs here: multimodal vision (reading a photo and returning structured, schema-validated inventory data) and creative generation (the recipe and the kindness note), both through the same API key with no other AI provider involved.

If you enjoy this project, make sure to comment with your thoughts!

(...and no, this post was not written by AI)

Top comments (0)