# anphuoc0408/ecometric-dashboard-website architecture

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

- Interactive diagram: https://gitdiagram.com/anphuoc0408/ecometric-dashboard-website
- Repository: https://github.com/anphuoc0408/ecometric-dashboard-website

## Overview

EcoMetric is a React dashboard for measuring operational resource use and turning it into carbon/ESG insights, recommendations, and reports. The documented loop runs from bulk data input through dashboard, carbon and ESG views, then AI-guided decisions and action plans before remeasurement. Source excerpts establish the dashboard’s orchestration, API-hook fallback, and parts of upload/export behavior; the deeper implementations of several pages were not sampled, so their internal links are limited to documented relationships.

Main entry points: [`ecometric-app/src/App.jsx`](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/App.jsx) (Dashboard shell), [`ecometric-app/src/hooks/useApiData.js`](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/hooks/useApiData.js) (API state hook), [`ecometric-app/src/CarbonEmissions.jsx`](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/CarbonEmissions.jsx) (Carbon inventory), [`ecometric-app/src/ESGReporting.jsx`](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/ESGReporting.jsx) (ESG reporting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Measure and insights"]
  node_data_input["Operational data input<br/>[DataInput.jsx]"]
  node_uploader["Bulk file uploader<br/>[DataUploader.jsx]"]
  node_dashboard["ESG dashboard<br/>[App.jsx]"]
  node_carbon["Carbon inventory"]
  node_esg["ESG reporting<br/>[ESGReporting.jsx]"]
  node_metrics["Dashboard metrics and charts<br/>[MetricsCard.jsx]"]
end

subgraph group_decisions["Decide and act"]
  node_ai["AI recommendations"]
  node_action_plan["Action plan"]
end

subgraph group_platform["Application and data"]
  node_app["Dashboard shell<br/>[App.jsx]"]
  node_settings["Settings<br/>[Settings.jsx]"]
  node_qr["QR integration<br/>[QRCodeCard.jsx]"]
  node_dashboard_data["Dashboard mock data<br/>[dashboardData.js]"]
  node_api_hook["API state hook<br/>[useApiData.js]"]
  node_api_service["HTTP service<br/>[api.js]"]
  node_backend["FastAPI backend"]
  node_export["Report export<br/>[export.js]"]
  node_format["Formatting utilities<br/>[format.js]"]
  node_user_ui["Navigation and dashboard cards<br/>[Topbar.jsx]"]
  node_provenance["Data provenance tag"]
end

node_user(("Enterprise user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_data_input
node_app -->|"routes to"| node_carbon
node_app -->|"routes to"| node_ai
node_app -->|"routes to"| node_esg
node_app -->|"routes to"| node_settings
node_user -.->|"uploads data"| node_data_input
node_data_input -->|"embeds"| node_uploader
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_user_ui
node_app -->|"renders"| node_metrics
node_app -->|"loads via"| node_api_hook
node_api_hook -.->|"calls fetcher"| node_api_service
node_api_service -->|"HTTP requests"| node_backend
node_api_hook -->|"fallback data"| node_dashboard_data
node_user -.->|"reviews emissions"| node_carbon
node_user -.->|"reviews compliance"| node_esg
node_user -.->|"reviews proposals"| node_ai
node_dashboard -->|"opens plan"| node_action_plan
node_ai -.->|"opens plan"| node_action_plan
node_carbon -->|"exports reports"| node_export
node_esg -->|"exports reports"| node_export
node_user_ui -.->|"shows QR"| node_qr
node_metrics -->|"formats values"| node_format
node_dashboard_data -->|"formats money"| node_format
node_provenance -->|"reads tokens"| node_format
node_action_plan -->|"renders tag"| node_provenance
node_carbon -.->|"loads data"| node_api_hook
node_esg -.->|"loads data"| node_api_hook
node_ai -.->|"loads data"| node_api_hook

click node_app "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/App.jsx"
click node_data_input "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/DataInput.jsx"
click node_uploader "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/components/DataUploader.jsx"
click node_dashboard "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/App.jsx"
click node_carbon "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/CarbonEmissions.jsx"
click node_esg "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/ESGReporting.jsx"
click node_ai "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/AIRecommendations.jsx"
click node_action_plan "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/components/ActionPlanModal.jsx"
click node_settings "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/Settings.jsx"
click node_qr "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/QRCodeCard.jsx"
click node_dashboard_data "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/data/dashboardData.js"
click node_api_hook "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/hooks/useApiData.js"
click node_api_service "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/services/api.js"
click node_export "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/lib/export.js"
click node_format "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/lib/format.js"
click node_user_ui "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/components/Topbar.jsx"
click node_metrics "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/components/MetricsCard.jsx"
click node_provenance "https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/components/DataProvenanceTag.jsx"

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_data_input,node_uploader,node_dashboard,node_carbon,node_esg,node_metrics,node_user toneBlue
class node_ai,node_action_plan toneAmber
class node_app,node_settings,node_qr,node_dashboard_data,node_api_hook,node_api_service,node_backend,node_export,node_format,node_user_ui,node_provenance toneMint
```

## Components

### Measure and insights

- [Operational data input](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/DataInput.jsx): `ecometric-app/src/DataInput.jsx`
- [Bulk file uploader](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/components/DataUploader.jsx): `ecometric-app/src/components/DataUploader.jsx`
- [ESG dashboard](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/App.jsx): `ecometric-app/src/App.jsx`
- [Carbon inventory](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/CarbonEmissions.jsx): `ecometric-app/src/CarbonEmissions.jsx`
- [ESG reporting](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/ESGReporting.jsx): `ecometric-app/src/ESGReporting.jsx`
- [Dashboard metrics and charts](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/components/MetricsCard.jsx): `ecometric-app/src/components/MetricsCard.jsx`

### Decide and act

- [AI recommendations](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/AIRecommendations.jsx): `ecometric-app/src/AIRecommendations.jsx`
- [Action plan](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/components/ActionPlanModal.jsx): `ecometric-app/src/components/ActionPlanModal.jsx`

### Application and data

- [Dashboard shell](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/App.jsx): `ecometric-app/src/App.jsx`
- [Settings](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/Settings.jsx): `ecometric-app/src/Settings.jsx`
- [QR integration](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/QRCodeCard.jsx): `ecometric-app/src/QRCodeCard.jsx`
- [Dashboard mock data](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/data/dashboardData.js): `ecometric-app/src/data/dashboardData.js`
- [API state hook](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/hooks/useApiData.js): `ecometric-app/src/hooks/useApiData.js`
- [HTTP service](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/services/api.js): `ecometric-app/src/services/api.js`
- **FastAPI backend**
- [Report export](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/lib/export.js): `ecometric-app/src/lib/export.js`
- [Formatting utilities](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/lib/format.js): `ecometric-app/src/lib/format.js`
- [Navigation and dashboard cards](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/components/Topbar.jsx): `ecometric-app/src/components/Topbar.jsx`
- [Data provenance tag](https://github.com/anphuoc0408/ecometric-dashboard-website/blob/main/ecometric-app/src/components/DataProvenanceTag.jsx): `ecometric-app/src/components/DataProvenanceTag.jsx`

### Other components

- **Enterprise user**

## Connections

- Enterprise user → Dashboard shell: uses (evidence: `ecometric-app/src/App.jsx`)
- Dashboard shell → Operational data input: routes to (evidence: `ecometric-app/src/App.jsx`)
- Dashboard shell → Carbon inventory: routes to (evidence: `ecometric-app/src/App.jsx`)
- Dashboard shell → AI recommendations: routes to (evidence: `ecometric-app/src/App.jsx`)
- Dashboard shell → ESG reporting: routes to (evidence: `ecometric-app/src/App.jsx`)
- Dashboard shell → Settings: routes to (evidence: `ecometric-app/src/App.jsx`)
- Enterprise user → Operational data input: uploads data (evidence: `README.md`)
- Operational data input → Bulk file uploader: embeds (evidence: `ecometric-app/src/DataInput.jsx`)
- Dashboard shell → ESG dashboard: renders (evidence: `ecometric-app/src/App.jsx`)
- Dashboard shell → Navigation and dashboard cards: renders (evidence: `ecometric-app/src/App.jsx`)
- Dashboard shell → Dashboard metrics and charts: renders (evidence: `ecometric-app/src/App.jsx`)
- Dashboard shell → API state hook: loads via (evidence: `ecometric-app/src/App.jsx`)
- API state hook → HTTP service: calls fetcher
- HTTP service → FastAPI backend: HTTP requests (evidence: `ecometric-app/src/services/api.js`)
- API state hook → Dashboard mock data: fallback data (evidence: `ecometric-app/src/App.jsx`)
- Enterprise user → Carbon inventory: reviews emissions (evidence: `README.md`)
- Enterprise user → ESG reporting: reviews compliance (evidence: `README.md`)
- Enterprise user → AI recommendations: reviews proposals (evidence: `README.md`)
- ESG dashboard → Action plan: opens plan (evidence: `ecometric-app/src/App.jsx`)
- AI recommendations → Action plan: opens plan (evidence: `README.md`)
- Carbon inventory → Report export: exports reports (evidence: `ecometric-app/src/CarbonEmissions.jsx`)
- ESG reporting → Report export: exports reports (evidence: `ecometric-app/src/ESGReporting.jsx`)
- Navigation and dashboard cards → QR integration: shows QR (evidence: `README.md`)
- Dashboard metrics and charts → Formatting utilities: formats values (evidence: `ecometric-app/src/components/MetricsCard.jsx`)
- Dashboard mock data → Formatting utilities: formats money (evidence: `ecometric-app/src/data/dashboardData.js`)
- Data provenance tag → Formatting utilities: reads tokens (evidence: `ecometric-app/src/components/DataProvenanceTag.jsx`)
- Action plan → Data provenance tag: renders tag (evidence: `ecometric-app/src/components/ActionPlanModal.jsx`)
- Carbon inventory → API state hook: loads data
- ESG reporting → API state hook: loads data (evidence: `ecometric-app/src/ESGReporting.jsx`)
- AI recommendations → API state hook: loads data (evidence: `ecometric-app/src/AIRecommendations.jsx`)
