# chennlang/js-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/chennlang/js-analyzer
- Repository: https://github.com/chennlang/js-analyzer

## Overview

##### Main Components Identification

The system consists of three main packages:
- Core Package (@js-analyzer/core): The analysis engine
- Server Package (@js-analyzer/server): The backend service
- Web Package (@js-analyzer/web): The frontend visualization interface

**[Frontend Application (Vue.js)] ←→ [Backend Server] ←→ [Core Analyzer Engine]**

##### Component Relationships

**Project Files → Core Analyzer → AST Processing → Dependency Data → Server → Frontend Visualization**

##### Special Features to Highlight

Dedicated sections for:
- Plugin System Architecture
- File Analysis Pipeline
- Data Storage Flow
- Hot Word Analysis System
- Style Analysis System

##### Technical Stack Indicators

Technology badges for:
- Vue.js (Frontend)
- Node.js (Server)
- AST Processing
- WebSocket (Real-time updates)
- Local Storage System

- File Parsing Process
- Dependency Resolution Flow
- Plugin Execution Pipeline
- Data Visualization Process

##### Integration Points

Highlight:
- Plugin Integration Points
- File System Watchers
- Configuration System
- Custom Data Generators

This system design should emphasize:

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        FA["Frontend Application"]:::frontend
        click FA "https://github.com/chennlang/js-analyzer/blob/main/packages/web/src/App.vue"
        FTV["File Tree View"]:::frontend
        click FTV "https://github.com/chennlang/js-analyzer/blob/main/packages/web/src/components/Tree/Tree.vue"
        DGR["Dependency Graph Renderer"]:::frontend
        click DGR "https://github.com/chennlang/js-analyzer/blob/main/packages/web/src/views/chart/Echart.vue"
        ARD["Analysis Results Display"]:::frontend
        click ARD "https://github.com/chennlang/js-analyzer/blob/main/packages/web/src/components/CodePreview/CodePreview.vue"
        CI["Configuration Interface"]:::frontend
        click CI "https://github.com/chennlang/js-analyzer/blob/main/packages/web/src/components/ProjectManage.vue"
        IVL["Interactive Visualization Layer"]:::frontend
        click IVL "https://github.com/chennlang/js-analyzer/tree/main/packages/web/src/views/chart/"
        API["Frontend API Interface"]:::frontend
        click API "https://github.com/chennlang/js-analyzer/blob/main/packages/web/src/api/remote-data.ts"
    end

    subgraph Server
        HS["HTTP Server"]:::server
        click HS "https://github.com/chennlang/js-analyzer/blob/main/packages/server/src/index.js"
        PS["Plugin System"]:::server
        click PS "https://github.com/chennlang/js-analyzer/tree/main/packages/server/plugins/"
        FSW["File System Watcher"]:::server
        DSM["Data Storage Manager"]:::server
        click DSM "https://github.com/chennlang/js-analyzer/tree/main/packages/server/public/data/"
        PI["Plugin Integration"]:::server
        click PI "https://github.com/chennlang/js-analyzer/blob/main/packages/server/plugins/analy-plugin-names.js"
    end

    subgraph "Core Analyzer"
        HP["HTML Parser"]:::core
        click HP "https://github.com/chennlang/js-analyzer/blob/main/packages/core/src/html-parser.ts"
        SP["Script Parser"]:::core
        click SP "https://github.com/chennlang/js-analyzer/blob/main/packages/core/src/script-parser.ts"
        STP["Style Parser"]:::core
        click STP "https://github.com/chennlang/js-analyzer/blob/main/packages/core/src/style-parser.ts"
        CM["Configuration Manager"]:::core
        click CM "https://github.com/chennlang/js-analyzer/blob/main/packages/core/src/config.ts"
        FSI["File System Interface"]:::core
    end

    %% Frontend Relationships
    FA --> FTV
    FA --> DGR
    FA --> ARD
    FA --> CI
    FA --> IVL
    FA --> API
    API -.->|Data Flow| HS

    %% Server Relationships
    HS --> PS
    HS --> FSW
    HS --> DSM
    PS --> PI
    FSW --> DSM

    %% Core Analyzer Relationships
    HP --> SP
    HP --> STP
    SP --> FSI
    STP --> FSI
    CM --> FSI

    %% Cross-Component Relationships
    FSI -.->|Project Files| DSM
    DSM -.->|Analysis Data| HS
    PS -.->|Plugin Results| DSM

    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef server fill:#2ecc71,stroke:#27ae60,color:white
    classDef core fill:#e67e22,stroke:#d35400,color:white

    %% Legend
    subgraph Legend
        L1["Frontend Component"]:::frontend
        L2["Server Component"]:::server
        L3["Core Component"]:::core
        L4[" "] --->|"Direct Dependency"| L5[" "]
        L6[" "] -.->|"Data Flow"| L7[" "]
    end
```
