Skip to content

MaurishKaushik11/OrderLytics

Repository files navigation

E-commerce Analytics Dashboard

This project generates synthetic e-commerce transaction data and provides an interactive dashboard for analysis. The solution includes data generation, data processing, and visualization components.

Features

  • Generate synthetic e-commerce transaction data (100,000+ rows)
  • Interactive Streamlit dashboard with multiple views
  • Daily profit/loss analysis
  • Product and category performance metrics
  • Fraud detection analysis
  • Data filtering and export capabilities

Prerequisites

  • Python 3.8+
  • pip (Python package manager)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd OrderLytics
  2. Create and activate a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: .\venv\Scripts\activate
  3. Install the required packages:

    pip install -r requirements.txt

Usage

1. Generate Synthetic Data

Run the data generation script to create a CSV file with synthetic e-commerce data:

python generate_data.py

This will create a file named ecommerce_orders.csv in the project directory with 100,000+ rows of synthetic data.

2. Run the Dashboard

Start the Streamlit dashboard with:

streamlit run dashboard.py

The dashboard will open automatically in your default web browser. If it doesn't, navigate to http://localhost:8501.

Dashboard Features

Data Exploration

  • Upload and explore any CSV file with e-commerce data
  • Filter data by date range, categories, and order status
  • View raw data with sorting and search capabilities

Profit & Loss Analysis

  • Daily revenue and profit trends
  • Profit by category
  • Monthly financial summary with revenue, cost, and profit margins

Product Analytics

  • Top-selling products
  • Category performance
  • Product trends over time

Fraud Detection

  • Identify potential fraudulent orders based on:
    • Unusually large orders
    • Multiple orders with similar details
    • Suspicious payment patterns
    • High-value orders with high discounts

Project Structure

OrderLytics/
├── data/
│   └── ecommerce_orders.csv    # Generated synthetic data
├── src/
│   ├── __init__.py
│   ├── data_generator.py       # Data generation logic
│   └── utils.py               # Utility functions
├── tests/
│   ├── __init__.py
│   └── test_data_generator.py  # Unit tests
├── .gitignore
├── .dockerignore
├── dashboard.py               # Streamlit dashboard
├── generate_data.py           # Data generation script
├── requirements.txt           # Python dependencies
└── README.md                  # This file

Testing

Run the test suite with:

pytest tests/

Docker Support (Optional)

A Dockerfile is provided for containerized deployment:

  1. Build the Docker image:

    docker build -t ecommerce-dashboard .
  2. Run the container:

    docker run -p 8501:8501 ecommerce-dashboard

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors