# chayakiranch/aws-billing-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/chayakiranch/aws-billing-dashboard
- Repository: https://github.com/chayakiranch/aws-billing-dashboard

## Overview

AWS Billing Dashboard is a React/Express tool for reviewing AWS costs, forecasts, resources, performance, and savings opportunities. The main workflow is: an operator opens the dashboard in demo mode or connects AWS credentials, the billing hook supplies mock or live billing data, and dashboard views present trends, service costs, summaries, and forecasts. Other tabs cover resource inventory, CloudWatch performance, recommendations, and future-cost analysis. The backend routes live queries to AWS SDK services; the app has no database. Unexcerpted UI-to-API wiring is shown only where documented or left unlinked.

Main entry points: [`src/components/Dashboard.jsx`](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/Dashboard.jsx) (Dashboard), [`server/server.js`](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/server.js) (Express Server), [`server/routes/recommendations.js`](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/routes/recommendations.js) (Recommendation Routes), [`server/routes/billing.js`](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/routes/billing.js) (Billing Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard UI"]
  node_app["React App<br/>[App.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_connect["Connect Account<br/>[ConnectModal.jsx]"]
end

subgraph group_billing["Billing Data"]
  node_billinghook["Billing Data Hook<br/>[useBillingData.js]"]
  node_billingviews["Billing Views"]
  node_trend["Trend Chart<br/>[TrendChart.jsx]"]
  node_forecastview["Forecast Panel<br/>[ForecastPanel.jsx]"]
  node_summaryview["Billing Summary<br/>[BillingSummary.jsx]"]
end

subgraph group_insights["Cost Insights"]
  node_future["Future Cost Analysis"]
  node_resourcesview["Resource Inventory<br/>[ResourcesTab.jsx]"]
  node_performanceview["Performance View<br/>[PerformanceTab.jsx]"]
  node_recommendview["Recommendations View"]
  node_rules["Recommendation Engine<br/>[recommendations.js]"]
end

subgraph group_backend["API Backend"]
  node_server["Express Server<br/>[server.js]"]
  node_billingroute["Billing Routes<br/>[billing.js]"]
  node_resourceroute["Resource Routes<br/>[resources.js]"]
  node_performanceroute["Performance Routes<br/>[performance.js]"]
  node_recommendroute["Recommendation Routes<br/>[recommendations.js]"]
end

subgraph group_aws["AWS Integrations"]
  node_billingservice["Cost Explorer Billing<br/>[awsBilling.js]"]
  node_resourceservice["AWS Resource Inventory<br/>[awsResources.js]"]
  node_cloudwatch["CloudWatch Metrics<br/>[cloudwatch.js]"]
end

node_operator(("Operator"))
node_aws{{"AWS Services"}}

node_operator -->|"opens"| node_app
node_app -->|"renders"| node_dashboard
node_dashboard -->|"opens"| node_connect
node_dashboard -->|"loads data"| node_billinghook
node_dashboard -->|"renders"| node_billingviews
node_dashboard -->|"renders"| node_trend
node_dashboard -->|"renders"| node_forecastview
node_dashboard -->|"renders"| node_summaryview
node_dashboard -->|"renders"| node_future
node_dashboard -->|"renders"| node_resourcesview
node_dashboard -->|"renders"| node_performanceview
node_dashboard -->|"renders"| node_recommendview
node_billinghook -->|"requests"| node_billingroute
node_server -->|"mounts"| node_billingroute
node_server -->|"mounts"| node_resourceroute
node_server -->|"mounts"| node_performanceroute
node_server -->|"mounts"| node_recommendroute
node_billingroute -->|"calls"| node_billingservice
node_resourceroute -->|"calls"| node_resourceservice
node_performanceroute -->|"calls"| node_cloudwatch
node_recommendroute -->|"fetches metrics"| node_cloudwatch
node_recommendroute -->|"runs"| node_rules
node_billingservice -->|"queries costs"| node_aws
node_resourceservice -->|"lists resources"| node_aws
node_cloudwatch -->|"reads metrics"| node_aws

click node_app "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/App.jsx"
click node_dashboard "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/Dashboard.jsx"
click node_connect "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/ConnectModal.jsx"
click node_billinghook "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/hooks/useBillingData.js"
click node_billingviews "https://github.com/chayakiranch/aws-billing-dashboard/tree/main/src/components"
click node_trend "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/TrendChart.jsx"
click node_forecastview "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/ForecastPanel.jsx"
click node_summaryview "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/BillingSummary.jsx"
click node_future "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/FutureCostPrediction.jsx"
click node_resourcesview "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/ResourcesTab.jsx"
click node_performanceview "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/PerformanceTab.jsx"
click node_recommendview "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/RecommendationsTab.jsx"
click node_server "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/server.js"
click node_billingroute "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/routes/billing.js"
click node_resourceroute "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/routes/resources.js"
click node_performanceroute "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/routes/performance.js"
click node_recommendroute "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/routes/recommendations.js"
click node_billingservice "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/services/awsBilling.js"
click node_resourceservice "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/services/awsResources.js"
click node_cloudwatch "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/services/cloudwatch.js"
click node_rules "https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/services/recommendations.js"

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_app,node_dashboard,node_connect toneBlue
class node_billinghook,node_billingviews,node_trend,node_forecastview,node_summaryview toneAmber
class node_future,node_resourcesview,node_performanceview,node_recommendview,node_rules toneMint
class node_server,node_billingroute,node_resourceroute,node_performanceroute,node_recommendroute toneRose
class node_billingservice,node_resourceservice,node_cloudwatch,node_operator,node_aws toneIndigo
```

## Components

### Dashboard UI

- [React App](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/App.jsx): `src/App.jsx`
- [Dashboard](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/Dashboard.jsx): `src/components/Dashboard.jsx`
- [Connect Account](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/ConnectModal.jsx): `src/components/ConnectModal.jsx`

### Billing Data

- [Billing Data Hook](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/hooks/useBillingData.js): `src/hooks/useBillingData.js`
- [Billing Views](https://github.com/chayakiranch/aws-billing-dashboard/tree/main/src/components): `src/components`
- [Trend Chart](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/TrendChart.jsx): `src/components/TrendChart.jsx`
- [Forecast Panel](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/ForecastPanel.jsx): `src/components/ForecastPanel.jsx`
- [Billing Summary](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/BillingSummary.jsx): `src/components/BillingSummary.jsx`

### Cost Insights

- [Future Cost Analysis](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/FutureCostPrediction.jsx): `src/components/FutureCostPrediction.jsx`
- [Resource Inventory](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/ResourcesTab.jsx): `src/components/ResourcesTab.jsx`
- [Performance View](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/PerformanceTab.jsx): `src/components/PerformanceTab.jsx`
- [Recommendations View](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/src/components/RecommendationsTab.jsx): `src/components/RecommendationsTab.jsx`
- [Recommendation Engine](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/services/recommendations.js): `server/services/recommendations.js`

### API Backend

- [Express Server](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/server.js): `server/server.js`
- [Billing Routes](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/routes/billing.js): `server/routes/billing.js`
- [Resource Routes](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/routes/resources.js): `server/routes/resources.js`
- [Performance Routes](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/routes/performance.js): `server/routes/performance.js`
- [Recommendation Routes](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/routes/recommendations.js): `server/routes/recommendations.js`

### AWS Integrations

- [Cost Explorer Billing](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/services/awsBilling.js): `server/services/awsBilling.js`
- [AWS Resource Inventory](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/services/awsResources.js): `server/services/awsResources.js`
- [CloudWatch Metrics](https://github.com/chayakiranch/aws-billing-dashboard/blob/main/server/services/cloudwatch.js): `server/services/cloudwatch.js`

### Other components

- **Operator**
- **AWS Services**

## Connections

- Operator → React App: opens (evidence: `README.md`)
- React App → Dashboard: renders (evidence: `src/App.jsx`)
- Dashboard → Connect Account: opens (evidence: `src/components/Dashboard.jsx`)
- Dashboard → Billing Data Hook: loads data (evidence: `src/components/Dashboard.jsx`)
- Dashboard → Billing Views: renders (evidence: `src/components/Dashboard.jsx`)
- Dashboard → Trend Chart: renders (evidence: `src/components/Dashboard.jsx`)
- Dashboard → Forecast Panel: renders (evidence: `src/components/Dashboard.jsx`)
- Dashboard → Billing Summary: renders (evidence: `src/components/Dashboard.jsx`)
- Dashboard → Future Cost Analysis: renders (evidence: `src/components/Dashboard.jsx`)
- Dashboard → Resource Inventory: renders (evidence: `src/components/Dashboard.jsx`)
- Dashboard → Performance View: renders (evidence: `src/components/Dashboard.jsx`)
- Dashboard → Recommendations View: renders (evidence: `src/components/Dashboard.jsx`)
- Billing Data Hook → Billing Routes: requests (evidence: `src/hooks/useBillingData.js`)
- Express Server → Billing Routes: mounts (evidence: `server/server.js`)
- Express Server → Resource Routes: mounts (evidence: `server/server.js`)
- Express Server → Performance Routes: mounts (evidence: `server/server.js`)
- Express Server → Recommendation Routes: mounts (evidence: `server/server.js`)
- Billing Routes → Cost Explorer Billing: calls (evidence: `server/routes/billing.js`)
- Resource Routes → AWS Resource Inventory: calls (evidence: `server/routes/resources.js`)
- Performance Routes → CloudWatch Metrics: calls (evidence: `server/routes/performance.js`)
- Recommendation Routes → CloudWatch Metrics: fetches metrics (evidence: `server/routes/recommendations.js`)
- Recommendation Routes → Recommendation Engine: runs (evidence: `server/routes/recommendations.js`)
- Cost Explorer Billing → AWS Services: queries costs (evidence: `README.md`)
- AWS Resource Inventory → AWS Services: lists resources (evidence: `README.md`)
- CloudWatch Metrics → AWS Services: reads metrics (evidence: `README.md`)
