Skip to content

famyali786-hash/Retail-Return-Behavior-Study

 
 

Repository files navigation

Python Jupyter React Flask Pandas NumPy SciPy Matplotlib Seaborn Power%20BI Git GitHub

Retail Return Behaviour Analysis Dashboard

Data Analytics + Full-Stack Dashboard Project

A full-stack retail analytics dashboard that identifies return patterns and helps businesses reduce revenue loss through data-driven insights and interactive visualizations. The project integrates a Flask backend, React frontend, and Power BI visualizations to deliver an interactive and user-friendly analytics experience.

This project was developed as part of an On-the-Job Training (OJT) program to understand real-world data analysis, dashboard building, and full-stack integration.

Features

  1. KPI Dashboard

Displays key business metrics:

Total Orders

Total Returns

Return Rate (%)

Revenue Impact

These KPIs update dynamically based on filters.

  1. Interactive Filters

Users can filter data based on:

Country

Year

Month

This enables focused analysis and better decision-making.

  1. Power BI Integration

Embedded Power BI dashboard for advanced visual insights:

Sales vs Returns Trends

Category-wise Return Analysis

Region-wise Performance

Provides rich, interactive visualizations inside the app.

  1. Dynamic Charts (Frontend)

Custom charts built using React:

Monthly Return Trends

Category Distribution

Return Percentage Analysis

  1. Flask Backend API

Handles all data processing and API endpoints:

/meta → Filter values (Country, Year, Month)

/dashboard-data → KPI + chart data

Ensures smooth communication between frontend and dataset.

  1. Clean UI with Loading States

Responsive design

Loading spinner for better UX

Modular components (KPI cards, charts, modal)

Machine Learning Model

  • Algorithm Used: Random Forest
  • Objective: Predict likelihood of product return
  • Features: Order value, category, country, etc.
  • Accuracy: 84%

Screenshots

Dashboard Overview

Dashboard Dashboard Dashboard

Power BI Modal

Power BI

KPI Cards

Dashboard

Project Structure


RETAIL-RETURN-BEHAVIOR-ANALYSIS/
│
├── backend/
│   ├── app.py              # Flask backend
│   ├── model.pkl
|   ├── requirements.txt
|   ├── train_model.py
│
├── frontend/
│   ├── src/
│   │   ├── components/
│   │   │   └── KpiCards.jsx
│   │   │   └── LoadingSpinner.jsx
|   |   |   └── PowerBIModal.css
│   │   │   └── PowerBIModal.jsx
│   │   │
│   │   ├── pages/
│   │   │   └── Dashboard.jsx
|   |   |   └── Dashboard.css
│   │   ├── services/
│   │   │   └── api.js
│   │   ├── App.css
│   │   ├── App.jsx
│   │   ├── index.css
│   │   ├── main.jsx
│   │   ├── index.html
│   └── package.json
│
├── README.md
└── requirements.txt

System Architecture

Dataset → Data Processing → Model → Flask API → React Dashboard → Power BI

Tech Stack

Backend

Python

Flask

Pandas

Frontend

React.js

CSS

Data Visualization

Power BI

How to Run the Project

  1. Clone the Repository
git clone https://github.com/Vaishnavi10706/Retail-Return-Behavior-Study.git
cd retail-return-behavior-analysis
  1. Setup Backend
cd backend
pip install -r requirements.txt
python app.py
  1. Setup Frontend
cd frontend
npm install
npm run dev

How to Use

Step 1: Open Dashboard Run frontend and open in browser

Step 2: Apply Filters

Select:

Country

Year

Month

Step 3: Analyze KPIs

View updated:

Total Orders

Returns

Return Rate

Step 4: Explore Visuals

View charts

Open Power BI modal for deeper insights

Example Insights

High return rate in specific categories

Seasonal trends in returns

Country-wise return differences

Revenue loss due to returns

Purpose of the Project

This project helps in understanding:

  1. Real-world retail analytics
  2. Return behavior patterns
  3. Full-stack dashboard development
  4. API integration between React & Flask
  5. Embedding Power BI in applications
  6. Data-driven decision making

Business Impact

  • Helps reduce product return losses
  • Identifies high-risk categories and regions
  • Supports better inventory and logistics decisions
  • Enables data-driven retail strategies

Future Improvements

  • User authentication
  • Export reports (PDF/CSV)
  • Advanced filters
  • Real-time data updates
  • Machine learning for return prediction

Support

If you found this project useful, consider starring ⭐ the repository!

Author

Vaishnavi
B.Tech Student – Data Analytics

GitHub: https://github.com/Vaishnavi10706

About

End-to-end retail return behavior analysis using Python, Flask, React, and Power BI with interactive dashboards and actionable business insights.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages

  • Jupyter Notebook 96.1%
  • JavaScript 2.1%
  • CSS 1.3%
  • Other 0.5%