# wechicken456/my-cloud-resume architecture

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

- Interactive diagram: https://gitdiagram.com/wechicken456/my-cloud-resume
- Repository: https://github.com/wechicken456/my-cloud-resume

## Overview

##### Project type and purpose
- This is a full-stack, serverless “Cloud Resume” web application.
- Frontend: a static single-page site built in TypeScript, CSS, and Vite.
- Backend: a Go-based AWS Lambda function behind API Gateway that reads/writes a visitor counter in DynamoDB.
- Infrastructure: S3 for static hosting, CloudFront CDN, Route 53 custom domain, ACM for SSL, DynamoDB, API Gateway, Lambda.
- CI/CD: GitHub Actions pipelines for frontend (deploy to S3) and backend (build/test/deploy Lambda).

##### Key architectural components (derived from file tree & README)
- src/frontend → builds static assets (index.html, main.ts, style.css)
- src/backend → Go code (main.go, tests) packaged into a Lambda “bootstrap” binary
- .github/workflows → two GitHub Actions workflows (backend.yml, frontend.yml)
- AWS Services: S3 bucket (static host), CloudFront distribution (with OAI), Route 53, ACM, DynamoDB table, API Gateway, Lambda.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer CI Environment
    subgraph "Developer CI Environment"
        direction TB
        GHFrontend["GitHub Actions: Frontend"]:::cicd
        GHBackend["GitHub Actions: Backend"]:::cicd
        subgraph "Frontend Code"
            direction TB
            FEApp["src/frontend/"]:::static
            FEMain["main.ts"]:::static
            FECounter["counter.ts"]:::static
            FEData["data.ts"]:::static
            FEStyle["style.css"]:::static
            FEHTML["index.html"]:::static
            FVite["vite.config.ts"]:::static
            FTS["tsconfig.json"]:::static
            FPkg["package.json & package-lock.json"]:::static
        end
        subgraph "Backend Code"
            direction TB
            BECode["main.go"]:::compute
            BETest["main_test.go"]:::compute
            BEGoMod["go.mod & go.sum"]:::compute
            BEUpdate["update_lambda.sh"]:::compute
        end
        subgraph "Workflows"
            direction TB
            FrontendWF[".github/workflows/frontend.yml"]:::cicd
            BackendWF[".github/workflows/backend.yml"]:::cicd
        end
    end

    %% AWS Account
    subgraph "AWS Account"
        direction TB
        Route53["Route 53 (DNS)"]:::aws
        ACM["ACM SSL Certificate"]:::aws
        CloudFront["CloudFront CDN"]:::aws
        S3["S3 Static Website Bucket"]:::static
        APIGW["API Gateway"]:::aws
        Lambda["Lambda Function (Go)"]:::compute
        DynamoDB["DynamoDB Table\nVisitorCounter"]:::db
    end

    %% User and Browser
    User["User / Browser"]:::external

    %% Data Flows
    User -->|HTTPS GET www.site.com| Route53
    Route53 -->|resolves domain| CloudFront
    CloudFront -->|serves static assets| S3
    CloudFront -->|delivers content| User

    User -->|SPA Loads| FEApp
    FEApp -->|loads<br>main.ts, style.css, index.html| FEMain
    FEApp --> FECounter
    FEApp --> FEData
    FEApp --> FEStyle
    FEApp --> FEHTML

    User -->|HTTPS GET /getCount| APIGW
    User -->|HTTPS POST /incrementCount| APIGW
    APIGW -->|invoke| Lambda
    Lambda -->|read/write| DynamoDB
    DynamoDB -->|response| Lambda
    Lambda -->|JSON response| APIGW
    APIGW -->|JSON| User

    %% CI/CD Deployments
    FrontendWF -->|aws s3 cp & invalidate| S3
    BackendWF -->|build/test & update-function-code| Lambda

    %% Click Events
    click FEApp "https://github.com/wechicken456/my-cloud-resume/tree/master/src/frontend/"
    click FEMain "https://github.com/wechicken456/my-cloud-resume/blob/master/src/frontend/main.ts"
    click FECounter "https://github.com/wechicken456/my-cloud-resume/blob/master/src/frontend/counter.ts"
    click FEData "https://github.com/wechicken456/my-cloud-resume/blob/master/src/frontend/data.ts"
    click FEStyle "https://github.com/wechicken456/my-cloud-resume/blob/master/src/frontend/style.css"
    click FEHTML "https://github.com/wechicken456/my-cloud-resume/blob/master/index.html"
    click FVite "https://github.com/wechicken456/my-cloud-resume/blob/master/vite.config.ts"
    click FTS "https://github.com/wechicken456/my-cloud-resume/blob/master/tsconfig.json"
    click FPkg "https://github.com/wechicken456/my-cloud-resume/blob/master/package.json"
    click FPkg "https://github.com/wechicken456/my-cloud-resume/blob/master/package-lock.json"
    click BECode "https://github.com/wechicken456/my-cloud-resume/blob/master/src/backend/main.go"
    click BETest "https://github.com/wechicken456/my-cloud-resume/blob/master/src/backend/main_test.go"
    click BEGoMod "https://github.com/wechicken456/my-cloud-resume/blob/master/src/backend/go.mod"
    click BEGoMod "https://github.com/wechicken456/my-cloud-resume/blob/master/src/backend/go.sum"
    click BEUpdate "https://github.com/wechicken456/my-cloud-resume/blob/master/src/backend/update_lambda.sh"
    click FrontendWF "https://github.com/wechicken456/my-cloud-resume/blob/master/.github/workflows/frontend.yml"
    click BackendWF "https://github.com/wechicken456/my-cloud-resume/blob/master/.github/workflows/backend.yml"

    %% Styling
    classDef external fill:#ddeeff,stroke:#000,color:#000;
    classDef aws fill:#ffe4b5,stroke:#cc8400,color:#000;
    classDef static fill:#add8e6,stroke:#005f8f,color:#000;
    classDef compute fill:#90ee90,stroke:#028a02,color:#000;
    classDef db fill:#dda0dd,stroke:#8b008b,color:#000;
    classDef cicd fill:#d3d3d3,stroke:#808080,color:#000;
```
