Skip to content

About

RetailIQ is an intelligent retail analytics platform that applies data warehousing, data mining, and machine learning to transform raw transaction data into actionable insights. It provides customer segmentation, market basket analysis, sales forecasting, anomaly detection, and personalized product recommendations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

RetailIQ Logo

RetailIQ Analytics

An intelligent retail analytics platform powered by data warehousing, data mining, and machine learning

React FastAPI Python Vite TailwindCSS


🚀 Features

Feature Description
📊 Dashboard Real-time KPIs — revenue, customers, transactions, avg order value
🛒 Market Basket Analysis Apriori algorithm for product association rules, bundles & cross-sell simulator
📈 Sales Forecasting Holt's exponential smoothing on real transaction history
👥 Customer Segmentation KMeans RFM clustering — Premium, Regular, Budget, At-Risk
🚨 Anomaly Detection Isolation Forest to flag suspicious transactions
🎯 Recommendations Personalized product recommendations per customer segment
📥 Data Import CSV upload supporting standard (JSON items) and flat (one row per product) formats

🗂️ Project Structure

RetailQ/
├── backend/                  # Python FastAPI ML backend
│   ├── main.py               # API endpoints
│   ├── clustering.py         # KMeans & RFM logic
│   ├── market_basket.py      # Apriori algorithm
│   ├── data_cleaning.py      # Dataset cleaning utilities
│   ├── warehouse.py          # SQLAlchemy data warehouse schema
│   └── requirements.txt      # Python dependencies
├── public/                   # Static assets
│   ├── favicon.ico
│   ├── logo192.png
│   └── logo512.png
├── src/
│   ├── Components/           # Reusable UI components
│   │   ├── dashboard/
│   │   └── marketbasket/
│   ├── Pages/                # Route-level page components
│   │   ├── Dashboard.jsx
│   │   ├── DataImport.jsx
│   │   ├── Customers.jsx
│   │   ├── SalesForecast.jsx
│   │   ├── MarketBasket.jsx
│   │   ├── Recommendations.jsx
│   │   └── Anomalies.jsx
│   ├── integrations/
│   │   ├── dataStore.js      # Session-storage data layer
│   │   └── Core.js           # API integration helpers
│   ├── Entities/
│   │   └── all.js            # Entity exports
│   ├── utils/
│   ├── Layout.jsx            # App shell with sidebar navigation
│   ├── App.jsx               # Router setup
│   └── main.jsx              # Entry point
├── index.html
├── vite.config.js
├── tailwind.config.js
└── package.json

⚙️ Setup & Installation

Prerequisites

  • Node.js 18+
  • Python 3.10+
  • npm or yarn

1. Clone the Repository

git clone https://github.com/Aashna890/RetailIQ-Analytics.git
cd RetailIQ-Analytics

2. Frontend Setup

npm install
npm run dev
# App runs at http://localhost:3000

3. Backend Setup

cd backend
python -m venv .venv

# Windows
.venv\Scripts\activate

# Mac/Linux
source .venv/bin/activate

pip install -r requirements.txt
python main.py
# API runs at http://localhost:8000

Note: The frontend works fully without the backend using client-side Apriori and Holt's smoothing. The Python backend enhances results with sklearn ML models.


📊 Data Import Formats

Standard Format (items as JSON column)

transaction_id,customer_name,email,transaction_date,total_amount,items
TXN001,John Doe,john@email.com,2024-01-15,299.99,"[{""product_name"":""Laptop"",""quantity"":1,""unit_price"":299.99}]"

Flat Format (one row per product — auto-detected)

transaction_id,customer_name,transaction_date,total_amount,product_name,quantity,unit_price
TXN001,John Doe,2024-01-15,299.99,Laptop,1,299.99
TXN001,John Doe,2024-01-15,299.99,Mouse,1,29.99

🔌 API Endpoints

Method Endpoint Description
POST /api/clean-data Upload & clean CSV/Excel dataset
POST /api/market-basket Run Apriori association rules
POST /api/customer-segmentation KMeans RFM clustering
POST /api/anomaly-detection Isolation Forest anomaly detection
POST /api/sales-forecast Linear regression sales forecast
POST /api/product-recommendations Segment-based recommendations
GET /health Backend health check

🛠️ Tech Stack

Frontend

  • React 18 + Vite 5 — fast dev server & HMR
  • Tailwind CSS — utility-first styling
  • shadcn/ui — accessible component library
  • Recharts — data visualization
  • React Router v6 — client-side routing
  • Lucide React — icon library

Backend

  • FastAPI — async Python API framework
  • scikit-learn — KMeans, Isolation Forest, Linear Regression
  • mlxtend — Apriori & association rules
  • pandas / numpy — data processing
  • SQLAlchemy — data warehouse ORM

👩‍💻 Author

Aashna890 — github.com/Aashna890


About

RetailIQ is an intelligent retail analytics platform that applies data warehousing, data mining, and machine learning to transform raw transaction data into actionable insights. It provides customer segmentation, market basket analysis, sales forecasting, anomaly detection, and personalized product recommendations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages