# 120061203/xsong architecture

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

- Interactive diagram: https://gitdiagram.com/120061203/xsong
- Repository: https://github.com/120061203/xsong

## Overview

##### Project type and purpose
- This is a full-stack, React-based web application built on Next.js (App Router).
- It serves static and dynamic pages (e.g., blog posts from Markdown in content/blog), interactive tools (whiteboard, markdown editor), and common UI (Navbar, Footer, ThemeContext).
- It’s intended to be deployed on Vercel, with automatic font optimization, Tailwind CSS styling, and client-side context.

##### File structure
- Top-level Next.js config & build files: next.config.ts, next.config.deploy.ts, tsconfig.json, package.json, GitHub Actions workflow (/.github/workflows/nextjs.yml).
- app/ directory:
- app/layout.tsx – root layout wrapper (HTML head, global providers)
- app/globals.css & tailwind.config.js – global styling
- app/page.tsx – homepage
- app/about, /projects, /download, /secret, /tools – feature routes, each with its own page.tsx
- app/components – reusable UI (Navbar, Footer, AvatarModal, Breadcrumb, MarkdownEditor)
- app/contexts – React contexts (ThemeContext)
- content/blog – Markdown files for static blog posts.
- CI/CD: .github/workflows/nextjs.yml for build/deploy, CNAME for custom domain.

##### README
- Confirms it’s a create-next-app scaffold with Next.js App Router.
- Mentions development commands and Vercel deployment.

