# ashrith-555/ecommerce-sales-analytics architecture

> Architecture diagram of the GitHub repository ashrith-555/ecommerce-sales-analytics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ashrith-555/ecommerce-sales-analytics
- Repository: https://github.com/ashrith-555/ecommerce-sales-analytics

## Overview

This is a Flask e-commerce sales analytics dashboard. A user opens the web interface, selects a fixed or uploaded dataset, and views filtered KPIs, breakdowns, charts, and forecasts; report routes also generate exports. The fixed-data path is visible through Flask, Spark analysis, and forecasting; the README documents filtering and analytics capabilities, while the uploaded-data analyzer is a core but unsampled module. Edges are limited to calls and UI routing shown in excerpts or documented in the README; the dynamic analyzer’s internals are not inferred.

Main entry points: [`app.py`](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/app.py) (Flask routes), [`spark_jobs/sales_analysis.py`](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/sales_analysis.py) (Filtered sales analysis), [`spark_jobs/prediction.py`](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/prediction.py) (Forecast preparation), [`spark_jobs/report_generator.py`](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/report_generator.py) (Report generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_dashboard_ui["Dashboard UI<br/>[dashboard.js]"]
  node_fixed_view["Fixed dashboard<br/>[dashboard.html]"]
  node_dynamic_view["Dynamic dashboard"]
  node_upload_view["Upload page<br/>[upload.html]"]
  node_analytics_view["Analytics page<br/>[analytics.html]"]
  node_reports_view["Reports page<br/>[reports.html]"]
end

subgraph group_backend["Flask application"]
  node_app["Flask routes<br/>[app.py]"]
end

subgraph group_analytics["Sales analytics"]
  node_fixed_data[("Sales dataset<br/>[sales.csv]")]
  node_uploaded_data[("Uploaded datasets")]
  node_sales_analysis["Filtered sales analysis<br/>[sales_analysis.py]"]
  node_dynamic_analysis["Dataset analyzer"]
  node_spark["Spark session<br/>[spark_session.py]"]
end

subgraph group_forecast["Forecasting"]
  node_prediction["Forecast preparation<br/>[prediction.py]"]
  node_forecasting["Time-series models<br/>[forecasting.py]"]
end

subgraph group_exports["Reports"]
  node_report["Report generation"]
end

node_user(("Dashboard user"))

node_user -->|"requests pages"| node_app
node_app -->|"renders"| node_fixed_view
node_app -->|"renders"| node_upload_view
node_app -->|"renders"| node_dynamic_view
node_dashboard_ui -->|"fetches filters"| node_app
node_app -->|"requests metrics"| node_sales_analysis
node_sales_analysis -.->|"reads dataset"| node_fixed_data
node_sales_analysis -->|"uses session"| node_spark
node_sales_analysis -->|"requests forecast"| node_prediction
node_prediction -->|"forecasts series"| node_forecasting
node_app -->|"analyzes upload"| node_dynamic_analysis
node_app -->|"generates exports"| node_report
node_report -->|"uses sales data"| node_sales_analysis
node_app -->|"renders"| node_analytics_view
node_app -->|"renders"| node_reports_view
node_user -.->|"uploads dataset"| node_uploaded_data

click node_app "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/app.py"
click node_dashboard_ui "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/static/js/dashboard.js"
click node_fixed_view "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/templates/dashboard.html"
click node_dynamic_view "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/templates/dynamic_dashboard.html"
click node_upload_view "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/templates/upload.html"
click node_fixed_data "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/sales.csv"
click node_uploaded_data "https://github.com/ashrith-555/ecommerce-sales-analytics/tree/main/static/uploads"
click node_sales_analysis "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/sales_analysis.py"
click node_dynamic_analysis "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/dynamic_analysis.py"
click node_spark "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/spark_session.py"
click node_prediction "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/prediction.py"
click node_forecasting "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/forecasting.py"
click node_report "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/report_generator.py"
click node_analytics_view "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/templates/analytics.html"
click node_reports_view "https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/templates/reports.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard_ui,node_fixed_view,node_dynamic_view,node_upload_view,node_analytics_view,node_reports_view,node_user toneBlue
class node_app toneAmber
class node_fixed_data,node_uploaded_data,node_sales_analysis,node_dynamic_analysis,node_spark toneMint
class node_prediction,node_forecasting toneRose
class node_report toneIndigo
```

## Components

### Web interface

- [Dashboard UI](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/static/js/dashboard.js): `static/js/dashboard.js`
- [Fixed dashboard](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Dynamic dashboard](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/templates/dynamic_dashboard.html): `templates/dynamic_dashboard.html`
- [Upload page](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/templates/upload.html): `templates/upload.html`
- [Analytics page](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/templates/analytics.html): `templates/analytics.html`
- [Reports page](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/templates/reports.html): `templates/reports.html`

### Flask application

- [Flask routes](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/app.py): `app.py`

### Sales analytics

- [Sales dataset](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/sales.csv): `sales.csv`
- [Uploaded datasets](https://github.com/ashrith-555/ecommerce-sales-analytics/tree/main/static/uploads): `static/uploads`
- [Filtered sales analysis](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/sales_analysis.py): `spark_jobs/sales_analysis.py`
- [Dataset analyzer](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/dynamic_analysis.py): `spark_jobs/dynamic_analysis.py`
- [Spark session](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/spark_session.py): `spark_jobs/spark_session.py`

### Forecasting

- [Forecast preparation](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/prediction.py): `spark_jobs/prediction.py`
- [Time-series models](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/forecasting.py): `spark_jobs/forecasting.py`

### Reports

- [Report generation](https://github.com/ashrith-555/ecommerce-sales-analytics/blob/main/spark_jobs/report_generator.py): `spark_jobs/report_generator.py`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Flask routes: requests pages (evidence: `Readme.md`)
- Flask routes → Fixed dashboard: renders (evidence: `app.py`)
- Flask routes → Upload page: renders (evidence: `app.py`)
- Flask routes → Dynamic dashboard: renders (evidence: `app.py`)
- Dashboard UI → Flask routes: fetches filters (evidence: `static/js/dashboard.js`)
- Flask routes → Filtered sales analysis: requests metrics (evidence: `app.py`)
- Filtered sales analysis → Sales dataset: reads dataset
- Filtered sales analysis → Spark session: uses session (evidence: `spark_jobs/sales_analysis.py`)
- Filtered sales analysis → Forecast preparation: requests forecast (evidence: `spark_jobs/sales_analysis.py`)
- Forecast preparation → Time-series models: forecasts series (evidence: `spark_jobs/prediction.py`)
- Flask routes → Dataset analyzer: analyzes upload (evidence: `app.py`)
- Flask routes → Report generation: generates exports (evidence: `app.py`)
- Report generation → Filtered sales analysis: uses sales data (evidence: `spark_jobs/report_generator.py`)
- Flask routes → Analytics page: renders (evidence: `Readme.md`)
- Flask routes → Reports page: renders (evidence: `Readme.md`)
- Dashboard user → Uploaded datasets: uploads dataset
