# lcdkhoa/mayguy_onethreefive_nextgen architecture

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

- Interactive diagram: https://gitdiagram.com/lcdkhoa/mayguy_onethreefive_nextgen
- Repository: https://github.com/lcdkhoa/mayguy_onethreefive_nextgen

## Overview

##### Project Type and Purpose
- This is a single-page application (SPA) built with React and TypeScript, using Vite as the build/dev tool.
- It provides several pages (Home, About, Blogs, Tools, NotFound) and two in-browser tools (ObjectHandler playground and SwaggerCreator).
- There is no custom backend; all logic runs in the browser, with static assets served from a CDN or web server.

##### File Structure
- Top-level configuration: tsconfig.json, vite.config.ts, ESLint/Prettier/Husky hooks, package.json.
- public/: static assets (images, fonts, redirects).
- src/: application code
- main.tsx & index.html (app bootstrap)
- App.tsx (root component)
- components/: reusable UI (Header, Footer, MonacoEditor, HandlerButton, ThemeRegistry)
- pages/: route-based subfolders (About, Blogs, Tools, Home, NotFound)
- contexts/: React Context providers (ThemeContext, DeviceContext)
- configs/: global constants
- utils/: tool-specific logic (object-handler, swagger-creator)
- styles/: CSS and theme definitions

##### README for Additional Insights
- Minimal instructions: Node.js ≥20, npm install, npm run dev.
- No explicit architecture section—so rely on file layout and tech choices.

##### Main Components & Interactions
(a) Browser / Client
- Vite Dev Server (local dev) → serves index.html + bundled JS/CSS
- Production Build → static assets (HTML, JS, CSS) deployed to CDN/web host
(b) React App Layers
- Bootstrap (main.tsx)
- App Shell (ThemeRegistry → DeviceContext → Router)
- Pages (Home, About, Blogs, Tools, NotFound)
- Components (UI primitives, Monaco code editor, tool controls)
(c) Utility Modules
- object-handler-playground.ts & object-handler.ts
- swagger-creator.ts
(d) Static Assets
- public/images, fonts, _redirects

##### Architectural Patterns & Principles
- SPA with client-side routing
- Context API for cross-cutting concerns (theme, device)
- Functional, composable React components organized by feature
- Utils separated from UI for tool logic (separation of concerns)
- Vite for fast HMR and production bundling

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Development & Build Layer
    subgraph "Development & Build" 
        direction TB
        ViteDev["Vite Dev Server & Build Config"]:::build
    end

    %% Deployment Layer
    subgraph "Deployment/Hosting"
        direction TB
        StaticSite["Static Assets (CDN/Host)"]:::deployment
    end

    %% Runtime Client Layer
    subgraph "Browser (Runtime)" 
        direction TB
        Browser["Browser"]:::client
        subgraph "Client (SPA)"
            direction TB
            main["Bootstrap\nmain.tsx"]:::client
            AppShell["App Shell\nApp.tsx"]:::client
            subgraph "Providers & Router"
                direction TB
                ThemeReg["ThemeRegistry"]:::client
                ThemeCtx["Theme Context Provider"]:::client
                DeviceCtx["Device Context Provider"]:::client
                Router["Router (React Router)"]:::client
            end
            subgraph "Shared UI Components"
                direction TB
                Header["Header"]:::client
                Footer["Footer"]:::client
                HandlerBtn["Handler Button"]:::client
                MonacoEd["Monaco Editor"]:::client
            end
            subgraph "Pages"
                direction TB
                Home["Home Page"]:::client
                About["About Page"]:::client
                Blogs["Blogs Page"]:::client
                BlogDetail["Blog Detail"]:::client
                ToolsPage["Tools Page"]:::client
                NotFound["NotFound Page"]:::client
            end
            subgraph "Tools Components"
                direction TB
                ObjHandlerComp["ObjectHandler Component"]:::client
                ObjPlayComp["ObjectHandlerPlayground Component"]:::client
                OptionsPop["OptionsPopover"]:::client
                SwaggerComp["SwaggerCreator Component"]:::client
            end
            subgraph "Utility Modules"
                direction TB
                ObjHandler["Object Handler Logic"]:::utils
                ObjPlayLogic["ObjectHandler Playground Logic"]:::utils
                SwaggerLogic["Swagger Creator Logic"]:::utils
            end
            subgraph "Styles & Themes"
                direction TB
                BaseCSS["Base CSS"]:::styles
                FontsCSS["Fonts CSS"]:::styles
                ColorVars["Color Variables"]:::styles
                ThemeDefs["Theme Definitions"]:::styles
            end
        end
    end

    %% Connections
    ViteDev -->|"dev serve"| Browser
    ViteDev -->|"build bundle"| StaticSite
    StaticSite -->|"serve assets"| Browser

    Browser --> main
    main --> AppShell
    AppShell --> ThemeReg
    ThemeReg --> ThemeCtx
    ThemeCtx --> DeviceCtx
    DeviceCtx --> Router

    AppShell --> Header
    AppShell --> Footer

    Router --> Home
    Router --> About
    Router --> Blogs
    Blogs --> BlogDetail
    Router --> ToolsPage
    Router --> NotFound

    ToolsPage --> ObjHandlerComp
    ToolsPage --> ObjPlayComp
    ToolsPage --> SwaggerComp

    ObjHandlerComp --> ObjHandler
    ObjPlayComp --> ObjPlayLogic
    ObjPlayComp --> OptionsPop
    SwaggerComp --> SwaggerLogic

    %% Click Events
    click ViteDev "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/vite.config.ts"
    click Browser "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/index.html"
    click main "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/main.tsx"
    click AppShell "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/App.tsx"
    click ThemeReg "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/components/ThemeRegistry.tsx"
    click ThemeCtx "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/contexts/ThemeContext.tsx"
    click DeviceCtx "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/contexts/DeviceContext.tsx"
    click Header "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/components/Header.tsx"
    click Footer "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/components/Footer.tsx"
    click HandlerBtn "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/components/HandlerButton.tsx"
    click MonacoEd "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/components/MonacoEditor.tsx"
    click Home "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/pages/Home/Home.tsx"
    click About "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/pages/About/About.tsx"
    click Blogs "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/pages/Blogs/Blog.tsx"
    click BlogDetail "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/pages/Blogs/components/BlogDetail.tsx"
    click ToolsPage "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/pages/Tools/Tools.tsx"
    click ObjHandlerComp "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/pages/Tools/components/ObjectHandler/index.tsx"
    click ObjPlayComp "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/pages/Tools/components/ObjectHandlerPlayGround/index.tsx"
    click OptionsPop "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/pages/Tools/components/ObjectHandlerPlayGround/components/OptionsPopover.tsx"
    click SwaggerComp "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/pages/Tools/components/SwaggerCreator/index.tsx"
    click ObjHandler "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/utils/object-handler.ts"
    click ObjPlayLogic "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/utils/object-handler-playground.ts"
    click SwaggerLogic "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/utils/swagger-creator.ts"
    click BaseCSS "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/styles/css/index.css"
    click FontsCSS "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/styles/css/fonts.css"
    click ColorVars "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/styles/color.ts"
    click ThemeDefs "https://github.com/lcdkhoa/mayguy_onethreefive_nextgen/blob/main/src/styles/theme.ts"

    %% Styles
    classDef build fill:#add8e6,stroke:#000;
    classDef deployment fill:#d3c4f3,stroke:#000;
    classDef client fill:#90ee90,stroke:#000;
    classDef utils fill:#ffa500,stroke:#000;
    classDef styles fill:#f0e68c,stroke:#000;
```
