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.
- 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
- Python 3.8+
- pip (Python package manager)
-
Clone the repository:
git clone <repository-url> cd OrderLytics
-
Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: .\venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
Run the data generation script to create a CSV file with synthetic e-commerce data:
python generate_data.pyThis will create a file named ecommerce_orders.csv in the project directory with 100,000+ rows of synthetic data.
Start the Streamlit dashboard with:
streamlit run dashboard.pyThe dashboard will open automatically in your default web browser. If it doesn't, navigate to http://localhost:8501.
- 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
- Daily revenue and profit trends
- Profit by category
- Monthly financial summary with revenue, cost, and profit margins
- Top-selling products
- Category performance
- Product trends over time
- Identify potential fraudulent orders based on:
- Unusually large orders
- Multiple orders with similar details
- Suspicious payment patterns
- High-value orders with high discounts
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
Run the test suite with:
pytest tests/A Dockerfile is provided for containerized deployment:
-
Build the Docker image:
docker build -t ecommerce-dashboard . -
Run the container:
docker run -p 8501:8501 ecommerce-dashboard
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.