An intelligent retail analytics platform powered by data warehousing, data mining, and machine learning
| 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 |
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
- Node.js 18+
- Python 3.10+
- npm or yarn
git clone https://github.com/Aashna890/RetailIQ-Analytics.git
cd RetailIQ-Analyticsnpm install
npm run dev
# App runs at http://localhost:3000cd 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:8000Note: The frontend works fully without the backend using client-side Apriori and Holt's smoothing. The Python backend enhances results with sklearn ML models.
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}]"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| 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 |
- 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
- FastAPI — async Python API framework
- scikit-learn — KMeans, Isolation Forest, Linear Regression
- mlxtend — Apriori & association rules
- pandas / numpy — data processing
- SQLAlchemy — data warehouse ORM
Aashna890 — github.com/Aashna890