# smeenakshi28/energy-usage-dashboard architecture

> Architecture diagram of the GitHub repository smeenakshi28/energy-usage-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/smeenakshi28/energy-usage-dashboard
- Repository: https://github.com/smeenakshi28/energy-usage-dashboard

## Overview

Energy Usage Dashboard is a Flask application that loads the supplied household-energy dataset, serves a dashboard, and exposes JSON endpoints for summaries, time patterns, and analysis. The browser-side script requests those endpoints and renders metrics, charts, and tables; a month filter requests month-specific metrics. The graph groups the API capabilities by domain. Source excerpts show the dataset loading and several endpoint implementations, while README feature documentation supports the unsampled capabilities; the HTML template itself was not sampled.

Main entry points: [`static/script.js`](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/static/script.js) (Dashboard client), [`energydata_complete.csv`](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/energydata_complete.csv) (Energy dataset), [`app.py`](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py) (Flask application), [`templates/index.html`](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/templates/index.html) (Dashboard page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Dashboard"]
  node_page["Dashboard page<br/>[index.html]"]
  node_browser["Dashboard client<br/>[script.js]"]
  node_server["Flask application<br/>[app.py]"]
end

subgraph group_summary["Consumption summaries"]
  node_overall["Overall metrics API<br/>[app.py]"]
  node_monthdetails["Month details API<br/>[app.py]"]
end

subgraph group_patterns["Usage patterns"]
  node_monthly["Monthly totals API<br/>[app.py]"]
  node_hourly["Hourly usage API<br/>[app.py]"]
  node_weekday["Weekday usage API<br/>[app.py]"]
end

subgraph group_analysis["Dataset analysis"]
  node_temperature["Temperature comparison API<br/>[app.py]"]
  node_statistics["Usage statistics API<br/>[app.py]"]
  node_correlation["Feature correlation API<br/>[app.py]"]
end

node_visitor(("Dashboard visitor"))
node_dataset[("Energy dataset")]

node_visitor -->|"opens"| node_page
node_server -->|"renders"| node_page
node_server -->|"loads"| node_dataset
node_browser -->|"fetches"| node_overall
node_browser -->|"fetches"| node_monthly
node_browser -->|"fetches"| node_monthdetails
node_browser -->|"fetches"| node_hourly
node_browser -->|"fetches"| node_weekday
node_browser -->|"fetches"| node_temperature
node_browser -->|"fetches"| node_statistics
node_browser -->|"fetches"| node_correlation
node_overall -->|"aggregates"| node_dataset
node_monthly -->|"groups by month"| node_dataset
node_monthdetails -->|"filters month"| node_dataset
node_hourly -->|"groups by hour"| node_dataset
node_weekday -->|"groups by weekday"| node_dataset
node_temperature -->|"selects features"| node_dataset
node_statistics -->|"describes usage"| node_dataset
node_correlation -->|"computes correlations"| node_dataset

click node_page "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/templates/index.html"
click node_browser "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/static/script.js"
click node_server "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py"
click node_dataset "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/energydata_complete.csv"
click node_overall "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py"
click node_monthly "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py"
click node_monthdetails "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py"
click node_hourly "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py"
click node_weekday "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py"
click node_temperature "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py"
click node_statistics "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py"
click node_correlation "https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py"

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_page,node_browser,node_server toneBlue
class node_overall,node_monthdetails,node_dataset toneAmber
class node_monthly,node_hourly,node_weekday toneMint
class node_temperature,node_statistics,node_correlation toneRose
class node_visitor toneIndigo
```

## Components

### Dashboard

- [Dashboard page](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/templates/index.html): `templates/index.html`
- [Dashboard client](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/static/script.js): `static/script.js`
- [Flask application](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py): `app.py`

### Consumption summaries

- [Overall metrics API](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py): `app.py`
- [Month details API](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py): `app.py`

### Usage patterns

- [Monthly totals API](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py): `app.py`
- [Hourly usage API](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py): `app.py`
- [Weekday usage API](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py): `app.py`

### Dataset analysis

- [Temperature comparison API](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py): `app.py`
- [Usage statistics API](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py): `app.py`
- [Feature correlation API](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/app.py): `app.py`

### Other components

- **Dashboard visitor**
- [Energy dataset](https://github.com/smeenakshi28/energy-usage-dashboard/blob/main/energydata_complete.csv): `energydata_complete.csv`

## Connections

- Dashboard visitor → Dashboard page: opens (evidence: `README.md`)
- Flask application → Dashboard page: renders (evidence: `app.py`)
- Flask application → Energy dataset: loads (evidence: `app.py`)
- Dashboard client → Overall metrics API: fetches (evidence: `static/script.js`)
- Dashboard client → Monthly totals API: fetches (evidence: `static/script.js`)
- Dashboard client → Month details API: fetches (evidence: `static/script.js`)
- Dashboard client → Hourly usage API: fetches (evidence: `static/script.js`)
- Dashboard client → Weekday usage API: fetches (evidence: `static/script.js`)
- Dashboard client → Temperature comparison API: fetches (evidence: `static/script.js`)
- Dashboard client → Usage statistics API: fetches (evidence: `static/script.js`)
- Dashboard client → Feature correlation API: fetches (evidence: `static/script.js`)
- Overall metrics API → Energy dataset: aggregates (evidence: `app.py`)
- Monthly totals API → Energy dataset: groups by month (evidence: `app.py`)
- Month details API → Energy dataset: filters month (evidence: `app.py`)
- Hourly usage API → Energy dataset: groups by hour (evidence: `app.py`)
- Weekday usage API → Energy dataset: groups by weekday (evidence: `app.py`)
- Temperature comparison API → Energy dataset: selects features (evidence: `app.py`)
- Usage statistics API → Energy dataset: describes usage (evidence: `app.py`)
- Feature correlation API → Energy dataset: computes correlations (evidence: `app.py`)
