# yeo11200/gatsby-blog architecture

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

- Interactive diagram: https://gitdiagram.com/yeo11200/gatsby-blog
- Repository: https://github.com/yeo11200/gatsby-blog

## Overview

##### Project type and purpose
- This is a Gatsby‐based static site generator project used for a personal blog and résumé.
- It leverages React (with TypeScript and SCSS) to produce a static site from Markdown content and deploys to Vercel.

##### File structure
- Top level
– content/ : Markdown files (resume, about pages, other blog content)
– gatsby-config.js, gatsby-node.js, gatsby-meta-config.js : Gatsby configuration and customization
– src/ : React components, pages, templates, and type definitions
– vercel.json : deployment settings
- src/components/ : reusable UI pieces (Layout, Modal, presidential‐detail modal, etc.)
- src/pages/ : Gatsby “page” components (index.tsx, /projects)
- src/templates/ : GraphQL‐driven page templates (e.g. AboutTemplate.tsx)
- SCSS files alongside TSX to style components
- tsconfig.json : TypeScript compiler settings

##### Key insights from README
- Purpose is simple: “Use gatsby to organize blog and résumé”

a. Main components
1. Content Layer
– Markdown sources in content/
2. Build Layer (Gatsby Node.js)
– Plugins & GraphQL data layer
– gatsby-config.js / gatsby-node.js customize sourcing and page creation
3. Frontend Layer
– React + TypeScript components (src/)
– SCSS styling
4. Deployment & Hosting
– Vercel CI/CD picks up Git, runs `gatsby build`, and serves static assets via CDN
b. Relationships & data flow
– Data flows into GraphQL layer → injected into page templates → React components render static HTML/CSS/JS
– Build output (public/) → Vercel deployment → end‐user browser
c. Architectural patterns & design principles
– Static Site Generation (SSG)
– Component reuse (Layout wrapper, Modal abstractions)
– Type safety (TypeScript + .d.ts for images)
– Styles co-located with components (SCSS modules)
d. Technologies & frameworks
– Node.js/Gatsby
– React + TypeScript
– SCSS for styling
– Vercel for hosting

## Diagram (Mermaid)

```mermaid
graph TB
    %% Source Layer
    subgraph "Source (Developer Input)"
        direction TB
        Content["Content (Markdown)"]:::input
        GatsbyConfig["gatsby-config.js"]:::input
        GatsbyNode["gatsby-node.js"]:::input
        GatsbyMeta["gatsby-meta-config.js"]:::input
        LayoutComp["Layout Component"]:::input
        ModalSys["Modal System"]:::input
        PresDetail["Presidential Detail Modal"]:::input
        PageComps["Page Components"]:::input
        Templates["Page Templates"]:::input
        TypeDefs["Type Definitions"]:::input
        TSConfig["tsconfig.json"]:::input
    end

    %% Build Layer
    subgraph "Build (Gatsby)"
        direction TB
        Build["Gatsby Build<br>(Plugins & GraphQL)"]:::build
        Static["Static Assets (public/)"]:::build
    end

    %% Deployment & Hosting
    subgraph "Deploy & Hosting"
        direction TB
        Vercel["Vercel CI/CD"]:::hosting
        CDN["CDN"]:::hosting
    end

    %% End User
    Browser["End-User Browser"]:::enduser

    %% Data Flow
    Content --> Build
    GatsbyConfig --> Build
    GatsbyNode --> Build
    GatsbyMeta --> Build
    LayoutComp --> Build
    ModalSys --> Build
    PresDetail --> Build
    PageComps --> Build
    Templates --> Build
    TypeDefs --> Build
    TSConfig --> Build

    Build --> Static
    Static --> Vercel
    Vercel --> CDN
    CDN --> Browser

    %% Click Events
    click Content "https://github.com/yeo11200/gatsby-blog/tree/main/content/"
    click GatsbyConfig "https://github.com/yeo11200/gatsby-blog/blob/main/gatsby-config.js"
    click GatsbyNode "https://github.com/yeo11200/gatsby-blog/blob/main/gatsby-node.js"
    click GatsbyMeta "https://github.com/yeo11200/gatsby-blog/blob/main/gatsby-meta-config.js"
    click LayoutComp "https://github.com/yeo11200/gatsby-blog/blob/main/src/components/Layout/Layout.tsx"
    click ModalSys "https://github.com/yeo11200/gatsby-blog/blob/main/src/components/modal/Modal.tsx"
    click PresDetail "https://github.com/yeo11200/gatsby-blog/blob/main/src/components/modal-type/presidential-detail/presidential-detail.tsx"
    click PageComps "https://github.com/yeo11200/gatsby-blog/blob/main/src/pages/index.tsx"
    click Templates "https://github.com/yeo11200/gatsby-blog/blob/main/src/templates/AboutTemplate.tsx"
    click TypeDefs "https://github.com/yeo11200/gatsby-blog/blob/main/src/types/images.d.ts"
    click TSConfig "https://github.com/yeo11200/gatsby-blog/blob/main/tsconfig.json"
    click Vercel "https://github.com/yeo11200/gatsby-blog/blob/main/vercel.json"

    %% Styles
    classDef input fill:#D0E8FF,stroke:#0366D6,stroke-width:2px
    classDef build fill:#DFFFE0,stroke:#28A745,stroke-width:2px
    classDef hosting fill:#FFEFD0,stroke:#DA8C10,stroke-width:2px
    classDef enduser fill:#F0F0F0,stroke:#6A737D,stroke-width:2px
```
