# lazyatwell/mf-turbinemonitor architecture

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

- Interactive diagram: https://gitdiagram.com/lazyatwell/mf-turbinemonitor
- Repository: https://github.com/lazyatwell/mf-turbinemonitor

## Overview

##### Project Type & Purpose
- The README states it is “一个大型涡轮扇叶风力发电机数据大屏案例” – a large-scale wind turbine dashboard.
- The focus is on visualizing turbine data, interactive animations (including part assembly/disassembly), lighting effects, and highlighting device interactions.
- The use of Vue 3, TypeScript, and Vite indicates a modern front-end SPA (Single Page Application) with heavy graphical/3D content.

##### Key Components from the File Structure
- /src: Contains the main application code.
– App.vue, layout components (header, footer, panel, loading), and various UI widgets (WidgetPanel01.vue through WidgetPanel07.vue).
– “hooks” directory shows custom hooks like useEcharts, useThree, and useTurbine – these abstract logic for our visualizations and turbine data.
- /public and /docs: Store public assets including models (GLB files for equipment, planes, skeleton) and textures, as well as JavaScript libraries for DRACO compression, Three.js, and additional visualization libraries.
- /assets: Contains fonts and images that are critical for UI branding and performance (notably font subpackaging improvements mentioned in the changelog).
- Config files (vite.config.ts, tsconfig) and various linter/formatter configuration files indicate an emphasis on code quality and project consistency.

##### Architectural Patterns & Relationships
- Frontend Presentation Layer:
- Core UI components and layout within the /src folder.
- Vue components orchestrate the dashboard’s interactive visualization panels.
- Layout components clearly separate header, footer, panel areas – suggesting a compartmentalized structure for the data display.
- Data Visualization & 3D Rendering:
- Three.js is used via the useThree hook to handle 3D models, animations, and interactions.
- ECharts is integrated via the useEcharts hook to render complex charts and graphs that show turbine metrics.
- DRACO libraries embedded under both /docs/js/draco and /public/js/draco are used to decode and encode compressed 3D geometry which are then rendered by Three.js.
- Asset & Media Management:
- The project has dedicated directories for models, textures, and fonts; these assets are essential for creating an immersive data display environment.
- Optimized asset distribution (as highlighted in recent updates) plays a crucial role in performance.
- Build and Deployment:
- Vite configuration ensures a modern, high-performance build process.
- Environment files (.env, .env.production, .env.development) indicate environment-specific configurations that might affect API endpoints or debug settings.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Configuration
    subgraph "Build & Configuration"
        Y["Build & Config (Vite, Env, TSConfig)"]:::build
        Z["Lint Tools (ESLint, Prettier, Stylelint)"]:::build
    end

    %% Dashboard UI Layer
    subgraph "Dashboard UI Layer"
        A["Main Application (App.vue)"]:::ui
        B["Layout (Layout.vue)"]:::ui
        C["Layout Header (LayoutHeader.vue)"]:::ui
        D["Layout Footer (LayoutFooter.vue)"]:::ui
        E["Layout Panel (LayoutPanel.vue)"]:::ui
        F["Layout Loading (LayoutLoading.vue)"]:::ui
        G["Widget Panel 01 (WidgetPanel01.vue)"]:::ui
        H["Widget Panel 02 (WidgetPanel02.vue)"]:::ui
        I["Widget Panel 03 (WidgetPanel03.vue)"]:::ui
        J["Widget Panel 04 (WidgetPanel04.vue)"]:::ui
        K["Widget Panel 05 (WidgetPanel05.vue)"]:::ui
        L["Widget Panel 06 (WidgetPanel06.vue)"]:::ui
        M["Widget Panel 07 (WidgetPanel07.vue)"]:::ui
        N["Widget Label (WidgetLabel.vue)"]:::ui
    end

    %% Hooks & Services
    subgraph "Hooks & Services"
        O["Three.js Renderer (useThree.ts)"]:::service
        P["ECharts Visualizer (useEcharts.ts)"]:::service
        Q["Turbine Data (useTurbine.ts)"]:::service
    end

    %% Rendering Engine Details
    subgraph "Rendering Engine Details"
        R["DRACO Libraries (Docs/js)"]:::engine
        S["DRACO Libraries (Public/js)"]:::engine
        T["3D Models (Docs)"]:::engine
        U["3D Models (Public)"]:::engine
    end

    %% Data Visualization Details
    subgraph "Data Visualization Details"
        V["ECharts Library File (echarts-DJvnQIox.js)"]:::engine
    end

    %% Asset Management
    subgraph "Asset Management"
        W["UI Assets (Fonts & Images)"]:::asset
        X["Public Assets (Textures & Images)"]:::asset
    end

    %% Relationships
    %% Build & Config feeds into UI and Hooks
    Y --> A
    Y --> O
    Y --> P
    Y --> Q
    Z --> A
    Z --> O
    Z --> P
    Z --> Q

    %% UI Layer interactions with Hooks
    A -->|"triggers"| O
    A -->|"triggers"| P
    A -->|"triggers"| Q
    Q -->|"updates"| A

    %% Hooks interconnections
    O -->|"loads"| R
    O -->|"loads"| S
    O -->|"renders using"| T
    O -->|"renders using"| U
    P -->|"utilizes"| V

    %% Asset Management providing resources
    W -->|"supplies assets to"| A
    X -->|"feeds into"| O

    %% Class Definitions for styling
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef service fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef engine fill:#C1FFC1,stroke:#333,stroke-width:2px;
    classDef asset fill:#FFA07A,stroke:#333,stroke-width:2px;
    classDef build fill:#DDA0DD,stroke:#333,stroke-width:2px;

    %% Click Events for Dashboard UI Layer
    click A "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/App.vue"
    click B "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/layout/Layout.vue"
    click C "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/layout/LayoutHeader.vue"
    click D "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/layout/LayoutFooter.vue"
    click E "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/layout/LayoutPanel.vue"
    click F "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/layout/LayoutLoading.vue"
    click G "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/components/WidgetPanel01.vue"
    click H "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/components/WidgetPanel02.vue"
    click I "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/components/WidgetPanel03.vue"
    click J "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/components/WidgetPanel04.vue"
    click K "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/components/WidgetPanel05.vue"
    click L "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/components/WidgetPanel06.vue"
    click M "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/components/WidgetPanel07.vue"
    click N "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/components/WidgetLabel.vue"

    %% Click Events for Hooks & Services
    click O "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/hooks/useThree.ts"
    click P "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/hooks/useEcharts.ts"
    click Q "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/src/hooks/useTurbine.ts"

    %% Click Events for Rendering Engine Details
    click R "https://github.com/lazyatwell/mf-turbinemonitor/tree/master/docs/js/draco"
    click S "https://github.com/lazyatwell/mf-turbinemonitor/tree/master/public/js/draco"
    click T "https://github.com/lazyatwell/mf-turbinemonitor/tree/master/docs/models"
    click U "https://github.com/lazyatwell/mf-turbinemonitor/tree/master/public/models"

    %% Click Event for Data Visualization Details
    click V "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/docs/js/echarts-DJvnQIox.js"

    %% Click Events for Asset Management
    click W "https://github.com/lazyatwell/mf-turbinemonitor/tree/master/src/assets/fonts"
    click X "https://github.com/lazyatwell/mf-turbinemonitor/tree/master/public/textures"

    %% Click Events for Build & Configuration
    click Y "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/vite.config.ts"
    click Z "https://github.com/lazyatwell/mf-turbinemonitor/blob/master/.eslintrc.cjs"
```
