# phalepallo/aws-cloud-governance-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/phalepallo/aws-cloud-governance-dashboard
- Repository: https://github.com/phalepallo/aws-cloud-governance-dashboard

## Overview

This is a read-only AWS cloud-governance dashboard: a user loads audit records, the frontend requests them from the API, and the backend reads them from DynamoDB before the UI filters, summarizes, and renders them. The README documents private S3 hosting behind CloudFront, API Gateway-to-Lambda integration, least-privilege access, and Terraform-managed infrastructure. The sampled sources confirm frontend processing and a DynamoDB scan; unsampled deployment wiring is represented only where the README or Terraform paths support it.

Main entry points: [`backend/src/handlers/getAuditLogs.ts`](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/backend/src/handlers/getAuditLogs.ts) (Audit handler), [`frontend/src/app.js`](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/frontend/src/app.js) (Dashboard app), [`frontend/src/api.js`](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/frontend/src/api.js) (Audit API client), [`terraform/lambda.tf`](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/terraform/lambda.tf) (REST API Gateway)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hosting["Static Hosting"]
  node_cloudfront["CloudFront CDN<br/>[cloudfront.tf]"]
  node_s3[("Private S3 site<br/>[frontend.tf]")]
end

subgraph group_frontend["Dashboard UI"]
  node_html["Dashboard page<br/>[index.html]"]
  node_app["Dashboard app<br/>[app.js]"]
  node_api_client["Audit API client<br/>[api.js]"]
end

subgraph group_backend["Audit API"]
  node_gateway["REST API Gateway<br/>[lambda.tf]"]
  node_handler["Audit handler<br/>[getAuditLogs.ts]"]
  node_reader["DynamoDB reader<br/>[dynamodb.ts]"]
  node_table[("Audit log table<br/>[dynamodb.tf]")]
  node_iam{{"Access permissions<br/>[iam.tf]"}}
end

node_user(("Dashboard user"))

node_user -->|"opens dashboard"| node_cloudfront
node_cloudfront -->|"fetches site"| node_s3
node_s3 -->|"serves page"| node_html
node_html -->|"loads app"| node_app
node_app -->|"requests logs"| node_api_client
node_api_client -->|"GET audit"| node_gateway
node_gateway -->|"invokes"| node_handler
node_handler -->|"fetches logs"| node_reader
node_reader -->|"scans records"| node_table
node_table -->|"returns records"| node_reader
node_reader -->|"returns logs"| node_handler
node_handler -->|"returns response"| node_gateway
node_gateway -->|"returns JSON"| node_api_client
node_api_client -->|"returns logs"| node_app
node_app -->|"shows filtered results"| node_user
node_iam -->|"grants execution"| node_handler
node_iam -->|"limits data access"| node_table

click node_cloudfront "https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/terraform/cloudfront.tf"
click node_s3 "https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/terraform/frontend.tf"
click node_html "https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/frontend/public/index.html"
click node_app "https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/frontend/src/app.js"
click node_api_client "https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/frontend/src/api.js"
click node_gateway "https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/terraform/lambda.tf"
click node_handler "https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/backend/src/handlers/getAuditLogs.ts"
click node_reader "https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/backend/src/services/dynamodb.ts"
click node_table "https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/terraform/dynamodb.tf"
click node_iam "https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/terraform/iam.tf"

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_cloudfront,node_s3,node_user toneBlue
class node_html,node_app,node_api_client toneAmber
class node_gateway,node_handler,node_reader,node_table,node_iam toneMint
```

## Components

### Static Hosting

- [CloudFront CDN](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/terraform/cloudfront.tf): `terraform/cloudfront.tf`
- [Private S3 site](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/terraform/frontend.tf): `terraform/frontend.tf`

### Dashboard UI

- [Dashboard page](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/frontend/public/index.html): `frontend/public/index.html`
- [Dashboard app](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/frontend/src/app.js): `frontend/src/app.js`
- [Audit API client](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/frontend/src/api.js): `frontend/src/api.js`

### Audit API

- [REST API Gateway](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/terraform/lambda.tf): `terraform/lambda.tf`
- [Audit handler](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/backend/src/handlers/getAuditLogs.ts): `backend/src/handlers/getAuditLogs.ts`
- [DynamoDB reader](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/backend/src/services/dynamodb.ts): `backend/src/services/dynamodb.ts`
- [Audit log table](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/terraform/dynamodb.tf): `terraform/dynamodb.tf`
- [Access permissions](https://github.com/phalepallo/aws-cloud-governance-dashboard/blob/main/terraform/iam.tf): `terraform/iam.tf`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → CloudFront CDN: opens dashboard
- CloudFront CDN → Private S3 site: fetches site
- Private S3 site → Dashboard page: serves page
- Dashboard page → Dashboard app: loads app
- Dashboard app → Audit API client: requests logs
- Audit API client → REST API Gateway: GET audit
- REST API Gateway → Audit handler: invokes
- Audit handler → DynamoDB reader: fetches logs
- DynamoDB reader → Audit log table: scans records
- Audit log table → DynamoDB reader: returns records
- DynamoDB reader → Audit handler: returns logs
- Audit handler → REST API Gateway: returns response
- REST API Gateway → Audit API client: returns JSON
- Audit API client → Dashboard app: returns logs
- Dashboard app → Dashboard user: shows filtered results
- Access permissions → Audit handler: grants execution
- Access permissions → Audit log table: limits data access