##### Detail
- Every route folder (about, projects, tools/whiteboard) as subcomponents.
- Context Provider wrapping the entire React tree (ThemeContext).
- Global CSS & Tailwind as a styling layer between React and browser.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Client Layer
    subgraph "Client Layer"
        Browser["Browser"]:::ui
    end

    %% Application Layer
    subgraph "Application Layer"
        NextServer["Next.js Server (Node.js)"]:::infra
        subgraph "React App"
            Layout["Root Layout & Global Providers"]:::ui
            ThemeCtx["ThemeContext Provider"]:::ui
            subgraph "Styling Layer"
                GlobalsCSS["globals.css"]:::data
                TailwindConf["tailwind.config.js"]:::data
                PostCSS["postcss.config.js"]:::data
            end
            subgraph "Pages"
                Home["Home Page"]:::ui
                About["About Page"]:::ui
                Projects["Projects Page"]:::ui
                Download["Download Page"]:::ui
                Secret["Secret Page"]:::ui
                ToolsOverview["Tools Overview Page"]:::ui
                subgraph "Whiteboard Tool"
                    WBPage["Whiteboard Page"]:::ui
                    WBLayout["Whiteboard Display Layout"]:::ui
                    WBDisplay["Whiteboard Display Page"]:::ui
                end
            end
            subgraph "Shared UI Components"
                Navbar["Navbar"]:::ui
                Footer["Footer"]:::ui
                AvatarModal["Avatar Modal"]:::ui
                Breadcrumb["Breadcrumb"]:::ui
                MarkdownEditor["Markdown Editor"]:::ui
            end
        end
    end

    %% Data Layer
    subgraph "Data Layer"
        Content["Content Blog (Markdown)"]:::data
        Assets["Static Assets (public/)"]:::data
    end

    %% Configuration & Dependencies
    subgraph "Project Config & Dependencies"
        NextConfig["next.config.ts"]:::infra
        NextDeploy["next.config.deploy.ts"]:::infra
        TSConfig["tsconfig.json"]:::infra
        PackageJSON["package.json"]:::infra
        PackageLock["package-lock.json"]:::infra
        ESLint["eslint.config.mjs"]:::infra
        CNAME["CNAME"]:::infra
        NoJekyll[".nojekyll"]:::infra
        GitIgnore[".gitignore"]:::infra
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        GitHub["GitHub Actions"]:::pipeline
        Vercel["Vercel Deployment"]:::pipeline
        CDN["Vercel CDN"]:::pipeline
    end

    %% External Dependencies
    subgraph "External Services"
        FontCDN["Font CDN (next/font)"]:::infra
        Npm["npm registry"]:::infra
    end

    %% Relationships
    Browser -->|HTTP GET| NextServer
    NextServer -->|serves| Layout
    Layout --> ThemeCtx
    ThemeCtx --> Shared_UI(( )):::hide
    ThemeCtx --> Pages(( )):::hide
    Layout --> Styling_Layer(( )):::hide
    NextServer -->|reads| Content
    NextServer -->|reads| Assets
    NextServer -->|fetch deps| Npm
    Npm -->|provides| NextServer
    GitHub -->|triggers build| Vercel
    Vercel -->|serves via CDN| CDN
    CDN -->|delivers assets| Browser
    NextServer -->|uses config| NextConfig
    NextServer -->|uses config| NextDeploy
    NextServer -->|uses config| TSConfig

    %% Page Routing
    Layout --> Home
    Layout --> About
    Layout --> Projects
    Layout --> Download
    Layout --> Secret
    Layout --> ToolsOverview
    ToolsOverview --> WBPage
    WBPage --> WBLayout
    WBLayout --> WBDisplay

    %% Styling Layer connections
    Layout --> GlobalsCSS
    Layout --> TailwindConf
    Layout --> PostCSS

    %% Shared Components usage
    Layout --> Navbar
    Layout --> Footer
    Layout --> AvatarModal
    Layout --> Breadcrumb
    Layout --> MarkdownEditor

    %% Config to pipeline
    GitHub --> PackageJSON
    GitHub --> PackageLock
    GitHub --> ESLint
    GitHub --> CNAME
    GitHub --> NoJekyll
    GitHub --> GitIgnore

    %% Click Events
    click NextConfig "https://github.com/120061203/xsong/blob/main/next.config.ts"
    click NextDeploy "https://github.com/120061203/xsong/blob/main/next.config.deploy.ts"
    click TSConfig "https://github.com/120061203/xsong/blob/main/tsconfig.json"
    click GitHub "https://github.com/120061203/xsong/blob/main/.github/workflows/nextjs.yml"
    click Layout "https://github.com/120061203/xsong/blob/main/app/layout.tsx"
    click GlobalsCSS "https://github.com/120061203/xsong/blob/main/app/globals.css"
    click TailwindConf "https://github.com/120061203/xsong/blob/main/tailwind.config.js"
    click PostCSS "https://github.com/120061203/xsong/blob/main/postcss.config.js"
    click Home "https://github.com/120061203/xsong/blob/main/app/page.tsx"
    click Home "https://github.com/120061203/xsong/blob/main/app/page.module.css"
    click About "https://github.com/120061203/xsong/blob/main/app/about/page.tsx"
    click Projects "https://github.com/120061203/xsong/blob/main/app/projects/page.tsx"
    click Download "https://github.com/120061203/xsong/blob/main/app/download/page.tsx"
    click Secret "https://github.com/120061203/xsong/blob/main/app/secret/page.tsx"
    click ToolsOverview "https://github.com/120061203/xsong/blob/main/app/tools/page.tsx"
    click WBPage "https://github.com/120061203/xsong/blob/main/app/tools/whiteboard/page.tsx"
    click WBLayout "https://github.com/120061203/xsong/blob/main/app/tools/whiteboard/display/layout.tsx"
    click WBDisplay "https://github.com/120061203/xsong/blob/main/app/tools/whiteboard/display/page.tsx"
    click Navbar "https://github.com/120061203/xsong/blob/main/app/components/Navbar.tsx"
    click Footer "https://github.com/120061203/xsong/blob/main/app/components/Footer.tsx"
    click AvatarModal "https://github.com/120061203/xsong/blob/main/app/components/AvatarModal.tsx"
    click Breadcrumb "https://github.com/120061203/xsong/blob/main/app/components/Breadcrumb.tsx"
    click MarkdownEditor "https://github.com/120061203/xsong/blob/main/app/components/MarkdownEditor.tsx"
    click ThemeCtx "https://github.com/120061203/xsong/blob/main/app/contexts/ThemeContext.tsx"
    click Content "https://github.com/120061203/xsong/blob/main/content/blog/hello-world.md"
    click Assets "https://github.com/120061203/xsong/tree/main/public/"
    click PackageJSON "https://github.com/120061203/xsong/blob/main/package.json"
    click PackageLock "https://github.com/120061203/xsong/blob/main/package-lock.json"
    click ESLint "https://github.com/120061203/xsong/blob/main/eslint.config.mjs"
    click CNAME "https://github.com/120061203/xsong/tree/main/CNAME"
    click NoJekyll "https://github.com/120061203/xsong/blob/main/.nojekyll"
    click GitIgnore "https://github.com/120061203/xsong/blob/main/.gitignore"

    %% Styles
    classDef ui fill:#E0F7FA,stroke:#0288D1,stroke-width:1px
    classDef data fill:#E8F5E9,stroke:#388E3C,stroke-width:1px
    classDef infra fill:#CFD8DC,stroke:#455A64,stroke-width:1px
    classDef pipeline fill:#FFE0B2,stroke:#FB8C00,stroke-width:1px
    classDef hide transparent
```
