# sjoleee/sjoleee-blog architecture

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

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

## Overview

##### Main Components

a. Frontend Layer:
- Next.js Application (Core)
- React Components (src/components)
- Client-side Features (Theme, Search, Comments)

b. Content Management Layer:
- ContentLayer Integration
- MDX Processing
- Static Assets

c. Build & Configuration Layer:
- Next.js Config
- Tailwind CSS
- TypeScript
- ESLint/Prettier

##### Key Architectural Elements

**┌─ Client Layer ─────────────────────┐**
- Next.js Pages & App Router       │
- React Components                 │
- Client-side Features            │
- ┬───────────────────┘

**┌───────────────▼───────────────────┐**
- Content Processing Layer           │
- ContentLayer                     │
- MDX Processing                   │
- Image Processing                 │
- ┬───────────────────┘

**┌───────────────▼───────────────────┐**
- Static Assets & Build              │
- Public Assets                    │
- Build Configuration             │
- Styling (Tailwind)              │
- ┘

##### Data Flow Indicators

- Content flow from MDX files to rendered pages
- Theme state management
- Search functionality
- Comment system integration

##### Key Features to Highlight

- App Router structure (/src/app)
- Component organization (/src/components)
- Content management (/src/content)
- Static asset handling (/public)
- Build configuration (next.config.js, tailwind.config.ts)

##### Integration Points

Connections for:
- Giscus comments integration
- Theme switching mechanism
- Search functionality
- MDX content processing

##### Development Tools

A section for:
- TypeScript configuration
- ESLint/Prettier setup
- Template generation (_templates)

##### Build and deployment flow

This architecture represents a modern static blog with enhanced features like theme switching, search, and comments, built on Next.js with strong TypeScript integration and robust content management through ContentLayer.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        NextApp["Next.js Application Core"]:::client
        ReactComps["React Components"]:::client
        ThemeSystem["Theme System"]:::client
        Search["Search Functionality"]:::client
        Comments["Comment System"]:::client
        Layout["Layout Components"]:::client
        Routes["Routing Structure"]:::client
    end

    subgraph Content
        ContentLayer["ContentLayer Integration"]:::content
        MDXContent["MDX Content"]:::content
        MDXComps["MDX Components"]:::content
    end

    subgraph Build
        NextConfig["Next.js Config"]:::build
        TailwindConfig["Tailwind Config"]:::build
        TSConfig["TypeScript Config"]:::build
        Linting["ESLint/Prettier"]:::build
        Assets["Static Assets"]:::build
    end

    ContentLayer --> NextApp
    MDXContent --> ContentLayer
    MDXComps --> ContentLayer
    
    NextApp --> ReactComps
    NextApp --> Layout
    NextApp --> Routes
    
    ReactComps --> ThemeSystem
    ReactComps --> Search
    ReactComps --> Comments
    
    TailwindConfig --> NextApp
    NextConfig --> NextApp
    TSConfig --> NextApp
    Linting --> NextApp
    Assets --> NextApp

    %% Click Events
    click NextApp "https://github.com/sjoleee/sjoleee-blog/tree/main/src/app"
    click ReactComps "https://github.com/sjoleee/sjoleee-blog/tree/main/src/components"
    click ThemeSystem "https://github.com/sjoleee/sjoleee-blog/tree/main/src/components/ThemeProvider"
    click Search "https://github.com/sjoleee/sjoleee-blog/tree/main/src/components/Search"
    click Comments "https://github.com/sjoleee/sjoleee-blog/tree/main/src/components/Comments"
    click ContentLayer "https://github.com/sjoleee/sjoleee-blog/blob/main/contentlayer.config.ts"
    click MDXContent "https://github.com/sjoleee/sjoleee-blog/tree/main/src/content/posts"
    click Assets "https://github.com/sjoleee/sjoleee-blog/tree/main/public"
    click NextConfig "https://github.com/sjoleee/sjoleee-blog/blob/main/next.config.js"
    click TailwindConfig "https://github.com/sjoleee/sjoleee-blog/blob/main/tailwind.config.ts"
    click TSConfig "https://github.com/sjoleee/sjoleee-blog/blob/main/tsconfig.json"
    click Linting "https://github.com/sjoleee/sjoleee-blog/blob/main/.eslintrc.js"
    click MDXComps "https://github.com/sjoleee/sjoleee-blog/tree/main/src/components/Mdx"
    click Layout "https://github.com/sjoleee/sjoleee-blog/blob/main/src/app/layout.tsx"
    click Routes "https://github.com/sjoleee/sjoleee-blog/tree/main/src/app/[category]"

    %% Styles
    classDef client fill:#3b82f6,color:#fff
    classDef content fill:#22c55e,color:#fff
    classDef build fill:#f97316,color:#fff

    %% Legend
    subgraph Legend
        ClientLegend["Client Layer"]:::client
        ContentLegend["Content Layer"]:::content
        BuildLegend["Build Layer"]:::build
    end
```
