# jl917/eapp architecture

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

- Interactive diagram: https://gitdiagram.com/jl917/eapp
- Repository: https://github.com/jl917/eapp

## Overview

##### Main Application Components (Top Level)

- Main Process (Process Management)
- Preload Process (Security Bridge)
- Renderer Process (UI Layer)

##### Main Process Components (Left Side)
- Window Management Service
- Auto Updater Service
- Deep Link Handler
- Power Management
- System Information Service
- Tray Menu Service
- Message Service
- Sentry Error Tracking

##### Renderer Process Components (Right Side)
- Main Window UI
- Message Component
- Monitor Component
- System Info Component
- Version Component
- Sub Monitor Window
- Router System
- State Management Store

##### Build System (Bottom Section)
Build pipeline:
- Rsbuild Configuration
- Main Config
- Preload Config
- Renderer Config
- Electron Forge
- Custom Plugin System

##### Special Features
- Deep Link Handler (eapp-beta:// protocol)
- Multi-architecture support (ia32, x64, armv7l, arm64, universal, mips64el)
- Error tracking system integration

##### Component Relationships
- IPC communication between Main and Renderer processes
- Security bridge role of the Preload script
- Demonstrate how the build system components interact

Key Elements to Highlight:

##### Security Layer
- How the preload script bridges main and renderer processes
- IPC communication patterns

##### Application Structure
- Multi-window support (main window and sub-monitor)
- Service-based architecture in the main process
- React-based UI architecture

##### Build Pipeline
- Custom Rsbuild plugin integration
- Platform-specific builders (DMG maker)

##### Cross-Platform Support
- Architecture support indicators
- Platform-specific considerations

Remember to:
- Use consistent symbols and notation
- Version/environment indicators (dev, beta, production)
- External service integrations (Sentry)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef main fill:#2196F3,color:white
    classDef renderer fill:#4CAF50,color:white
    classDef preload fill:#FFC107,color:black
    classDef build fill:#9E9E9E,color:white
    classDef service fill:#1976D2,color:white
    classDef component fill:#388E3C,color:white

    %% Main Application Layers
    subgraph MainProcess["Main Process"]
        direction TB
        WinService["Window Management"]:::service
        AutoUpdate["Auto Updater"]:::service
        DeepLink["Deep Link Handler"]:::service
        Power["Power Management"]:::service
        SysInfo["System Information"]:::service
        Tray["Tray Menu"]:::service
        Message["Message Service"]:::service
        Sentry["Sentry Error Tracking"]:::service
    end

    subgraph PreloadProcess["Preload Process (Security Bridge)"]
        Preload["Preload Script"]:::preload
    end

    subgraph RendererProcess["Renderer Process"]
        direction TB
        subgraph MainWindow["Main Window UI"]
            direction TB
            MessageComp["Message Component"]:::component
            MonitorComp["Monitor Component"]:::component
            SysInfoComp["System Info Component"]:::component
            VersionComp["Version Component"]:::component
        end
        SubMonitor["Sub Monitor Window"]:::component
        Router["Router System"]:::component
        Store["State Management"]:::component
    end

    subgraph BuildSystem["Build System"]
        direction TB
        RsbuildConfig["Rsbuild Configuration"]:::build
        ElectronForge["Electron Forge"]:::build
        DMGMaker["DMG Maker Plugin"]:::build
    end

    %% Relationships
    MainProcess --> Preload -.IPC.->
    Preload -.IPC.-> RendererProcess
    BuildSystem --> MainProcess
    BuildSystem --> PreloadProcess
    BuildSystem --> RendererProcess

    %% Click Events
    click WinService "https://github.com/jl917/eapp/blob/beta/src/main/service/window.ts"
    click AutoUpdate "https://github.com/jl917/eapp/blob/beta/src/main/service/autoUpdater.ts"
    click DeepLink "https://github.com/jl917/eapp/blob/beta/src/main/service/deeplink.ts"
    click Power "https://github.com/jl917/eapp/blob/beta/src/main/service/power.ts"
    click SysInfo "https://github.com/jl917/eapp/blob/beta/src/main/service/systemInfo.ts"
    click Tray "https://github.com/jl917/eapp/blob/beta/src/main/service/trayMenu.ts"
    click Message "https://github.com/jl917/eapp/blob/beta/src/main/service/message.ts"
    click Sentry "https://github.com/jl917/eapp/blob/beta/src/main/service/sentry.ts"
    click MessageComp "https://github.com/jl917/eapp/blob/beta/src/renderer/pages/main/Message.tsx"
    click MonitorComp "https://github.com/jl917/eapp/blob/beta/src/renderer/pages/main/Monitor.tsx"
    click SysInfoComp "https://github.com/jl917/eapp/blob/beta/src/renderer/pages/main/SystemInfo.tsx"
    click VersionComp "https://github.com/jl917/eapp/blob/beta/src/renderer/pages/main/Version.tsx"
    click SubMonitor "https://github.com/jl917/eapp/blob/beta/src/renderer/pages/subMonitor/index.tsx"
    click Router "https://github.com/jl917/eapp/tree/beta/src/renderer/routers/"
    click Store "https://github.com/jl917/eapp/blob/beta/src/renderer/store/index.ts"
    click RsbuildConfig "https://github.com/jl917/eapp/blob/beta/plugins/electron-forge-plugin-rsbuild/config/rsbuild.base.config.ts"
    click ElectronForge "https://github.com/jl917/eapp/blob/beta/forge.config.ts"
    click DMGMaker "https://github.com/jl917/eapp/blob/beta/plugins/maker-dmg/index.ts"
    click Preload "https://github.com/jl917/eapp/blob/beta/src/preload/preload.ts"
```
