SmartPantry is a receipt-based pantry tracker that scans grocery receipts, extracts store and item details, estimates expiry dates, and sends reminders for items that are about to expire.
- User registration and login
- Receipt upload and OCR text extraction
- AI-powered receipt parsing using Gemini
- Grocery item categorization and expiry estimation
- Receipt history with full receipt detail view
- Delete saved receipts from history
- Automated expiry reminder checks with scheduler
- Email and SMS notification support
- Product lookup from OpenFoodFacts
Frontend
- HTML
- CSS
- JavaScript
Backend
- Flask
- Flask-CORS
- APScheduler
- EasyOCR
- OpenCV
- Google Gemini API
- MongoDB / PyMongo
- Twilio
- SMTP email support
recipt/
├── backend/
│ ├── app.py
│ ├── requirements.txt
│ ├── services/
│ │ ├── db.py
│ │ ├── expiry.py
│ │ ├── gemini_parser.py
│ │ ├── image_preprocess.py
│ │ ├── notification.py
│ │ ├── ocr.py
│ │ ├── product_lookup.py
│ │ ├── reminder.py
│ │ └── shelf_life.py
│ └── uploads/
└── frontend/
├── index.html
├── login.html
├── register.html
├── dashboard.html
├── receipt.html
├── style.css
└── script.js- The user creates an account or logs in.
- A grocery receipt is uploaded from the dashboard.
- EasyOCR reads the receipt image.
- Gemini converts OCR text into structured receipt data.
- The app estimates item expiry dates based on purchase date and product type.
- Receipt data is stored in MongoDB.
- The dashboard shows receipt history and individual receipt details.
- A background scheduler checks for expiring items and sends reminders.
POST /register— create a new userPOST /login— login userGET /me?email=...— get user profilePOST /upload-receipt— upload and process a receiptGET /history?email=...— get receipt historyGET /receipt/<receipt_id>?email=...— get one receiptDELETE /receipt/<receipt_id>?email=...— delete a receipt
Create a .env file inside backend/ with:
MONGO_URI=your_mongodb_connection_string
DB_NAME=smartpantry
GEMINI_API_KEY=your_gemini_api_key
SMTP_HOST=your_smtp_host
SMTP_PORT=587
SMTP_EMAIL=your_email
SMTP_PASSWORD=your_email_password
FAST2SMS_API_KEY=your_fast2sms_keygit clone https://github.com/your-username/smartpantry.git
cd smartpantrycd backend
pip install -r requirements.txtCreate the .env file in the backend folder and add the values listed above.
python app.pyOpen frontend/index.html in your browser, or serve the frontend with a local server.