# yfg1995/dashboard-react-tailwind-typescript architecture

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

- Interactive diagram: https://gitdiagram.com/yfg1995/dashboard-react-tailwind-typescript
- Repository: https://github.com/yfg1995/dashboard-react-tailwind-typescript

## Overview

##### Main System Components Identification

A. Core Application Layer
- To the routing system (React Router implementation)

B. Feature Modules (Pages)
- Pages (Dashboard, Overview, Chat, Reports, Settings, Tasks, Team)
- Their relationship to the main layout

C. Component Architecture
- Create three distinct component categories:
1. Smart Components (Dashboard components)
2. UI Components (Generic components like Modal, Input, CircleProgress)
3. SVG Components (Visual assets)

D. State Management
- Zustand store implementation
- State flow between components

**┌─ Application Core ─────────────────────┐**
- App.tsx                                │
- Layout.tsx                             │

- ┌─ Routing Layer ─────────────────┐  │
- React Router                    │  │
- ┘  │

- Pages ────────────────────────────────┤
- Dashboard | Overview | Chat | Reports  │
- Settings  | Tasks   | Team            │

- Components ──────────────────────────-┤
- ┌─ Smart Components ─┐ ┌─ UI Components┤
- DashboardHeader   │ │ Modal         │
- DashboardSegment  │ │ Input         │
- ...              │ │ ...           │
- ┘ └───────────────-│

- State Management ────────────────────-┤
- Zustand Stores                         │
- Profile State                        │
- Sidebar State                        │
- ┘

##### Important Elements

- Blue: Core application components
- Green: Page components
- Orange: Smart components
- Purple: UI components
- Yellow: State management

##### Technical Stack Layer

A separate section showing the technical stack integration:
- React + TypeScript
- Tailwind CSS
- useGSAP (Animations)
- ECharts (Data Visualization)

##### Key Architectural Patterns to Highlight

- Component Composition Pattern
- State Management with Zustand
- Route-based Code Splitting
- Presentational vs Container Components

##### Implementation Details

- The separation of concerns between pages and components
- The centralized state management approach
- The modular component structure
- The relationship between smart and presentational components

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Core
        App["App.tsx"]
        Layout["Layout.tsx"]
        Router["React Router"]
        App --> Layout
        Layout --> Router
    end

    subgraph Pages
        Dashboard["Dashboard"]
        Overview["Overview"]
        Chat["Chat"]
        Reports["Reports"]
        Settings["Settings"]
        Tasks["Tasks"]
        Team["Team"]
        
        Router --> Dashboard
        Router --> Overview
        Router --> Chat
        Router --> Reports
        Router --> Settings
        Router --> Tasks
        Router --> Team
    end

    subgraph "Smart Components"
        DashHeader["Dashboard Header"]
        DashSegment["Dashboard Segmentation"]
        DashSatisfaction["Dashboard Satisfaction"]
        
        Dashboard --> DashHeader
        Dashboard --> DashSegment
        Dashboard --> DashSatisfaction
    end

    subgraph "UI Components"
        Modal["Modal"]
        Input["Input"]
        CircleProgress["Circle Progress"]
        ProgressBar["Progress Bar"]
        SearchInput["Search Input"]
    end

    subgraph "Sidebar Components"
        Sidebar["Sidebar"]
        SidebarProfile["Sidebar Profile"]
        
        Layout --> Sidebar
        Sidebar --> SidebarProfile
    end

    subgraph "SVG Components"
        DashboardIcon["Dashboard Icon"]
        SettingsIcon["Settings Icon"]
        ChatIcon["Chat Icon"]
        
        Sidebar --> DashboardIcon
        Sidebar --> SettingsIcon
        Sidebar --> ChatIcon
    end

    subgraph "State Management"
        ProfileState["Profile State"]
        SidebarState["Sidebar State"]
        
        SidebarProfile --> ProfileState
        Sidebar --> SidebarState
    end

    subgraph "Utility Layer"
        Types["Types"]
        Utils["Utility Functions"]
    end

    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef page fill:#4CAF50,stroke:#2E7D32,color:white
    classDef smart fill:#FF9800,stroke:#EF6C00,color:white
    classDef ui fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef sidebar fill:#795548,stroke:#4E342E,color:white
    classDef svg fill:#607D8B,stroke:#37474F,color:white
    classDef state fill:#FFC107,stroke:#FFA000,color:white
    classDef util fill:#9E9E9E,stroke:#616161,color:white

    class App,Layout,Router core
    class Dashboard,Overview,Chat,Reports,Settings,Tasks,Team page
    class DashHeader,DashSegment,DashSatisfaction smart
    class Modal,Input,CircleProgress,ProgressBar,SearchInput ui
    class Sidebar,SidebarProfile sidebar
    class DashboardIcon,SettingsIcon,ChatIcon svg
    class ProfileState,SidebarState state
    class Types,Utils util

    click App "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/App.tsx"
    click Layout "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/Layout.tsx"
    click Dashboard "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/pages/Dashboard.tsx"
    click Overview "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/pages/Overview.tsx"
    click Chat "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/pages/Chat.tsx"
    click Reports "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/pages/Reports.tsx"
    click Settings "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/pages/Settings.tsx"
    click Tasks "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/pages/Tasks.tsx"
    click Team "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/pages/Team.tsx"
    click DashHeader "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/components/Dashboard/DashboardUserHeader.tsx"
    click DashSegment "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/components/Dashboard/DashboardSegmentation.tsx"
    click DashSatisfaction "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/components/Dashboard/DashboardSatisfaction.tsx"
    click Modal "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/components/Modal.tsx"
    click Input "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/components/Input.tsx"
    click CircleProgress "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/components/CircleProgress.tsx"
    click ProgressBar "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/components/ProgressBar.tsx"
    click SearchInput "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/components/SearchInput.tsx"
    click Sidebar "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/components/Sidebar/Sidebar.tsx"
    click SidebarProfile "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/components/Sidebar/SidebarUserProfile.tsx"
    click DashboardIcon "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/svg/DashboardSvg.tsx"
    click SettingsIcon "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/svg/SettingsSvg.tsx"
    click ChatIcon "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/svg/ChatSvg.tsx"
    click ProfileState "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/zustand/useProfileActiveState.ts"
    click SidebarState "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/zustand/useSidebarActiveState.ts"
    click Types "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/helpers/types.ts"
    click Utils "https://github.com/yfg1995/dashboard-react-tailwind-typescript/blob/main/src/utils/utils.ts"
```
