# itangqiao/blog-astro-gyoza architecture

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

- Interactive diagram: https://gitdiagram.com/itangqiao/blog-astro-gyoza
- Repository: https://github.com/itangqiao/blog-astro-gyoza

## Overview

##### Project Components
- Astro Framework & React: The project uses Astro as the static site generator with React components embedded throughout.
- Frontend (Static + Dynamic): The “src” directory contains most of the application code. This includes components, pages (which are Astro components), layouts, and styles, essentially representing the view layer.
- Content & Configuration: The “src/content” directory holds data like posts, friends, and specification info, while “src/config.json” contains site configurations.
- Plugins: The “src/plugins” directory shows that the project customizes content processing (e.g., code highlighting, embedded media). These transform or enhance Markdown/HTML content.
- Global State Management: The “src/store” directory uses Jotai for managing things such as meta information, theme state, scroll, and viewport data.
- Static Assets & Public Files: The “public” directory hosts fonts, images, and other static files.
- Build & Development Tools: Configuration files like “astro.config.js”, “tailwind.config.ts”, “tsconfig.json”, and package management files indicate tooling for building, testing, and formatting.

##### Architectural Layers and Their Interactions
- Presentation Layer (Frontend):
- Pages (under “src/pages”) define routes such as blog posts, archives, tags, etc.
- Layouts (“src/layouts”) structure the common look across pages.
- UI Components (“src/components”): Subdivide into headers, footers, heroes, modals, posts, articles, etc., which can be React or Astro components.
- Client-Side Interactive Features: Components like “AnimatedSignature”, “ThemeSwitch”, and “ToastContainer” add dynamic behavior.
- Content Management:
- The “src/content” directory holds Markdown and YAML files that serve as the content for the blog.
- Interaction: Pages and components fetch and render this markdown content.
- Plugins in “src/plugins” transform the raw content (for example, code highlighting with rehype plugins, remark plugins, etc.).
- State & Global Data:
- The “src/store” folder holds state management modules (using Jotai) which enable sharing state across components (e.g., theme, modal stack).
- Styling & Presentation:
- Stylesheets in “src/styles” (including Tailwind CSS and custom global CSS) define the styling.
- Build/Configuration:
- Astro config (“astro.config.js”), along with various tsconfig and prettier settings, provide build and style guidelines.
- Scripts in the “scripts” directory might assist in content generation or other post-build tasks.
- Static File Delivery:
- The “public” folder is served directly, providing static assets to the client.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend / Presentation Layer
    subgraph "Frontend / Presentation Layer"
        P["Pages"]:::frontend
        L["Layouts"]:::frontend
        U["UI Components"]:::frontend
    end

    %% Content & Configuration Layer
    subgraph "Content & Configuration"
        CR["Content Repository (Markdown/YAML)"]:::content
        SC["Site Configuration"]:::content
    end

    %% Plugins Layer
    subgraph "Plugins"
        PL["Content Plugins"]:::plugin
    end

    %% Global State Management
    subgraph "Global State Management"
        G["Global State Modules (Jotai)"]:::state
    end

    %% Static Assets & Public Files
    subgraph "Static Assets"
        SA["Static Assets & Public Files"]:::assets
    end

    %% Build & Development Tools
    subgraph "Build & Development Tools"
        B1["Astro Configuration"]:::build
        B2["Styling & Build Configurations"]:::build
    end

    %% Connections
    P -->|"fetches"| CR
    P -->|"reads"| SC
    CR -->|"processedBy"| PL
    PL -->|"suppliesContentTo"| P
    P -->|"composes"| L
    P -->|"rendersWith"| U
    U -->|"usesState"| G
    L -->|"includesAssetsFrom"| SA
    U -->|"includesAssetsFrom"| SA
    B1 -->|"buildsProject"| P
    B2 -->|"stylesPagesAndLayouts"| P & L

    %% Click Events
    click P "https://github.com/itangqiao/blog-astro-gyoza/tree/main/src/pages"
    click L "https://github.com/itangqiao/blog-astro-gyoza/tree/main/src/layouts"
    click U "https://github.com/itangqiao/blog-astro-gyoza/tree/main/src/components"
    click CR "https://github.com/itangqiao/blog-astro-gyoza/tree/main/src/content"
    click SC "https://github.com/itangqiao/blog-astro-gyoza/blob/main/src/config.json"
    click PL "https://github.com/itangqiao/blog-astro-gyoza/tree/main/src/plugins"
    click G "https://github.com/itangqiao/blog-astro-gyoza/tree/main/src/store"
    click SA "https://github.com/itangqiao/blog-astro-gyoza/tree/main/public"
    click B1 "https://github.com/itangqiao/blog-astro-gyoza/blob/main/astro.config.js"
    click B2 "https://github.com/itangqiao/blog-astro-gyoza/blob/main/tailwind.config.ts"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef content fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef plugin fill:#DDA0DD,stroke:#000,stroke-width:1px;
    classDef state fill:#FFB6C1,stroke:#000,stroke-width:1px;
    classDef assets fill:#FFA07A,stroke:#000,stroke-width:1px;
    classDef build fill:#FFD700,stroke:#000,stroke-width:1px;
```
