# cdcasey/cdcasey-dev architecture

> Architecture diagram of the GitHub repository cdcasey/cdcasey-dev, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cdcasey/cdcasey-dev
- Repository: https://github.com/cdcasey/cdcasey-dev

## Overview

##### Main Components

a) Static Site Generation Layer
- Gatsby Core (central component)
- Build Process
- GraphQL Data Layer

b) Content Management
- MDX/Markdown Content Structure
- Static Assets (images)

c) React Application Structure
- Components
- Templates
- Pages
- Hooks

##### Build-time Flow
- How content flows from MDX/Markdown files to Gatsby's GraphQL layer
- How Gatsby transforms this into static HTML/CSS/JS
- Demonstrate template application to content

##### Runtime Flow
- Client-side React hydration
- Component hierarchy
- Routing system

##### Specific Implementation Details

- Hexagons for templates (src/templates)
- Rounded rectangles for utility functions (src/utils)

##### Architecture Layers (top to bottom)

**Client Layer**
- Browser Runtime
- React Hydration
- Client-side Navigation

**Static Generation Layer**
- Gatsby Build Process
- GraphQL Data Layer
- Template Processing

**Content Layer**
- MDX/Markdown Files
- Static Assets

##### Important Connections

- gatsby-node.js → template creation
- gatsby-config.js → site configuration
- gatsby-browser.js → browser runtime modifications
- root-wrapper.js → global component wrapping

##### Development Tools Integration
- ESLint/Prettier configuration
- GitHub Actions workflow
- TypeScript compilation

- Version/date information
- Third-party service integrations

Remember to:
- Use consistent styling
- A high-level overview and detailed subdiagrams if necessary
- Document any non-obvious architectural decisions

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Browser Runtime"]
        ReactHydration["React Hydration"]
        ClientNav["Client-side Navigation"]
    end

    subgraph StaticGen["Static Generation Layer"]
        GatsbyCore["Gatsby Core"]
        GraphQL["GraphQL Data Layer"]
        BuildProcess["Build Process"]
        
        subgraph CoreConfig["Core Configuration"]
            GConfig["gatsby-config.js"]
            GNode["gatsby-node.js"]
            GBrowser["gatsby-browser.js"]
            GSSR["gatsby-ssr.js"]
            RootWrapper["root-wrapper.js"]
        end
    end

    subgraph Content["Content Management"]
        MDX["MDX/Markdown Files"]
        StaticAssets["Static Assets"]
    end

    subgraph React["React Application"]
        subgraph Components
            Layout["Layout Component"]
            Header["Header Component"]
            ArticleListing["Article Listing"]
        end
        
        subgraph Templates
            BlogPost["Blog Post Template"]
            Tags["Tags Template"]
        end
        
        subgraph Hooks
            SiteMetadata["Site Metadata Hook"]
        end
        
        subgraph Utils
            Typography["Typography System"]
            Clipboard["Copy to Clipboard"]
        end
    end

    subgraph DevTools["Development Tools"]
        ESLint["ESLint Config"]
        Prettier["Prettier Config"]
        TypeScript["TypeScript Config"]
        GHActions["GitHub Actions"]
    end

    %% Relationships
    MDX --> GraphQL
    StaticAssets --> GraphQL
    GraphQL --> BuildProcess
    BuildProcess --> GatsbyCore
    GatsbyCore --> ReactHydration
    ReactHydration --> Browser
    Templates --> BuildProcess
    Components --> ReactHydration
    Hooks --> Components
    Utils --> Components

    %% Click Events
    click GConfig "https://github.com/cdcasey/cdcasey-dev/blob/main/gatsby-config.js"
    click GNode "https://github.com/cdcasey/cdcasey-dev/blob/main/gatsby-node.js"
    click GBrowser "https://github.com/cdcasey/cdcasey-dev/blob/main/gatsby-browser.js"
    click GSSR "https://github.com/cdcasey/cdcasey-dev/blob/main/gatsby-ssr.js"
    click RootWrapper "https://github.com/cdcasey/cdcasey-dev/blob/main/root-wrapper.js"
    click MDX "https://github.com/cdcasey/cdcasey-dev/tree/main/content"
    click StaticAssets "https://github.com/cdcasey/cdcasey-dev/tree/main/static/images"
    click Components "https://github.com/cdcasey/cdcasey-dev/tree/main/src/components"
    click Templates "https://github.com/cdcasey/cdcasey-dev/tree/main/src/templates"
    click BlogPost "https://github.com/cdcasey/cdcasey-dev/blob/main/src/templates/blogPostTemplate.tsx"
    click Tags "https://github.com/cdcasey/cdcasey-dev/blob/main/src/templates/tags.tsx"
    click Layout "https://github.com/cdcasey/cdcasey-dev/blob/main/src/components/Layout.tsx"
    click Header "https://github.com/cdcasey/cdcasey-dev/blob/main/src/components/Header.tsx"
    click ArticleListing "https://github.com/cdcasey/cdcasey-dev/blob/main/src/components/ArticleListing.tsx"
    click Typography "https://github.com/cdcasey/cdcasey-dev/blob/main/src/utils/typography.js"
    click Clipboard "https://github.com/cdcasey/cdcasey-dev/blob/main/src/utils/copy-to-clipboard.js"
    click ESLint "https://github.com/cdcasey/cdcasey-dev/blob/main/.eslintrc.js"
    click Prettier "https://github.com/cdcasey/cdcasey-dev/blob/main/.prettierrc.js"
    click TypeScript "https://github.com/cdcasey/cdcasey-dev/blob/main/tsconfig.json"
    click GHActions "https://github.com/cdcasey/cdcasey-dev/blob/main/.github/workflows/codeql-analysis.yml"
    click SiteMetadata "https://github.com/cdcasey/cdcasey-dev/blob/main/src/hooks/useSiteMetadata.js"
    click Hooks "https://github.com/cdcasey/cdcasey-dev/tree/main/src/hooks"

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px;
    classDef config fill:#e1f5fe,stroke:#0288d1;
    classDef content fill:#e8f5e9,stroke:#388e3c;
    classDef component fill:#fff3e0,stroke:#f57c00;
    classDef util fill:#f3e5f5,stroke:#7b1fa2;
    classDef dev fill:#fbe9e7,stroke:#d84315;

    class GConfig,GNode,GBrowser,GSSR,RootWrapper config;
    class MDX,StaticAssets content;
    class Layout,Header,ArticleListing,BlogPost,Tags component;
    class Typography,Clipboard util;
    class ESLint,Prettier,TypeScript,GHActions dev;
```
