# yubeenpark/sulleongsulleong architecture

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

- Interactive diagram: https://gitdiagram.com/yubeenpark/sulleongsulleong
- Repository: https://github.com/yubeenpark/sulleongsulleong

## Overview

##### Project type and purpose
- This is a front-end single-page application (SPA) template built with React, TypeScript, and Vite.
- It provides a minimal dev environment with hot module replacement (HMR), ESLint rules, and two official Fast-Refresh plugins (Babel or SWC).

##### File structure
- Top-level:
- package.json / package-lock.json – npm dependencies and scripts
- tsconfig.json / tsconfig.node.json – TypeScript compilation settings
- vite.config.ts – Vite build and dev server configuration
- .eslintrc.cjs – ESLint rules
- public/ – static assets and index.html
- src/ – application source code (App.tsx, main.tsx, CSS and type definitions)
- No backend or database directories—pure front-end architecture.

##### README for additional insights
- Explains how to switch between Babel-based or SWC-based React Fast Refresh plugins.
- Recommends ESLint enhancements for production: type-aware lint rules, react plugin.

##### Main components
a. Developer workstation
- Node.js + npm
- IDE / code editor
- Local file system (project files)
b. Build & Dev pipeline
- Vite Dev Server
- Fast-Refresh plugin (@vitejs/plugin-react or @vitejs/plugin-react-swc)
- TypeScript compiler
- ESBuild (or SWC) bundler
- ESLint
c. Static assets
- public/index.html
d. Runtime (client)
- Web browser executing the React application
e. Production hosting
- Static file server or CDN (serves the output of `vite build`)

##### Relationships and data flows
- Developer edits source → ESLint and TS check in IDE
- On `npm run dev`: Vite Dev Server reads src/ + public/, runs TS → ESBuild/SWC → serves JS bundle with HMR
- Browser connects to dev server over WebSocket for HMR updates; displays React UI
- On `npm run build`: Vite bundles optimized static assets → output in dist/
- Production server/CDN serves the dist/ folder to end users

##### Architectural patterns and design principles
- Modular front-end architecture: separation between application code (src/) and public assets (public/)
- Pluggable build pipeline: Vite plugins for React, HMR, linting
- Single responsibility: each tool does one thing (TS for typing, ESLint for linting, Vite for bundling/dev server)

##### Essential elements
- Clear labels on every component (e.g., “@vitejs/plugin-react,” “TypeScript Compiler”)
- Arrowheads showing flow direction (dev → build → runtime)
- Blue for developer tools
- Green for build pipeline
- Orange for runtime
- Gray for hosting/infrastructure

##### Final advice
- Be detailed: break the build pipeline into each plugin/tool rather than lumping as “bundler.”
- HMR feedback loop between Vite and the Browser.
- Both dev and production flows side by side for clarity.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Environment
    subgraph "Developer Environment"
        DevNode["Node.js + npm"]:::dev
        IDE["IDE / Code Editor"]:::dev
        subgraph "Local File System"
            PackageJSON["package.json"]:::code
            PackageLock["package-lock.json"]:::code
            TSConfig1["tsconfig.json"]:::code
            TSConfig2["tsconfig.node.json"]:::code
            ViteConfig["vite.config.ts"]:::code
            ESLintConfig[".eslintrc.cjs"]:::code
            subgraph "public/"
                IndexHTML["index.html"]:::code
                PublicAssets["assets / icons / manifest"]:::code
            end
            subgraph "src/"
                AppTS["App.tsx"]:::code
                MainTS["main.tsx"]:::code
                AppCSS["App.css"]:::code
                IndexCSS["index.css"]:::code
                ViteEnv["vite-env.d.ts"]:::code
            end
            Readme["README.md"]:::code
            IssueTemp[".github/ISSUE_TEMPLATE/"]:::code
        end
    end

    %% Build & Dev Pipeline
    subgraph "Build & Dev Pipeline"
        ESLint["ESLint"]:::build
        TSCompiler["TypeScript Compiler"]:::build
        ViteDev["Vite Dev Server"]:::build
        FastRefresh["@vitejs/plugin-react / @vitejs/plugin-react-swc"]:::build
        Bundler["ESBuild / SWC"]:::build
    end

    %% Runtime
    Browser("Web Browser"):::runtime

    %% Production Hosting
    subgraph "Production Hosting"
        Dist["dist/"]:::infra
        CDN("CDN / Static File Server"):::infra
    end

    %% Flows
    IDE -->|"edit source"| ESLint
    IDE -->|"edit source"| TSCompiler

    DevNode -->|"npm run dev"| ViteDev
    ViteDev -->|"reads src/ & public/"| AppTS
    ViteDev -->|"reads src/ & public/"| IndexHTML
    ViteDev -->|"runs type-check"| TSCompiler
    ViteDev -->|"runs lint"| ESLint
    ViteDev -->|"bundles"| Bundler
    ViteDev -->|"uses plugin"| FastRefresh
    ViteDev -->|"serves bundle + HMR"| Browser
    Browser -->|"HMR update"| ViteDev

    DevNode -->|"npm run build"| ViteDev
    ViteDev -->|"build optimized assets"| Dist
    Dist -->|"serve static files"| CDN
    CDN -->|"HTTP GET /bundle.js"| Browser

    %% Click Events
    click ViteConfig "https://github.com/yubeenpark/sulleongsulleong/blob/main/vite.config.ts"
    click TSConfig1 "https://github.com/yubeenpark/sulleongsulleong/blob/main/tsconfig.json"
    click TSConfig2 "https://github.com/yubeenpark/sulleongsulleong/blob/main/tsconfig.node.json"
    click ESLintConfig "https://github.com/yubeenpark/sulleongsulleong/blob/main/.eslintrc.cjs"
    click PackageJSON "https://github.com/yubeenpark/sulleongsulleong/blob/main/package.json"
    click PackageLock "https://github.com/yubeenpark/sulleongsulleong/blob/main/package-lock.json"
    click PublicAssets "https://github.com/yubeenpark/sulleongsulleong/tree/main/public/"
    click IndexHTML "https://github.com/yubeenpark/sulleongsulleong/blob/main/public/index.html"
    click AppTS "https://github.com/yubeenpark/sulleongsulleong/blob/main/src/App.tsx"
    click MainTS "https://github.com/yubeenpark/sulleongsulleong/blob/main/src/main.tsx"
    click AppCSS "https://github.com/yubeenpark/sulleongsulleong/blob/main/src/App.css"
    click IndexCSS "https://github.com/yubeenpark/sulleongsulleong/blob/main/src/index.css"
    click ViteEnv "https://github.com/yubeenpark/sulleongsulleong/blob/main/src/vite-env.d.ts"
    click Readme "https://github.com/yubeenpark/sulleongsulleong/blob/main/README.md"
    click IssueTemp "https://github.com/yubeenpark/sulleongsulleong/tree/main/.github/ISSUE_TEMPLATE/"

    %% Styles
    classDef dev fill:#D0E8FF,stroke:#0288D1,color:#000
    classDef build fill:#E6F4EA,stroke:#2E7D32,color:#000
    classDef runtime fill:#FFE6CC,stroke:#EF6C00,color:#000
    classDef infra fill:#F5F5F5,stroke:#757575,color:#000
    classDef code fill:#F3E5F5,stroke:#6A1B9A,color:#000
```
