{"slug": "pantrybridge", "title": "Pantrybridge", "summary": "A developer built PantryBridge, an AI-powered food donation toolkit that uses Google's Gemini to analyze photos of pantry shelves, identify items, and generate recipes, kindness notes, and printable donation manifests. The app, created for the DEV Weekend Challenge: Generosity Edition, also connects users to real food banks via Feeding America's locator and gracefully falls back to mock data without an API key.", "body_md": "*This is a submission for [Weekend Challenge: Generosity Edition](https://dev.to/challenges/weekend-2026-09-03)*\n\nI 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\".\n\nYou 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.\n\nPantryBridge is a small AI-powered toolkit for food donation. The flow is:\n\nUpload 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.\n\n(*Sorry, GIPHY messed up my gif*)\n\nEverything 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!)\n\nEnter 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.\n\nGemini writes a short recipe using mostly what you're donating, plus a genuinely warm, non-patronizing note to include with the box.\n\nA little printable card with the itemized contents and a mock barcode/QR for quick intake logging, with confetti when you pledge or print.\n\nIf you'd rather run it yourself:\n\n```\ngit clone https://github.com/780s/pantrybridge.git\ncd pantrybridge\nnpm install\nnpm run dev\n```\n\nDrop 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.\n\nAI-powered food donation and mutual-aid toolkit built for the **DEV Weekend Challenge: Generosity Edition** (Best Use of Google AI).\n\nSnap 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.\n\n```\nnpm install\nnpm run dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000).\n\nAdd your key to `.env.local`:\n\n```\nGEMINI_API_KEY=your_gemini_api_key_here\n```\n\nWithout 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.\n\n`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\nIt's a Next.js 16 (App Router) app with Tailwind v4 and shadcn/ui, talking to Gemini through `@google/generative-ai`.\n\nA few decisions I'm actually proud of, past the obvious \"call Gemini with a prompt\" version:\n\n**The vision prompt is opinionated, not just \"list the items.\"** \n\nEarly 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.\n\n**The food bank feature used to be fake, and I fixed that.** \n\nMy 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.\n\n**Nothing is allowed to hard-fail during a demo.** \n\nBoth 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.\n\n**The UI went through a real design pass, not just \"add Tailwind classes.\"** \n\nI 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).\n\n**Deployment took a couple of tries.** \n\nThis 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.\n\nI am submitting to the **Best Use of Google AI** subcategory.\n\nGemini 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.\n\n(*...and no, this post was not written by AI*)", "url": "https://wpnews.pro/news/pantrybridge", "canonical_source": "https://dev.to/780s/pantrybridge-3igp", "published_at": "2026-09-07 00:38:44+00:00", "updated_at": "2026-09-07 01:01:32.613637+00:00", "lang": "en", "topics": ["artificial-intelligence", "computer-vision", "generative-ai", "ai-products", "developer-tools"], "entities": ["PantryBridge", "Gemini", "Google", "Feeding America", "DEV"], "alternates": {"html": "https://wpnews.pro/news/pantrybridge", "markdown": "https://wpnews.pro/news/pantrybridge.md", "text": "https://wpnews.pro/news/pantrybridge.txt", "jsonld": "https://wpnews.pro/news/pantrybridge.jsonld"}}