PantryPal
DEvelopment reasons
4 college students tired of food going bad that we didn't know we had. PantryPal revolutionizes how we store and understand food storage, making us more efficient, eliminate waste, and find new recipes.
About
Built from ground up in 24 hours for HackCU11.
Created by Brandon Reeves, Benjamin Getches, Harrison Getches, and Rayaan Lodhi.
Quick Start
Visit pantrypal.up.railway.app to access the live application without any installation:
- Create a new account or log in with the demo credentials
- Explore your virtual pantry
- Try scanning products or adding them manually
- Generate recipe suggestions based on your pantry items
For local development, follow the installation instructions below.
Overview
AI Pantry Assistant is a smart kitchen management system that helps you track your pantry inventory, monitor expiration dates, and generate recipe suggestions based on what you have on hand. The application uses barcode scanning, AI-powered recipe generation, and expiration date tracking to reduce food waste and simplify meal planning.
Features
🔍 Product Scanning & Management
- Scan product barcodes (UPC) to automatically add items to your pantry
- Lookup product information from online databases
- Manually add products with custom details
- Track quantity and expiration dates
📅 Expiration Date Tracking
- Visual calendar interface showing when items will expire
- Color-coded expiration warnings (expired, expiring soon, expiring this week)
- Reduce food waste by staying aware of expiration dates
🍳 AI Recipe Generation
- Get recipe suggestions based on your current pantry inventory
- Prioritizes recipes using ingredients that will expire soon
- "Cook" recipes to automatically update your pantry inventory
👤 User Authentication
- Secure signup and login system
- JWT-based authentication
- Personal pantry management
Technology Stack
Frontend
- React 19
- Redux for state management
- React Router for navigation
- Material UI components
- FullCalendar for expiration date visualization
- Framer Motion for animations
Backend
- Flask (Python)
- PostgreSQL database
- OpenAI API for recipe generation
- Go-UPC API for product lookups
- JWT for authentication
- bcrypt for password hashing
Installation
Prerequisites
- Node.js (v18+)
- Python (v3.9+)
- PostgreSQL
Backend Setup
Navigate to the backend directory:
cd backendCreate and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtCreate a
.envfile with the following variables:OPENAI_API_KEY=your_openai_api_key GOUPC_API_KEY=your_goupc_api_key JWT_SECRET=your_jwt_secret DB_HOST=localhost DB_NAME=pantry_db DB_USER=postgres DB_PASSWORD=your_db_passwordSet up the database:
psql -U postgres -f create.sqlStart the backend server:
python app.py
Frontend Setup
Navigate to the frontend directory:
cd frontendInstall dependencies:
npm installStart the development server:
npm start
Usage
- Create an account or log in
- Add products to your pantry by scanning barcodes or manual entry
- View your pantry inventory and expiration dates on the calendar
- Generate recipe suggestions based on your pantry items
- "Cook" recipes to automatically update your inventory
API Endpoints
Authentication
POST /api/signup- Create a new user accountPOST /api/login- Log in to an existing account
Product Management
GET /api/lookup-upc- Look up product information by UPCPOST /api/products- Add a new product to the databaseGET /api/products/<product_upc>- Get product details by UPC
Pantry Management
POST /api/pantry- Add a product to user's pantryGET /api/pantry- Get user's pantry inventoryPUT /api/pantry/<pantry_id>- Update a pantry itemDELETE /api/pantry/<pantry_id>- Remove an item from pantry
Recipe Generation
POST /api/get-recipes- Generate recipe suggestionsPOST /api/cook-recipe- Update pantry after cooking a recipe
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- OpenAI for recipe generation capabilities
- Go-UPC for product database access
- All contributors who have helped build this project
Built With
- crud
- goupc
- openai
- postgresql
- python
- react
- redux
Log in or sign up for Devpost to join the conversation.