Skip to content

srilap19/Order-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ Order Analysis App

Analyze your monthly spend and order trends across Swiggy, Zepto, and Blinkit.


πŸš€ Features

  • 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)

πŸ› οΈ Tech Stack

  • Backend: Python, FastAPI, Pandas, SQLAlchemy
  • Database: PostgreSQL (or SQLite for quick start)
  • Frontend: React Native
  • Integration: Gmail API
  • Visualization: React Native Chart Kit / Victory

πŸ“‚ Project Structure

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


βš™οΈ Setup Instructions

1. Clone Repo

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published