Inspiration
I often open my fridge to see half eaten pieces of food, wondering why this is such a habit, leaving things uneaten, quite tempting to dispose of.
What it does
- Budget Tracking
You enter your monthly food budget once and PantryPilot continuously compares what you’ve spent to the estimated value of everything on your shelves. - Barcode-Powered Inventory
Point your phone’s camera at any UPC barcode, and we automatically pull in product names, nutrition facts, and estimate expiry dates via the free Open Food Facts API. - Waste-Reduction Tips
Get contextual advice (“turn broccoli stems into pesto,” “regrow green onions from scraps”) to squeeze every last drop of value from your ingredients - Local Price Optimization
(Stubbed for future work) We’ll recommend cheaper substitutes from nearby stores or flyer deals so you never overpay for that last missing item. - “What Can I Eat?” Recommender
Instant list of full meals you can make right now
How we built it
- FastAPI Backend
- Loaded secrets from
.env(OpenAI key, OFF base URL). /inventoryendpoint fetches product data, nests nutrition undernutriments, and auto-estimates a six-month expiry.- AI endpoints (
/mealplan,/whatcanieat,/tips) craft precise prompts and call GPT-4o-Mini via the new OpenAI v1 client. - In‐memory data stores for rapid prototyping (swap in a real DB later).
- Loaded secrets from
- React + JSX Frontend
- A reusable
<CodeScanner>component uses arefto mount Quagga.js for live barcode detection. - Axios-driven services point to
REACT_APP_API_URL, keeping fetch logic isolated. - Four modular components: Inventory, BudgetTracker, MealPlan, and Tips for clear separation of concerns.
- A reusable
- Wireframes & Iteration
- Rapid prototyping in Figma, then pixel-perfect builds in VS Code.
- End-to-end testing with family-style pantries to tune prompts and UI flows.
- Rapid prototyping in Figma, then pixel-perfect builds in VS Code.
Challenges we ran into
- Quagga Initialization Errors
Crashed onsetAttributeuntil we switched to aref-based mount and gated init until the DOM node existed. - Hook Pitfalls
Anasynccallback inuseEffectdumped warnings—moving async logic inside the effect callback cured it. - Flaky API Data
Open Food Facts occasionally omits fields, so we built graceful fallbacks (“Unknown product,” six-month expiry) to avoid UX jank. - Prompt Tuning
Balancing nutrition, cost, and waste in our meal-planning requests took dozens of micro-edits and real-world testing.
Accomplishments that we’re proud of
- Live barcode scanning in the browser with reliable back-camera support.
- Generating multi-day, budget-aware meal plans from a simple pantry list.
- Seamless budget vs. inventory value tracking in real time.
- Building a full-stack prototype in under 48 hours—front to back.
- Pivoting mid-hackathon from a paid UPC service to the free Open Food Facts API without losing functionality.
What we learned
- The art of prompt engineering: precision matters when you ask an AI for balanced, cost-sensitive menus.
- Quagga.js quirks around live streams and camera permissions in React.
- How to glue FastAPI, OpenAI v1 client, and React into a cohesive, maintainable codebase.
- The importance of graceful degradation and sensible defaults when external APIs fail.
- Modular component architecture makes rapid iteration feasible under tight deadlines.
What’s next for PantryPilot
- Real-time Price Feeds: Integrate Instacart/Walmart APIs (or flyer OCR) for live substitute recommendations.
- Smart Notifications: Push alerts via email/SMS when high-value items are nearing expiry.
- Personalized Profiles: Let the AI learn your dietary preferences, allergies, and taste history.
- Pilot Program: Roll out to 10 local households for real-world feedback and impact measurement.
- UX Polishing: Add dark mode, accessibility enhancements, and multi-language support.
Log in or sign up for Devpost to join the conversation.