An AI-powered grocery ordering assistant that helps users describe their needs in natural language and receive optimized grocery orders from quick-commerce providers (Swiggy Instamart, Blinkit, Zepto) based on budget, health goals, and nutritional requirements.
- Python 3.8+
- Node.js 16+
- npm or yarn
- Navigate to backend directory:
cd backend- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Add GEMINI_API_KEY (required for AI product search):
# Create .env in backend/ or set environment variable
export GEMINI_API_KEY=your_gemini_api_key_here
# Or add to a .env file (never commit .env - it's in .gitignore)- Run the server:
uvicorn app.main:app --reload --port 8000Backend will be available at http://localhost:8000
API docs at http://localhost:8000/docs
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Start development server:
npm run devFrontend will be available at http://localhost:3000
hackthon/
βββ backend/ # FastAPI backend
β βββ app/
β β βββ main.py # FastAPI app
β β βββ routes/ # API endpoints
β β βββ services/ # Business logic
β β βββ models/ # Pydantic models
β β βββ utils/ # Utility functions
β βββ requirements.txt
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # React components
β β βββ services/ # API services
β β βββ App.jsx # Main app
β βββ package.json
βββ README.md
- Natural Language Input: Describe your grocery needs in plain English
- AI Constraint Extraction: Automatically extracts budget, health goals, and dietary preferences
- Smart Product Recommendations: Filters products based on constraints and pincode availability
- Real-time Budget Tracking: Visual budget tracker with warnings
- Nutrition Summary: Track protein, calories, carbs, and fats
- Cart Management: Add, remove, and adjust quantities
- Order Summary: Review order with provider breakdown
- Payment Integration: Generate payment links (mock for demo)
- Landing Page: Enter pincode
- Input Screen: Describe needs in natural language
- Constraint Visualization: Review and adjust extracted constraints
- Product Recommendations: Browse and add products to cart
- Order Summary: Review order details
- Checkout: Proceed to payment
- Confirmation: Order confirmed
- FastAPI - Modern Python web framework
- Pydantic - Data validation
- OpenAI (optional) - AI constraint extraction
- React 18 - UI library
- React Router - Navigation
- Axios - HTTP client
- Vite - Build tool
POST /api/v1/pincode/validate- Validate pincodePOST /api/v1/ai/extract-constraints- Extract constraints from natural languagePOST /api/v1/products/recommend- Get product recommendationsPOST /api/v1/cart/validate- Validate cartPOST /api/v1/order/summary- Generate order summaryPOST /api/v1/payment/generate-link- Generate payment link
See EasyPizzy_API_Specification.md for detailed API documentation.
EasyPizzy_Design_Document.md- Complete UI/UX and system designEasyPizzy_API_Specification.md- Detailed API schemasEasyPizzy_Implementation_Roadmap.md- Development checklist
cd backend
uvicorn app.main:app --reload
# Visit http://localhost:8000/docs for interactive API docscd frontend
npm run dev
# Visit http://localhost:3000Product data and the search index are not committed (they're large and in .gitignore). You need to set them up before AI product search works:
-
Add product CSV files to
ai-agent/data/:- Place CSV files with product data (e.g.
atta.csv,meats.csv,protein.csv,fruit & veg.csv) - Format: multi-provider columns (
zepto_*,blinkit.*,swiggy-instamart.*, etc.) or standard format withSource,Product Name,Category, etc.
- Place CSV files with product data (e.g.
-
Build the search index (required before first use):
cd ai-agent
python -m venv .venv # if not already done
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install google-generativeai
python -m product_agent build --data-dir data- This creates
ai-agent/.index/products.dbfrom the CSV files. - Run again whenever you add or update product data.
Scaling: The system can be extended by adding more CSV data, integrating live provider APIs, or scraping product catalogs. More data = more pincodes and better coverage.
Currently supported pincodes (Delhi, Mumbai, Bangalore, Kolkata):
| Pincode | City | State |
|---|---|---|
| 110001 | Delhi | Delhi |
| 110002 | Delhi | Delhi |
| 400001 | Mumbai | Maharashtra |
| 560001 | Bangalore | Karnataka |
| 700001 | Kolkata | West Bengal |
These can be scaled by updating backend/app/utils/pincode_validator.py and adding more product data for new regions.
- GEMINI_API_KEY (required): For AI-powered product search, intent parsing, and ranking. Get one at Google AI Studio.
OPENAI_API_KEYin.envfor AI constraint extraction (optional; default uses rule-based extraction)
- API base URL is set in
src/services/api.js - Default:
http://localhost:8000/api/v1
Implemented:
- β Pincode validation
- β Natural language input
- β Constraint extraction (rule-based)
- β Product recommendations
- β Cart management
- β Order summary
- β Payment link generation (mock)
Future Enhancements:
- Real-time inventory sync
- Multiple provider order splitting
- User accounts and order history
- Recipe-based ordering
- Voice input support
This project is created for hackathon purposes.
Built for hackathon - EasyPizzy Team
Happy Coding! π