# neobrutalism-templates/blog architecture

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

- Interactive diagram: https://gitdiagram.com/neobrutalism-templates/blog
- Repository: https://github.com/neobrutalism-templates/blog

## Overview

##### Main System Components

a) Static Site Generator (Astro)
- This is the foundation of the system
- Handles both build-time and client-side operations

b) Content Layer
- Located in `/src/content`
- Manages blog posts in MD/MDX format
- Content configuration system

c) Component Layer
- Located in `/src/components`
- Contains reusable UI components
- Mix of Astro (.astro) and React (.tsx) components

d) Routing Layer
- Located in `/src/pages`
- Handles dynamic and static routes
- Includes tag-based navigation

**[Build Time]                          [Runtime]**

- Content Layer  |
- (MD/MDX Files) |

- ↓

- Astro Builder  | → → | Static Assets   | → → | Browser/Client   |
- (HTML/CSS/JS)   |     | - Theme Switching|
- ↓             +-----------------+     | - Navigation     |

- Components     |
- Astro        |
- React        |

##### Key Relationships to Highlight

a) Build-time Flow:
- Content processing (MD/MDX → HTML)
- Component compilation
- Static route generation
- Style processing (Tailwind CSS)

b) Runtime Flow:
- Client-side navigation
- Theme switching functionality
- Tag-based filtering

##### Configuration Flow

Configuration dependencies:
- astro.config.mjs
- tailwind.config.mjs
- src/config.ts
- Content configuration

- Build-time vs. Runtime processes
- Static vs. Dynamic components
- Content management vs. UI components

Remember to:
- Static site generation aspect

This structure accurately represents the project's architecture while maintaining clarity about its static-first, content-focused nature.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Build["Build Time Process"]
        Config["Configuration Layer"]
        Content["Content Layer"]
        Components["Component Layer"]
        Layout["Layout System"]
        Router["Routing Layer"]
        Builder["Astro Builder"]
    end

    subgraph Runtime["Runtime Process"]
        Static["Static Assets"]
        Client["Browser/Client"]
        Theme["Theme System"]
    end

    %% Content Layer
    Content --> |"Process"| Builder
    click Content "https://github.com/neobrutalism-templates/blog/tree/main//src/content"
    ContentConfig["Content Config"]:::config --> Content
    click ContentConfig "https://github.com/neobrutalism-templates/blog/blob/main//src/content/config.ts"
    Posts["MD/MDX Posts"]:::content --> Content
    click Posts "https://github.com/neobrutalism-templates/blog/tree/main//src/content/posts"

    %% Configuration
    Config --> Builder
    AstroConfig["astro.config.mjs"]:::config --> Config
    click AstroConfig "https://github.com/neobrutalism-templates/blog/blob/main/astro.config.mjs"
    TailwindConfig["tailwind.config.mjs"]:::config --> Config
    click TailwindConfig "https://github.com/neobrutalism-templates/blog/blob/main/tailwind.config.mjs"
    TSConfig["tsconfig.json"]:::config --> Config
    click TSConfig "https://github.com/neobrutalism-templates/blog/blob/main/tsconfig.json"
    ProjectConfig["Project Config"]:::config --> Config
    click ProjectConfig "https://github.com/neobrutalism-templates/blog/blob/main//src/config.ts"

    %% Component Layer
    Components --> Builder
    BaseHead["BaseHead"]:::component --> Components
    click BaseHead "https://github.com/neobrutalism-templates/blog/blob/main//src/components/BaseHead.astro"
    Footer["Footer"]:::component --> Components
    click Footer "https://github.com/neobrutalism-templates/blog/blob/main//src/components/Footer.astro"
    Nav["Navigation"]:::component --> Components
    click Nav "https://github.com/neobrutalism-templates/blog/blob/main//src/components/Nav.astro"
    PostInfo["Post Info"]:::component --> Components
    click PostInfo "https://github.com/neobrutalism-templates/blog/blob/main//src/components/PostInfo.astro"
    PostPreview["Post Preview"]:::component --> Components
    click PostPreview "https://github.com/neobrutalism-templates/blog/blob/main//src/components/PostPreview.astro"

    %% Layout System
    Layout --> Builder
    BaseLayout["Base Layout"]:::layout --> Layout
    click BaseLayout "https://github.com/neobrutalism-templates/blog/blob/main//src/layouts/Base.astro"
    BlogPost["Blog Post Layout"]:::layout --> Layout
    click BlogPost "https://github.com/neobrutalism-templates/blog/blob/main//src/layouts/BlogPost.astro"

    %% Routing Layer
    Router --> Builder
    HomePage["Home Page"]:::route --> Router
    click HomePage "https://github.com/neobrutalism-templates/blog/blob/main//src/pages/index.astro"
    BlogSlug["Blog Slug"]:::route --> Router
    click BlogSlug "https://github.com/neobrutalism-templates/blog/blob/main//src/pages/[...slug].astro"
    TagPage["Tag Page"]:::route --> Router
    click TagPage "https://github.com/neobrutalism-templates/blog/blob/main//src/pages/tags/[tag].astro"
    TagIndex["Tags Index"]:::route --> Router
    click TagIndex "https://github.com/neobrutalism-templates/blog/blob/main//src/pages/tags/index.astro"

    %% Build Process
    Builder --> Static

    %% Runtime Process
    Static --> Client
    ThemeSwitcher["Theme Switcher"]:::runtime --> Theme
    click ThemeSwitcher "https://github.com/neobrutalism-templates/blog/blob/main//src/components/ThemeSwitcher.tsx"
    Theme --> Client
    GlobalStyles["Global Styles"]:::styles --> Client
    click GlobalStyles "https://github.com/neobrutalism-templates/blog/blob/main//src/global.css"

    %% Styling
    classDef config fill:#f9f,stroke:#333
    classDef content fill:#aaf,stroke:#333
    classDef component fill:#afa,stroke:#333
    classDef layout fill:#ffa,stroke:#333
    classDef route fill:#faa,stroke:#333
    classDef runtime fill:#aff,stroke:#333
    classDef styles fill:#faf,stroke:#333

    %% Legend
    subgraph Legend
        L1["Configuration"]:::config
        L2["Content"]:::content
        L3["Component"]:::component
        L4["Layout"]:::layout
        L5["Route"]:::route
        L6["Runtime"]:::runtime
        L7["Styles"]:::styles
    end
```
