# matcordone/my-portfolio-web architecture

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

- Interactive diagram: https://gitdiagram.com/matcordone/my-portfolio-web
- Repository: https://github.com/matcordone/my-portfolio-web

## Overview

##### Project type and purpose
- This is a static personal portfolio website.
- The site is authored in plain HTML, CSS and JavaScript (in `/web`) and served via AWS S3 + CloudFront.
- All cloud resources and delivery pipeline are defined in Terraform (in `/infra`) and automated via GitHub Actions (`.github/workflows/deploy.yml`).

##### File structure
- Top-level directories:
- `.github/workflows` – CI/CD pipeline definitions
- `infra` – Terraform modules and configurations for AWS
- `web` – Static website assets (HTML, CSS, JS, images, fonts)
- Key configuration files:
- `infra/*.tf` – declares S3 bucket, CloudFront distribution, OAC, ACM certificate, Route 53 records, IAM roles, providers, outputs
- `deploy.yml` – syncs `web/` to S3 and invalidates CloudFront cache on each push to `main`

##### README for additional insights
- Describes full static-site stack: S3 for hosting, CloudFront+OAC for CDN, ACM for SSL, Route 53 for DNS
- Terraform is the single source of truth for infra
- GitHub Actions drive deployments and cache invalidations

a. Main components
- Developer workstation (local code)
- GitHub repository & Actions runner
- Terraform (IaC engine)
- AWS S3 bucket (static file host)
- AWS CloudFront distribution (CDN with OAC)
- AWS ACM (SSL/TLS certificate)
- AWS Route 53 (DNS)
b. Relationships & data flow
1. Developer pushes code → GitHub Actions
2. Actions run Terraform apply → provisioning or updating S3, CloudFront, ACM, Route 53
3. Actions sync `/web` assets → S3 bucket
4. Actions send invalidation API call → CloudFront cache
5. End users request `https://mateocordone.com.ar` → Route 53 DNS → CloudFront → S3 origin (OAC enforced)
c. Architectural patterns & design principles
- Infrastructure as Code: all AWS resources defined in Terraform modules
- Continuous Deployment: automated via GitHub Actions
- Static-site CDN pattern: origin (S3) + global edge cache (CloudFront) + HTTPS managed by ACM
d. Key technologies/frameworks
- Terraform (HCL)
- AWS S3, CloudFront, OAC, ACM, Route 53, IAM
- GitHub Actions (CI/CD)
- Plain HTML/CSS/JS

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer
    Dev["Developer Workstation"]:::user

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        direction TB
        GH["GitHub Actions Runner & CI/CD Pipeline"]:::gitci
    end

    %% Infrastructure as Code
    subgraph "Infrastructure as Code"
        direction TB
        TF["Terraform"]:::iac
        Prov["Providers & Backend Configuration"]:::iac
        Vars["Variable Definitions"]:::iac
        IAM["IAM Roles & Policies"]:::iac
        S3TF["AWS S3 Bucket (Static Site Hosting)"]:::aws
        CFTF["AWS CloudFront Distribution & OAC/ACM Setup"]:::aws
        Out["Terraform Outputs"]:::iac
    end

    %% Static Website Files
    subgraph "Static Website Assets"
        direction TB
        HTML["HTML Entry Point"]:::files
        CSS["CSS Assets"]:::files
        JS["JavaScript Assets"]:::files
        SASS["SASS Sources"]:::files
        Fonts["Fonts"]:::files
        Images["Images"]:::files
    end

    %% AWS Cloud Services
    subgraph "AWS Cloud"
        direction TB
        S3["AWS S3 Bucket"]:::aws
        OAC["Origin Access Control (OAC)"]:::aws
        CF["AWS CloudFront Distribution"]:::aws
        ACM["AWS Certificate Manager (ACM)"]:::aws
        DNS["AWS Route 53"]:::aws
    end

    %% End User
    User["End User Browser"]:::user

    %% Flows
    Dev -->|"push code"| GH
    GH -->|"terraform apply"| TF
    TF --> Prov
    TF --> Vars
    TF --> IAM
    TF --> S3TF
    TF --> CFTF
    TF --> Out
    GH -->|"aws s3 sync web/ to S3"| S3
    GH -->|"invalidate cache"| CF
    GH -->|"terraform apply"| DNS

    S3TF --> S3
    CFTF --> CF
    IAM --> S3
    IAM --> CF
    CFTF --> ACM
    DNS --> CF
    CF --> OAC
    OAC --> S3

    User -->|"DNS lookup"| DNS
    DNS -->|"HTTPS request"| CF
    CF -->|"get content"| OAC

    %% Assets flow
    HTML --> CSS
    HTML --> JS
    CSS --> SASS
    HTML --> Fonts
    HTML --> Images

    %% Click Events
    click GH "https://github.com/matcordone/my-portfolio-web/blob/main/.github/workflows/deploy.yml"
    click Prov "https://github.com/matcordone/my-portfolio-web/blob/main/infra/providers.tf"
    click Vars "https://github.com/matcordone/my-portfolio-web/blob/main/infra/variables.tf"
    click IAM "https://github.com/matcordone/my-portfolio-web/blob/main/infra/iam.tf"
    click S3TF "https://github.com/matcordone/my-portfolio-web/blob/main/infra/s3.tf"
    click CFTF "https://github.com/matcordone/my-portfolio-web/blob/main/infra/cloudfront.tf"
    click Out "https://github.com/matcordone/my-portfolio-web/blob/main/infra/outputs.tf"
    click HTML "https://github.com/matcordone/my-portfolio-web/blob/main/web/index.html"
    click CSS "https://github.com/matcordone/my-portfolio-web/blob/main/web/assets/css/main.css"
    click JS "https://github.com/matcordone/my-portfolio-web/blob/main/web/assets/js/main.js"
    click SASS "https://github.com/matcordone/my-portfolio-web/blob/main/web/assets/sass/main.scss"
    click Fonts "https://github.com/matcordone/my-portfolio-web/tree/main/web/assets/webfonts/"
    click Images "https://github.com/matcordone/my-portfolio-web/tree/main/web/images/"

    %% Styles
    classDef gitci fill:#D8B4FE,stroke:#9F7AEA,color:#000
    classDef iac fill:#FCD34D,stroke:#FBBF24,color:#000
    classDef aws fill:#BFDBFE,stroke:#60A5FA,color:#000
    classDef user fill:#BBF7D0,stroke:#34D399,color:#000
    classDef files fill:#E5E7EB,stroke:#9CA3AF,color:#000
```
