# nhattruongniit/react-antd-chart architecture

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

- Interactive diagram: https://gitdiagram.com/nhattruongniit/react-antd-chart
- Repository: https://github.com/nhattruongniit/react-antd-chart

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with React, TypeScript, and Vite. It uses Redux for state management, Ant Design for UI components, Tailwind CSS and PostCSS for styling, and ApexCharts for data visualization. It’s intended to be deployed as a static site (Netlify is referenced in netlify.toml).

##### File structure
- Top-level config and build files:
- .eslintrc.cjs, tsconfig.json/app/node.json, postcss.config.js, tailwind.config.js, vite.config.ts
- package.json (dependencies, scripts), netlify.toml (deployment)
- index.html (SPA entry point)
- Public assets:
- public/ (static files served as-is)
- Source code under src/:
- main.tsx → ReactDOM.render, provider wiring (Redux, router)
- App.tsx & App.css → root component, global styles
- layouts/main-layout.tsx → shell around pages (navigation, header/footer)
- pages/… → route-based views (chart & project)
- components/chart-render.tsx → specialized visualization component wrapping ApexCharts
- assets/ → images or other static media
- index.css → base Tailwind + global resets

##### README for additional insights
- Confirms use of React+TypeScript, AntD, Redux, and ApexCharts. No backend code exists here, so any data comes from external APIs or mock services.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Hosting Layer
    subgraph "Hosting Layer"
        direction TB
        NetlifyCDN["Netlify CDN"]:::infra
        PublicFiles["Public Static Files"]:::infra
        IndexHTML["index.html\n(SPA Entry HTML)"]:::infra
    end

    %% Build Tools Layer
    subgraph "Build & Config Tools"
        direction TB
        ViteBundle["React SPA Bundle\n(produced by Vite)"]:::build
        ViteConfig["vite.config.ts"]:::build
        TSConfig["tsconfig.json,\ntsconfig.app.json,\ntsconfig.node.json"]:::build
        PostCSSConfig["postcss.config.js"]:::build
        TailwindConfig["tailwind.config.js"]:::build
        ESLintConfig[".eslintrc.cjs"]:::build
        PackageJSON["package.json"]:::build
    end

    %% Client Runtime Layer
    subgraph "Client Runtime"
        direction TB
        MainTSX["SPA Entry Point\nsrc/main.tsx"]:::runtime
        IndexCSS["Global Tailwind & resets\nsrc/index.css"]:::runtime
        AppTSX["Root Component & Global Styles\nsrc/App.tsx\n& src/App.css"]:::runtime
        Router["React Router"]:::runtime
        ReduxStore["Redux Store"]:::runtime

        subgraph "UI Layer"
            direction TB
            Layout["Application Layout\nsrc/layouts/main-layout/main-layout.tsx"]:::ui
            subgraph "Pages"
                direction TB
                ChartPage["Chart Page\nsrc/pages/chart/chart.tsx"]:::ui
                ProjectPage["Project Page\nsrc/pages/project/project.tsx"]:::ui
            end
            ChartRender["Chart Visualization Component\nsrc/components/chart-render.tsx"]:::ui
        end

        subgraph "Libraries"
            direction TB
            AntD["Ant Design"]:::lib
            TailwindLib["Tailwind CSS"]:::lib
            ApexCharts["ApexCharts"]:::lib
        end

        ExternalAPI["External API / Mock Service"]:::data
    end

    %% Connections
    Browser["Browser"]:::external -->|requests SPA| NetlifyCDN
    NetlifyCDN -->|"serves"| PublicFiles
    NetlifyCDN -->|"serves"| IndexHTML
    IndexHTML -->|"loads bundle"| ViteBundle
    ViteBundle -->|configured by| ViteConfig
    ViteBundle -->|uses| TSConfig
    ViteBundle -->|uses| PostCSSConfig
    ViteBundle -->|uses| TailwindConfig
    ViteBundle -->|uses| ESLintConfig
    ViteBundle -->|defined in| PackageJSON

    ViteBundle -->|"executes"| MainTSX
    MainTSX -->|"imports"| IndexCSS
    MainTSX -->|"renders"| AppTSX
    AppTSX -->|"wraps with"| Router
    AppTSX -->|"provides"| ReduxStore

    Router -->|"routes to"| ChartPage
    Router -->|"routes to"| ProjectPage

    ChartPage -->|"uses"| ChartRender
    ChartPage -->|"dispatches actions"| ReduxStore
    ProjectPage -->|"dispatches actions"| ReduxStore

    ReduxStore -->|"fetches data from"| ExternalAPI
    ReduxStore -->|"triggers re-render"| AppTSX

    ChartRender -->|"visualizes via"| ApexCharts
    AppTSX -->|"UI components"| AntD
    AppTSX -->|"styles via"| TailwindLib

    Layout -->|"wraps"| ChartPage
    Layout -->|"wraps"| ProjectPage

    %% Click Events
    click MainTSX "https://github.com/nhattruongniit/react-antd-chart/blob/main/src/main.tsx"
    click AppTSX "https://github.com/nhattruongniit/react-antd-chart/blob/main/src/App.tsx"
    click Layout "https://github.com/nhattruongniit/react-antd-chart/blob/main/src/layouts/main-layout/main-layout.tsx"
    click ChartPage "https://github.com/nhattruongniit/react-antd-chart/blob/main/src/pages/chart/chart.tsx"
    click ProjectPage "https://github.com/nhattruongniit/react-antd-chart/blob/main/src/pages/project/project.tsx"
    click ChartRender "https://github.com/nhattruongniit/react-antd-chart/blob/main/src/components/chart-render.tsx"
    click PublicFiles "https://github.com/nhattruongniit/react-antd-chart/tree/main/public/"
    click IndexHTML "https://github.com/nhattruongniit/react-antd-chart/blob/main/index.html"
    click ViteConfig "https://github.com/nhattruongniit/react-antd-chart/blob/main/vite.config.ts"
    click TSConfig "https://github.com/nhattruongniit/react-antd-chart/blob/main/tsconfig.json"
    click TSConfig "https://github.com/nhattruongniit/react-antd-chart/blob/main/tsconfig.app.json"
    click TSConfig "https://github.com/nhattruongniit/react-antd-chart/blob/main/tsconfig.node.json"
    click PostCSSConfig "https://github.com/nhattruongniit/react-antd-chart/blob/main/postcss.config.js"
    click TailwindConfig "https://github.com/nhattruongniit/react-antd-chart/blob/main/tailwind.config.js"
    click ESLintConfig "https://github.com/nhattruongniit/react-antd-chart/blob/main/.eslintrc.cjs"
    click PackageJSON "https://github.com/nhattruongniit/react-antd-chart/blob/main/package.json"
    click IndexCSS "https://github.com/nhattruongniit/react-antd-chart/blob/main/src/index.css"

    %% Styles
    classDef infra fill:#CCEBFF,stroke:#1E90FF
    classDef build fill:#E0FFD8,stroke:#00A000
    classDef runtime fill:#FFF3B0,stroke:#D4A017
    classDef ui fill:#FFE4B5,stroke:#FF8C00
    classDef lib fill:#E6E6FA,stroke:#9370DB
    classDef data fill:#F0E68C,stroke:#DAA520
    classDef external fill:#F5F5F5,stroke:#A9A9A9,stroke-dasharray: 5 5
```
