Analyze your monthly spend and order trends across Swiggy, Zepto, and Blinkit.
- Connects to Gmail API to parse order confirmation emails
- Extracts structured data (app, item, amount, date)
- Stores orders in a database (Postgres/SQLite)
- Provides analytics via REST API (FastAPI)
- Frontend dashboard (React Native) with charts and insights
- Monthly PDF report (optional)
- Backend: Python, FastAPI, Pandas, SQLAlchemy
- Database: PostgreSQL (or SQLite for quick start)
- Frontend: React Native
- Integration: Gmail API
- Visualization: React Native Chart Kit / Victory
order-analysis-app/ β βββ backend/ β βββ app.py # FastAPI backend β βββ email_parser.py # Gmail API + regex parsing β βββ db.py # Database connection β βββ models.py # Order schema β βββ analysis.py # Analytics functions β βββ frontend/ β βββ App.js # React Native entry β βββ components/ # UI components β βββ services/ # API calls β βββ data/ β βββ sample_orders.csv # Test dataset β βββ requirements.txt # Python dependencies βββ README.md # Documentation
git clone https://github.com/yourusername/order-analysis-app.git
cd order-analysis-app
### 2. Backend Setup
cd backend
python -m venv venv
source venv/bin/activate # (Linux/Mac)
venv\Scripts\activate # (Windows)
pip install -r requirements.txt
### 3. Gmail API Setup
- Go to Google Cloud Console
- Enable Gmail API
- Download credentials.json and place in backend/
- Run:
python email_parser.py
### 4. Database Setup
# Using SQLite for quick start
python db.py
### 5. Run Backend
uvicorn app:app --reload
Backend runs at http://localhost:8000.
### 6. Frontend Setup
cd frontend
npm install
npm start
π Example Output
API Response (/analysis)
{
"total_spend": {"Swiggy": 2500, "Zepto": 1800, "Blinkit": 1200},
"top_items": {"Pizza": 5, "Milk": 8, "Bread": 6},
"avg_spend": 320.5
}
Pie Chart (Spend per App)
Swiggy ββββββββββ 2500
Zepto ββββββ 1800
Blinkit ββββ 1200
Bar Chart (Weekly Orders)
Week 1 | ββββ 4 orders
Week 2 | ββββββ 6 orders
Week 3 | βββ 3 orders
Week 4 | βββββββ 7 orders
Top Items List
1. Milk (8 orders)
2. Bread (6 orders)
3. Pizza (5 orders)
Summary Card
Average Spend per Order: βΉ320.5
Total Spend (30 days): βΉ5500
(Replace with actual screenshots once frontend is ready)
π§© Roadmap
- [x] Email parsing
- [x] Database integration
- [x] Analytics API
- [ ] React Native dashboard
- [ ] PDF monthly report
- [ ] Power BI integration
π¨βπ» Author
Built by Sri β Application Developer / Data Engineer.
Focus: ETL pipelines, BI dashboards, and handsβon data engineering projects.