# mihomo-party-org/clash-party architecture

> Architecture diagram of the GitHub repository mihomo-party-org/clash-party, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mihomo-party-org/clash-party
- Repository: https://github.com/mihomo-party-org/clash-party

## Overview

Clash Party is an Electron Mihomo GUI. Users manage proxy profiles and routing in the renderer; requests cross the preload IPC bridge to main-process configuration and core-management services, which apply settings to Mihomo and the operating system. The README also identifies Smart Core, Tun, Sub-Store, WebDAV backup/restore, themes, and configuration overrides as product capabilities. The graph combines those documented capabilities with sampled startup, configuration, core, and IPC evidence; unsampled subsystem wiring is left out where uncertain.

Main entry points: [`src/main/core/manager.ts`](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/core/manager.ts) (Core manager), [`src/renderer/src/utils/ipc.ts`](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/utils/ipc.ts) (Renderer IPC), [`src/renderer/src/App.tsx`](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/App.tsx) (Renderer app), [`src/main/core/mihomoApi.ts`](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/core/mihomoApi.ts) (Mihomo API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_renderer["Renderer app<br/>[App.tsx]"]
  node_profile_ui["Profiles UI<br/>[profiles.tsx]"]
  node_settings_ui["Settings UI<br/>[settings.tsx]"]
  node_bridge["Preload IPC<br/>[index.ts]"]
  node_ipc["Renderer IPC<br/>[ipc.ts]"]
  node_traffic_ui["Traffic views<br/>[traffic.tsx]"]
end

subgraph group_config["Configuration workflows"]
  node_app_config[("App configuration<br/>[app.ts]")]
  node_profile_config["Profiles and overrides<br/>[profile.ts]"]
  node_simple["Simple mode compiler<br/>[service.ts]"]
end

subgraph group_runtime["Mihomo runtime"]
  node_core_manager["Core manager<br/>[manager.ts]"]
  node_core_api["Mihomo API<br/>[mihomoApi.ts]"]
  node_system["System proxy and Tun<br/>[sysproxy.ts]"]
end

subgraph group_integrations["Product integrations"]
  node_smart["Smart Core<br/>[smartModel.ts]"]
  node_substore["Sub-Store services<br/>[server.ts]"]
  node_webdav["WebDAV backup<br/>[backup.ts]"]
  node_plugin["Plugin client<br/>[index.ts]"]
end

subgraph group_telemetry["Network observability"]
  node_traffic_recorder["Traffic recorder<br/>[recorder.ts]"]
  node_traffic_db[("Traffic database<br/>[database-worker.ts]")]
end

node_user(("User"))
node_mihomo{{"Mihomo core"}}
node_gateway["Plugin gateway<br/>[server.mjs]"]
node_subscription(("Profile sources"))
node_backup_service(("WebDAV service"))

node_user -->|"uses"| node_renderer
node_renderer -->|"opens"| node_profile_ui
node_renderer -->|"opens"| node_settings_ui
node_profile_ui -->|"requests changes"| node_ipc
node_settings_ui -->|"requests settings"| node_ipc
node_traffic_ui -->|"requests traffic"| node_ipc
node_ipc -->|"invokes"| node_bridge
node_bridge -->|"dispatches IPC"| node_app_config
node_app_config -->|"supplies configuration"| node_core_manager
node_profile_config -->|"supplies profiles"| node_core_manager
node_simple -->|"compiles runtime config"| node_core_manager
node_core_manager -->|"starts and manages"| node_mihomo
node_core_manager -->|"starts API streams"| node_core_api
node_core_api -->|"queries and controls"| node_mihomo
node_core_manager -->|"coordinates runtime"| node_system
node_system -->|"configures proxy mode"| node_mihomo
node_smart -.->|"provides smart config"| node_core_manager
node_core_manager -->|"starts services"| node_substore
node_user -.->|"requests backup"| node_backup_service
node_backup_service -.->|"uses"| node_webdav
node_user -->|"selects source"| node_subscription
node_subscription -->|"provides profile"| node_profile_config
node_plugin -.->|"calls gateway"| node_gateway
node_core_api -->|"streams traffic"| node_traffic_recorder
node_traffic_recorder -->|"records samples"| node_traffic_db
node_traffic_ui -->|"queries aggregates"| node_traffic_db

click node_renderer "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/App.tsx"
click node_profile_ui "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/pages/profiles.tsx"
click node_settings_ui "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/pages/settings.tsx"
click node_bridge "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/preload/index.ts"
click node_ipc "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/utils/ipc.ts"
click node_app_config "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/config/app.ts"
click node_profile_config "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/config/profile.ts"
click node_simple "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/simple/service.ts"
click node_core_manager "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/core/manager.ts"
click node_core_api "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/core/mihomoApi.ts"
click node_system "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/sys/sysproxy.ts"
click node_smart "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/core/smartModel.ts"
click node_substore "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/resolve/server.ts"
click node_webdav "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/resolve/backup.ts"
click node_plugin "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/resolve/plugin/index.ts"
click node_gateway "https://github.com/mihomo-party-org/clash-party/blob/smart_core/deploy/gateway/src/server.mjs"
click node_traffic_recorder "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/traffic/recorder.ts"
click node_traffic_db "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/traffic/database-worker.ts"
click node_traffic_ui "https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/pages/traffic.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_renderer,node_profile_ui,node_settings_ui,node_bridge,node_ipc,node_traffic_ui,node_user toneBlue
class node_app_config,node_profile_config,node_simple toneAmber
class node_core_manager,node_core_api,node_system toneMint
class node_smart,node_substore,node_webdav,node_plugin toneRose
class node_traffic_recorder,node_traffic_db,node_mihomo,node_subscription,node_backup_service toneIndigo
class node_gateway toneTeal
```

## Components

### Desktop interface

- [Renderer app](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/App.tsx): `src/renderer/src/App.tsx`
- [Profiles UI](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/pages/profiles.tsx): `src/renderer/src/pages/profiles.tsx`
- [Settings UI](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/pages/settings.tsx): `src/renderer/src/pages/settings.tsx`
- [Preload IPC](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/preload/index.ts): `src/preload/index.ts`
- [Renderer IPC](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/utils/ipc.ts): `src/renderer/src/utils/ipc.ts`
- [Traffic views](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/renderer/src/pages/traffic.tsx): `src/renderer/src/pages/traffic.tsx`

### Configuration workflows

- [App configuration](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/config/app.ts): `src/main/config/app.ts`
- [Profiles and overrides](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/config/profile.ts): `src/main/config/profile.ts`
- [Simple mode compiler](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/simple/service.ts): `src/main/simple/service.ts`

### Mihomo runtime

- [Core manager](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/core/manager.ts): `src/main/core/manager.ts`
- [Mihomo API](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/core/mihomoApi.ts): `src/main/core/mihomoApi.ts`
- [System proxy and Tun](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/sys/sysproxy.ts): `src/main/sys/sysproxy.ts`

### Product integrations

- [Smart Core](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/core/smartModel.ts): `src/main/core/smartModel.ts`
- [Sub-Store services](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/resolve/server.ts): `src/main/resolve/server.ts`
- [WebDAV backup](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/resolve/backup.ts): `src/main/resolve/backup.ts`
- [Plugin client](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/resolve/plugin/index.ts): `src/main/resolve/plugin/index.ts`

### Network observability

- [Traffic recorder](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/traffic/recorder.ts): `src/main/traffic/recorder.ts`
- [Traffic database](https://github.com/mihomo-party-org/clash-party/blob/smart_core/src/main/traffic/database-worker.ts): `src/main/traffic/database-worker.ts`

### Other components

- **User**
- **Mihomo core**
- [Plugin gateway](https://github.com/mihomo-party-org/clash-party/blob/smart_core/deploy/gateway/src/server.mjs): `deploy/gateway/src/server.mjs`
- **Profile sources**
- **WebDAV service**

## Connections

- User → Renderer app: uses
- Renderer app → Profiles UI: opens
- Renderer app → Settings UI: opens
- Profiles UI → Renderer IPC: requests changes
- Settings UI → Renderer IPC: requests settings
- Traffic views → Renderer IPC: requests traffic
- Renderer IPC → Preload IPC: invokes
- Preload IPC → App configuration: dispatches IPC
- App configuration → Core manager: supplies configuration
- Profiles and overrides → Core manager: supplies profiles
- Simple mode compiler → Core manager: compiles runtime config
- Core manager → Mihomo core: starts and manages
- Core manager → Mihomo API: starts API streams
- Mihomo API → Mihomo core: queries and controls
- Core manager → System proxy and Tun: coordinates runtime
- System proxy and Tun → Mihomo core: configures proxy mode
- Smart Core → Core manager: provides smart config
- Core manager → Sub-Store services: starts services
- User → WebDAV service: requests backup
- WebDAV service → WebDAV backup: uses
- User → Profile sources: selects source
- Profile sources → Profiles and overrides: provides profile
- Plugin client → Plugin gateway: calls gateway
- Mihomo API → Traffic recorder: streams traffic
- Traffic recorder → Traffic database: records samples
- Traffic views → Traffic database: queries aggregates
