# gezhiheng/henrys-blog architecture

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

- Interactive diagram: https://gitdiagram.com/gezhiheng/henrys-blog
- Repository: https://github.com/gezhiheng/henrys-blog

## Overview

The project is a personal blog built using VitePress—a static site generator primarily used for documentation and blogs. The file tree and README provide clear guidance that this is a content-driven website with custom theming, automated utilities, and CI/CD deployment scripts.

##### Main components
- Content & Documentation:
- The “docs” directory contains various Markdown files for posts, tutorials, experiences, and study notes.
- The “index.md” file likely acts as the landing page.
- Custom VitePress Configuration & Theming:
- The “.vitepress” directory holds configuration files (config.mjs, sidebar.js) and theme customizations (Layout.vue, ProjectCard.vue, custom.css, etc.).
- Assets & Public Files:
- The “assets” directory (and subfolders under “public/assets”) store fonts, images, and other media.
- Utility Scripts:
- Files in the “utils” folder (e.g., genContents.js and genRecentPosts.js) suggest automated content generation or updates for recent posts.
- Build & Dependency Management:
- “package.json” and “package-lock.json” manage dependencies and script commands related to VitePress.
- CI/CD Pipeline:
- The “.github/workflows/deploy.yml” indicates an automated deployment process (likely triggered on pushes or PR merges).
- Ancillary Files:
- “info.txt”, “LICENSE”, and “README.md” contain meta-information, licensing, and project guidelines.

##### Relationships & Data Flow
- The VitePress engine uses configuration files from “.vitepress/config.mjs” and “.vitepress/theme” to parse Markdown content from “docs” and “index.md”, converting them into HTML.
- Static assets (in “assets” and “public”) are referenced within the content and theme, maintaining a cohesive visual identity.
- Utility scripts read or process content (possibly updating navigation, generating recent posts) and feed data to VitePress during the build process.
- Deployment is automated through the GitHub Actions workflow defined in “.github/workflows/deploy.yml” that takes the built static files and deploys them to the appropriate hosting service.

##### Architectural Patterns & Design Principles
- Modular Design: Separation of content (docs, index.md), presentation (theme files under .vitepress/theme), and business logic (utility scripts).
- Static Site Generation: Using VitePress to transform Markdown content into static HTML, optimizing loading speeds and reliability.
- Automated Deployment: CI/CD integration ensures that content changes are automatically built and deployed.
- Customizability: The use of a custom theme and configuration allows for a personalized look and feel for the blog.

##### Relevant Technologies & Tools
- VitePress: Core static site generator.
- Node.js & NPM: Dependency management and build tools.
- GitHub Actions: Workflow automation for deployment.
- VitePress Theme Components: Vue components (e.g., Layout.vue and ProjectCard.vue) that structure the site’s UI.
- CSS & Fonts: Custom styling files (custom.css, fonts.css) and assets from the assets directory.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Content & Documentation"
        Docs["Docs (Markdown Files)"]:::content
        Landing["Landing Page (index.md)"]:::content
    end

    subgraph "Custom VitePress Configuration & Theming"
        Config["VitePress Config & Theme (.vitepress)"]:::config
    end

    subgraph "Assets & Public Files"
        Assets["Assets Directory (assets)"]:::assets
        PubAssets["Public Assets (public/assets)"]:::assets
    end

    subgraph "Utility Scripts"
        Utils["Utility Scripts (utils: genContents.js, genRecentPosts.js)"]:::utils
    end

    subgraph "Build & Dependency Management"
        Package["package.json & package-lock.json"]:::build
    end

    subgraph "CI/CD Pipeline"
        CICD["Deployment Workflow (.github/workflows/deploy.yml)"]:::cicd
    end

    subgraph "Ancillary Files"
        Ancillary["Ancillary Files (README.md, LICENSE, info.txt)"]:::ancillary
    end

    subgraph "VitePress Build Engine"
        Build["VitePress Build Process"]:::engine
    end

    Hosting["Hosting Service (Deployed Site)"]:::hosting

    Docs -->|"parse"| Build
    Landing -->|"parse"| Build
    Config -->|"load"| Build
    Assets -->|"integrate"| Build
    PubAssets -->|"integrate"| Build
    Utils -->|"generate"| Build
    Package -->|"manage"| Build
    CICD -->|"trigger"| Build
    Build -->|"deploy"| Hosting

    click Docs "https://github.com/gezhiheng/henrys-blog/tree/main/docs"
    click Landing "https://github.com/gezhiheng/henrys-blog/blob/main/index.md"
    click Config "https://github.com/gezhiheng/henrys-blog/blob/main/.vitepress"
    click Assets "https://github.com/gezhiheng/henrys-blog/tree/main/assets"
    click PubAssets "https://github.com/gezhiheng/henrys-blog/tree/main/public/assets"
    click Utils "https://github.com/gezhiheng/henrys-blog/tree/main/utils"
    click Package "https://github.com/gezhiheng/henrys-blog/blob/main/package.json"
    click CICD "https://github.com/gezhiheng/henrys-blog/blob/main/.github/workflows/deploy.yml"
    click Ancillary "https://github.com/gezhiheng/henrys-blog/blob/main/README.md"

    classDef content fill:#ffe0b2,stroke:#ff9800,stroke-width:2px;
    classDef config fill:#bbdefb,stroke:#1976d2,stroke-width:2px;
    classDef assets fill:#d1c4e9,stroke:#7e57c2,stroke-width:2px;
    classDef utils fill:#ffcdd2,stroke:#e57373,stroke-width:2px;
    classDef build fill:#fff9c4,stroke:#fbc02d,stroke-width:2px;
    classDef cicd fill:#b2dfdb,stroke:#00796b,stroke-width:2px;
    classDef ancillary fill:#f0f4c3,stroke:#afb42b,stroke-width:2px;
    classDef engine fill:#c8e6c9,stroke:#388e3c,stroke-width:2px;
    classDef hosting fill:#d7ccc8,stroke:#8d6e63,stroke-width:2px;
```
