# atqq/sugar-blog architecture

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

- Interactive diagram: https://gitdiagram.com/atqq/sugar-blog
- Repository: https://github.com/atqq/sugar-blog

## Overview

##### Main System Components

a. Core Components:
- Blogpress (Main Blog Application)
- Theme Package (@sugarat/theme)
- Shared Utilities (@sugarat/theme-shared)
- Theme Creator (@sugarat/create-theme)
- VitePress Plugins Collection

b. Plugin Components:
- Pagefind Plugin (Search functionality)
- RSS Plugin
- 51la Plugin (Analytics)
- Announcement Plugin
- Plugin Template

**┌─────────────────────────────────────────────┐**
- Blogpress                  │
- ┤
- @sugarat/theme                 │
- ┤
- @sugarat/theme-shared             │
- ┘

**┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐**
- Pagefind │ │   RSS    │ │   51la   │ │Announce- │
- Plugin  │ │  Plugin  │ │  Plugin  │ │  ment    │
- ┘ └──────────┘ └──────────┘ └──────────┘

##### Key Relationships to Highlight

a. Dependencies:
- How the theme package depends on shared utilities
- Plugin integration points with the main theme
- Demonstrate the content flow from blogpress through the theme

b. Data Flow:
- Content rendering pipeline
- Search functionality flow
- Analytics data collection
- RSS feed generation

##### Component Details

For each major component, include:
- Input/Output relationships
- Key configurations
- Integration points
- File structure organization

##### Technical Stack Indicators

- VitePress
- Vue.js
- Node.js
- Markdown processing
- Build tools (pnpm)

##### Development Workflow

Build and deployment process:
**Source → Build → Deploy → Serve**

##### Notes for Implementation

- Maintain consistent styling throughout
- Version information
- Document external service dependencies
- Scaling points

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core
        Blog["Blogpress"]
        Theme["@sugarat/theme"]
        Shared["@sugarat/theme-shared"]
        Creator["Theme Creator"]
    end

    subgraph Plugins
        direction TB
        Search["Pagefind Plugin"]
        RSS["RSS Plugin"]
        Analytics["51la Plugin"]
        Announce["Announcement Plugin"]
        Template["Plugin Template"]
    end

    %% Core relationships
    Blog --> Theme
    Theme --> Shared
    Creator --> Theme

    %% Plugin integrations
    Theme --> Search
    Theme --> RSS
    Theme --> Analytics
    Theme --> Announce
    Template -.-> Theme

    %% Data flow
    Search --> Content[("Content Search")]
    RSS --> Feed[("RSS Feed")]
    Analytics --> Metrics[("Analytics Data")]
    Announce --> Notice[("Announcements")]

    %% Styling
    classDef core fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef plugin fill:#90EE90,stroke:#333,stroke-width:2px
    classDef data fill:#FFB6C1,stroke:#333,stroke-width:2px

    class Blog,Theme,Shared,Creator core
    class Search,RSS,Analytics,Announce,Template plugin
    class Content,Feed,Metrics,Notice data

    %% Click events
    click Blog "https://github.com/ATQQ/sugar-blog/tree/master/packages/blogpress"
    click Theme "https://github.com/ATQQ/sugar-blog/tree/master/packages/theme"
    click Shared "https://github.com/ATQQ/sugar-blog/tree/master/packages/shared"
    click Creator "https://github.com/ATQQ/sugar-blog/tree/master/packages/create-theme"
    click Search "https://github.com/ATQQ/sugar-blog/tree/master/packages/vitepress-plugin-pagefind"
    click RSS "https://github.com/ATQQ/sugar-blog/tree/master/packages/vitepress-plugin-rss"
    click Analytics "https://github.com/ATQQ/sugar-blog/tree/master/packages/vitepress-plugin-51la"
    click Announce "https://github.com/ATQQ/sugar-blog/tree/master/packages/vitepress-plugin-announcement"
    click Template "https://github.com/ATQQ/sugar-blog/tree/master/template/vitepress-plugin-slot-inject-template"
```
