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

 
 
 

Contributors