# emrecancioglu7/aws-cloud-resume architecture

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

- Interactive diagram: https://gitdiagram.com/emrecancioglu7/aws-cloud-resume
- Repository: https://github.com/emrecancioglu7/aws-cloud-resume

## Overview

##### Project type and purpose
- From the README and file tree, this is a serverless “full-stack” resume website built for the Cloud Resume Challenge.
- The frontend is a static HTML/CSS/JS site (pages, assets, SASS, Bootstrap, custom scripts).
- The backend is a minimal visitor-count API built on AWS Lambda + DynamoDB, fronted by API Gateway.
- Infrastructure and deployments are automated with Terraform and GitHub Actions.

##### Main system components
a. Frontend (static site)
- Code in index.html, addLater.html, maestro.html, service-details.html, etc.
- CSS (assets/css, css/, sass/) and JS (assets/js, js/) assets/images/fonts
- Hosted on AWS S3 bucket as a static website
- Served via AWS CloudFront CDN
- Custom domain configured in AWS Route 53
- SSL/TLS provided by AWS Certificate Manager
b. Backend (visitor-count API)
- AWS API Gateway (HTTP API) exposing /visitor-count endpoint(s)
- AWS Lambda function (Python) to increment & read a counter
- AWS DynamoDB table to store visitor count
c. CI/CD & IaC
- GitHub Actions workflows (from .github/workflows/main.yml)
- Deploy static files to S3
- Invalidate CloudFront cache
- Terraform code (not shown in file tree) defines S3, CloudFront, Route 53, ACM, API Gateway, Lambda, DynamoDB
d. External Dependencies
- Terraform CLI, AWS provider

##### Component interactions and data flow
1. User → DNS (Route 53) → CloudFront
2. CloudFront cache hit → S3 (static assets) returns HTML/CSS/JS
3. Browser renders site; JS code calls the API endpoint via API Gateway
4. API Gateway → Lambda → DynamoDB (read/update visitor count) → Lambda response → API Gateway → browser
5. Terraform provisions all resources; GitHub Actions updates the frontend and triggers CloudFront invalidation

##### Architectural patterns & principles
- Serverless architecture: no host‐managed servers, pay-per-use
- Single-page/static site plus serverless API (micro-service style)
- Infrastructure as Code (declarative, repeatable)
- CI/CD for automated deployments and cache invalidation
- Security best practices:
- Enforce SSL/TLS via ACM & CloudFront
- API Gateway as the only public entry to Lambda/DynamoDB

- Clear component labels (name + purpose)
- Callouts or notes for key design choices (serverless, IaC, CI/CD)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Client
    Browser["End User Browser"]:::external

    %% DNS & CDN Layer
    Browser -->|"HTTPS GET"| Route53["Route 53 (DNS)"]:::backend
    Route53 -->|"Resolves Domain"| CloudFront["CloudFront CDN"]:::backend

    %% Frontend Static Hosting
    subgraph "Static Site (Frontend)" 
        direction TB
        S3["S3 Bucket (Static Website)"]:::frontend
        subgraph "HTML Pages"
            direction TB
            Index["index.html"]:::frontend
            AddLater["addLater.html"]:::frontend
            Maestro["maestro.html"]:::frontend
            ServiceDetails["service-details.html"]:::frontend
            Starter["starter-page.html"]:::frontend
            Valve["valve.html"]:::frontend
        end
        subgraph "CSS Assets"
            direction TB
            MainCSS["assets/css/main.css"]:::frontend
            AnimateCSS["css/animate.css"]:::frontend
            BootstrapCSS["css/bootstrap.css"]:::frontend
            FlexsliderCSS["css/flexslider.css"]:::frontend
            IcomoonCSS["css/icomoon.css"]:::frontend
            StyleCSS["css/style.css"]:::frontend
        end
        subgraph "JS Assets"
            direction TB
            MainJS["assets/js/main.js"]:::frontend
            JQEasing["js/jquery.easing.1.3.js"]:::frontend
            GoogleMapJS["js/google_map.js"]:::frontend
            SiteMainJS["js/main.js"]:::frontend
        end
        subgraph "Media & Fonts"
            direction TB
            Images["assets/img/"]:::frontend
            Video["assets/vid/video.mp4"]:::frontend
            PDF["assets/pdf/Resume_EmreCANCIOGLU.pdf"]:::frontend
            Fonts["fonts/"]:::frontend
        end
    end

    CloudFront -->|"Fetch Static Assets"| S3
    S3 -->|"Serve to CDN"| CloudFront
    CloudFront -->|"HTTPS GET"| Index
    CloudFront -->|"HTTPS GET"| AddLater
    CloudFront -->|"HTTPS GET"| Maestro
    CloudFront -->|"HTTPS GET"| ServiceDetails
    CloudFront -->|"HTTPS GET"| Starter
    CloudFront -->|"HTTPS GET"| Valve

    %% Backend API Layer
    Browser -->|"AJAX HTTPS POST/GET /visitor-count"| APIGateway["API Gateway (HTTP API)"]:::backend
    APIGateway -->|"Invoke"| Lambda["Lambda Function (Visitor Count)"]:::backend
    Lambda -->|"Read/Update"| DynamoDB["DynamoDB Table"]:::data
    DynamoDB -->|"Data Response"| Lambda
    Lambda -->|"API Response"| APIGateway
    APIGateway -->|"API Response"| Browser

    %% DevOps & IaC
    subgraph "CI/CD & IaC" 
        direction TB
        GHActions["GitHub Actions (.github/workflows/main.yml)"]:::devops
        Terraform["Terraform"]:::devops
    end
    GHActions -->|"Deploy Static Files"| S3
    GHActions -->|"Invalidate Cache"| CloudFront
    Terraform -->|"Provision"| S3
    Terraform -->|"Provision"| CloudFront
    Terraform -->|"Provision"| Route53
    Terraform -->|"Provision"| ACM["AWS Certificate Manager"]:::backend
    Terraform -->|"Provision"| APIGateway
    Terraform -->|"Provision"| Lambda
    Terraform -->|"Provision"| DynamoDB

    %% Click Events
    click Index "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/index.html"
    click AddLater "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/addLater.html"
    click Maestro "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/maestro.html"
    click ServiceDetails "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/service-details.html"
    click Starter "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/starter-page.html"
    click Valve "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/valve.html"
    click MainCSS "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/assets/css/main.css"
    click AnimateCSS "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/css/animate.css"
    click BootstrapCSS "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/css/bootstrap.css"
    click FlexsliderCSS "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/css/flexslider.css"
    click IcomoonCSS "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/css/icomoon.css"
    click StyleCSS "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/css/style.css"
    click MainJS "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/assets/js/main.js"
    click JQEasing "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/js/jquery.easing.1.3.js"
    click GoogleMapJS "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/js/google_map.js"
    click SiteMainJS "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/js/main.js"
    click GHActions "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/.github/workflows/main.yml"
    click README "https://github.com/emrecancioglu7/aws-cloud-resume/blob/main/README.md"

    %% Styles
    classDef frontend fill:#D0E6F7,stroke:#333,stroke-width:1px
    classDef backend fill:#D6EADF,stroke:#333,stroke-width:1px
    classDef data fill:#E5D4F2,stroke:#333,stroke-width:1px
    classDef devops fill:#FFE5B4,stroke:#333,stroke-width:1px
    classDef external fill:#CCCCCC,stroke:#333,stroke-width:1px
```
