# barrosamorim/cloud-resume-challenge architecture

> Architecture diagram of the GitHub repository barrosamorim/cloud-resume-challenge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/barrosamorim/cloud-resume-challenge
- Repository: https://github.com/barrosamorim/cloud-resume-challenge

## Overview

This repository implements a cloud-hosted interactive résumé with a visitor counter. A visitor loads the static site, whose JavaScript sends a request to the API; the API invokes a Lambda function that atomically increments the DynamoDB count and returns it for display. Terraform defines the hosting, delivery, API, compute, database, and certificate resources. The workflow follows the sampled frontend and Lambda code; service wiring and some frontend details are based on the README, since those Terraform and HTML/CSS files were not sampled.

Main entry points: [`backend/lambda_function.py`](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/backend/lambda_function.py) (Counter handler), [`frontend/main.js`](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/frontend/main.js) (Counter client), [`terraform/cloudfront.tf`](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/cloudfront.tf) (CDN configuration), [`terraform/s3.tf`](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/s3.tf) (Bucket configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Résumé interface"]
  node_html["Résumé page<br/>[index.html]"]
  node_styles["Page styling<br/>[style.css]"]
  node_browser_js["Counter client<br/>[main.js]"]
end

subgraph group_delivery["Web delivery"]
  node_cloudfront["CloudFront CDN"]
  node_s3[("Static site bucket")]
  node_acm["TLS certificate"]
end

subgraph group_counter["Visitor counter"]
  node_api["API Gateway"]
  node_lambda["Counter handler<br/>[lambda_function.py]"]
  node_dynamodb[("Visit counter table")]
end

subgraph group_infra["Terraform infrastructure"]
  node_tf_cloudfront["CDN configuration<br/>[cloudfront.tf]"]
  node_tf_s3["Bucket configuration<br/>[s3.tf]"]
  node_tf_acm["Certificate configuration<br/>[acm.tf]"]
  node_tf_api["API configuration<br/>[api_gateway.tf]"]
  node_tf_lambda["Lambda configuration<br/>[lambda.tf]"]
  node_tf_dynamo["Table configuration<br/>[dynamodb.tf]"]
end

node_visitor(("Browser visitor"))

node_visitor -->|"loads site"| node_cloudfront
node_cloudfront -->|"fetches assets"| node_s3
node_cloudfront -->|"uses certificate"| node_acm
node_visitor -->|"runs client"| node_browser_js
node_browser_js -->|"POSTs count request"| node_api
node_api -->|"invokes"| node_lambda
node_lambda -->|"increments count"| node_dynamodb
node_lambda -->|"returns count"| node_browser_js
node_tf_cloudfront -->|"configures"| node_cloudfront
node_tf_s3 -->|"configures"| node_s3
node_tf_acm -->|"configures"| node_acm
node_tf_api -->|"configures"| node_api
node_tf_lambda -->|"configures"| node_lambda
node_tf_dynamo -->|"configures"| node_dynamodb

click node_html "https://github.com/barrosamorim/cloud-resume-challenge/blob/main/frontend/index.html"
click node_styles "https://github.com/barrosamorim/cloud-resume-challenge/blob/main/frontend/style.css"
click node_browser_js "https://github.com/barrosamorim/cloud-resume-challenge/blob/main/frontend/main.js"
click node_lambda "https://github.com/barrosamorim/cloud-resume-challenge/blob/main/backend/lambda_function.py"
click node_tf_cloudfront "https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/cloudfront.tf"
click node_tf_s3 "https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/s3.tf"
click node_tf_acm "https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/acm.tf"
click node_tf_api "https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/api_gateway.tf"
click node_tf_lambda "https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/lambda.tf"
click node_tf_dynamo "https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/dynamodb.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_html,node_styles,node_browser_js,node_visitor toneBlue
class node_cloudfront,node_s3,node_acm toneAmber
class node_api,node_lambda,node_dynamodb toneMint
class node_tf_cloudfront,node_tf_s3,node_tf_acm,node_tf_api,node_tf_lambda,node_tf_dynamo toneRose
```

## Components

### Résumé interface

- [Résumé page](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/frontend/index.html): `frontend/index.html`
- [Page styling](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/frontend/style.css): `frontend/style.css`
- [Counter client](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/frontend/main.js): `frontend/main.js`

### Web delivery

- **CloudFront CDN**
- **Static site bucket**
- **TLS certificate**

### Visitor counter

- **API Gateway**
- [Counter handler](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/backend/lambda_function.py): `backend/lambda_function.py`
- **Visit counter table**

### Terraform infrastructure

- [CDN configuration](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/cloudfront.tf): `terraform/cloudfront.tf`
- [Bucket configuration](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/s3.tf): `terraform/s3.tf`
- [Certificate configuration](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/acm.tf): `terraform/acm.tf`
- [API configuration](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/api_gateway.tf): `terraform/api_gateway.tf`
- [Lambda configuration](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/lambda.tf): `terraform/lambda.tf`
- [Table configuration](https://github.com/barrosamorim/cloud-resume-challenge/blob/main/terraform/dynamodb.tf): `terraform/dynamodb.tf`

### Other components

- **Browser visitor**

## Connections

- Browser visitor → CloudFront CDN: loads site (evidence: `README.md`)
- CloudFront CDN → Static site bucket: fetches assets (evidence: `README.md`)
- CloudFront CDN → TLS certificate: uses certificate (evidence: `README.md`)
- Browser visitor → Counter client: runs client (evidence: `README.md`)
- Counter client → API Gateway: POSTs count request (evidence: `frontend/main.js`)
- API Gateway → Counter handler: invokes (evidence: `README.md`)
- Counter handler → Visit counter table: increments count (evidence: `backend/lambda_function.py`)
- Counter handler → Counter client: returns count (evidence: `backend/lambda_function.py`)
- CDN configuration → CloudFront CDN: configures (evidence: `README.md`)
- Bucket configuration → Static site bucket: configures (evidence: `README.md`)
- Certificate configuration → TLS certificate: configures (evidence: `README.md`)
- API configuration → API Gateway: configures (evidence: `README.md`)
- Lambda configuration → Counter handler: configures (evidence: `README.md`)
- Table configuration → Visit counter table: configures (evidence: `README.md`)
