# willismax/my-site architecture

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

- Interactive diagram: https://gitdiagram.com/willismax/my-site
- Repository: https://github.com/willismax/my-site

## Overview

##### Project type and purpose
- This is a static website built with Docusaurus 2. It’s not a full-stack app with a dynamic backend; rather, it’s a static site generator that transforms Markdown/MDX content (blog posts, docs, pages) plus React components into plain HTML/CSS/JS and deploys it, typically to GitHub Pages.

##### File structure
- Top-level files:
- package.json, yarn.lock, babel.config.js – define Node.js-based dev/build environment
- docusaurus.config.js, sidebars.js – configure site metadata, navigation, theme
- .github/workflows/deploy.yml – CI/CD pipeline
- Content directories:
- /blog and /docs – Markdown/MDX source for blog posts and documentation
- /src/pages, /src/components – custom React pages and reusable UI parts
- /static – static assets (images, robots.txt, etc.) served as-is
- Output:
- build (generated after `yarn build`) – static HTML/CSS/JS ready for hosting

##### README for insights
- Key commands:
- yarn start → launches a local development server with hot reload
- yarn build → compiles everything into the build folder
- yarn deploy → runs build and pushes build output to gh-pages branch via SSH/GitHub Pages

##### Main components & interactions
a. Developer environment
- Local machine running Node.js
- Code editor saving Markdown/MDX and React JSX in /blog, /docs, /src
- `yarn start` → local dev server (Webpack + Docusaurus) serves live preview
b. Version control & CI/CD
- GitHub repo stores all source files + config
- Push to main branch triggers GitHub Actions (deploy.yml)
c. Build process
- Actions runner checks out code → installs deps (yarn) → runs `yarn build`
- Docusaurus parses content directories, applies React components, plugins, theme → outputs build/
d. Hosting
- build/ assets are published to gh-pages branch → served by GitHub Pages at CNAME domain

##### Architectural patterns & design principles
- Single‐page‐app shell blended with statically generated routes
- Separation of concerns:
- Content (Markdown)
- Presentation (React components + CSS modules)
- Configuration (docusaurus.config.js, sidebars.js)
- CI/CD-as-code: GitHub Actions fully automates build & deploy

##### How
- Contains: /blog, /docs, /src, config files, package.json, .github/workflows
- Trigger: commit to main
- Steps: checkout → yarn install → yarn build → yarn deploy
- Outputs → build artifacts into gh-pages branch
- Serves static content from gh-pages
- HTTP GET → GitHub Pages → HTML/CSS/JS

- Dev → GitHub repo (commit/push)
- Repo → GitHub Actions (webhook trigger)
- Actions → Docusaurus Build → build/
- Actions → Deploy → gh-pages
- Browser ← GitHub Pages

##### Be detailed but concise
- Architectural element: source files, build config, build output, CI pipeline, hosting layer.
- Interactions and data transformations (Markdown/MDX + React → static HTML/CSS/JS).
- Don’t over-segment: grouping by logical role (content, build, deploy, serve) is sufficient.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Environment"
        Dev("Developer Machine"):::frontend
    end

    %% Source Control
    subgraph "GitHub Repository"
        Repo("GitHub Repo"):::repo
        docs("Documentation Content (/docs)"):::repo
        blog("Blog Content (/blog)"):::repo
        docusaurus("docusaurus.config.js"):::repo
        sidebars("sidebars.js"):::repo
        babel("babel.config.js"):::repo
        package("package.json"):::repo
        components("/src/components"):::repo
        pages("/src/pages"):::repo
        css("/src/css"):::repo
        static("/static"):::repo
        workflow(".github/workflows/deploy.yml"):::repo
        cname("CNAME"):::repo
    end

    %% CI/CD
    subgraph "CI/CD Pipeline"
        Actions("GitHub Actions CI"):::ci
    end

    %% Build Engine
    Build("Docusaurus Build Engine"):::build

    %% Hosting and Users
    Host("GitHub Pages Host"):::host
    User("End-User Browser"):::frontend

    %% Connections
    Dev -->|"edits & commits"| Repo
    Dev -->|"runs yarn start (local dev server)"| Build
    Repo -->|"push triggers"| Actions
    Actions -->|"checkout & yarn install"| Build
    Actions -->|"yarn build"| Build
    Actions -->|"yarn deploy to gh-pages"| Host
    Build -->|"build output"| Host
    User -->|"HTTP GET"| Host

    %% Click Events
    click Repo "https://github.com/willismax/my-site/tree/main/./"
    click docs "https://github.com/willismax/my-site/tree/main//docs"
    click blog "https://github.com/willismax/my-site/tree/main//blog"
    click docusaurus "https://github.com/willismax/my-site/blob/main/docusaurus.config.js"
    click sidebars "https://github.com/willismax/my-site/blob/main/sidebars.js"
    click babel "https://github.com/willismax/my-site/blob/main/babel.config.js"
    click package "https://github.com/willismax/my-site/blob/main/package.json"
    click components "https://github.com/willismax/my-site/tree/main//src/components"
    click pages "https://github.com/willismax/my-site/tree/main//src/pages"
    click css "https://github.com/willismax/my-site/tree/main//src/css"
    click static "https://github.com/willismax/my-site/tree/main//static"
    click workflow "https://github.com/willismax/my-site/blob/main/.github/workflows/deploy.yml"
    click cname "https://github.com/willismax/my-site/tree/main/CNAME"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,stroke-width:1px;
    classDef repo fill:#E6FFED,stroke:#28a745,stroke-width:1px;
    classDef ci fill:#FFE8D0,stroke:#d15704,stroke-width:1px;
    classDef build fill:#F0F0F0,stroke:#6a737d,stroke-width:1px;
    classDef host fill:#F5E6FF,stroke:#6f42c1,stroke-width:1px;
```
