# metekraly3808/wand-enhancer-source architecture

> Architecture diagram of the GitHub repository metekraly3808/wand-enhancer-source, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/metekraly3808/wand-enhancer-source
- Repository: https://github.com/metekraly3808/wand-enhancer-source

## Overview

WandEnhancer is a Windows desktop tool for configuring and locally patching Wand, with an optional phone-accessible web panel. The main workflow is to find or select an installation, choose patch options in the desktop UI, and have the enhancer modify and repack the client before applying a launch strategy. A watcher can reapply patches after client updates. The panel communicates over a LAN HTTP/WebSocket bridge and exposes game, trainer, and remote-control features. Edges follow shown calls, source-index references, or README statements; some panel internals are unsampled, so their connections are left out or marked unverified.

Main entry points: [`WandEnhancer/Core/Enhancer.cs`](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Enhancer.cs) (Patch orchestration), [`WandEnhancer/Program.cs`](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Program.cs) (Application startup), [`WandEnhancer/View/MainWindow/MainWindowVm.cs`](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/View/MainWindow/MainWindowVm.cs) (Main window), [`web-panel/bridge/src/server.ts`](https://github.com/metekraly3808/wand-enhancer-source/blob/main/web-panel/bridge/src/server.ts) (LAN bridge server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop app"]
  node_program["Application startup<br/>[Program.cs]"]
  node_mainui["Main window<br/>[MainWindowVm.cs]"]
end

subgraph group_patching["Client patching"]
  node_enhancer["Patch orchestration<br/>[Enhancer.cs]"]
  node_patchconfig["Patch options<br/>[PatchConfig.cs]"]
  node_strategy["Launch strategy<br/>[StrategyFactory.cs]"]
  node_contentpatch["ASAR content patches"]
  node_injector["Panel and scripts"]
end

subgraph group_archive["Archive handling"]
  node_asar["ASAR extraction<br/>[AsarExtractor.cs]"]
  node_disk["Archive disk operations<br/>[Disk.cs]"]
  node_integrity["Archive integrity<br/>[IntegrityHelper.cs]"]
end

subgraph group_remote["Remote panel"]
  node_webapp["Web panel UI"]
  node_session["Remote session client"]
  node_protocol["Panel protocol<br/>[messages.ts]"]
  node_bridge["LAN bridge server<br/>[server.ts]"]
  node_normalizers["Payload normalizers<br/>[index.ts]"]
  node_browserstore[("Browser preferences<br/>[storage.ts]")]
end

subgraph group_services["Supporting services"]
  node_settings[("Settings<br/>[SettingsManager.cs]")]
  node_installs["Install discovery<br/>[WeModInstalls.cs]"]
  node_watcher["Update watcher"]
  node_localization["Localization"]
end

node_user(("Desktop user"))
node_paneluser(("Phone user"))
node_wand["Wand client"]

node_user -->|"launches"| node_program
node_program -->|"opens"| node_mainui
node_mainui -->|"starts patching"| node_enhancer
node_mainui -->|"finds installation"| node_installs
node_mainui -->|"loads settings"| node_settings
node_settings -->|"stores options"| node_patchconfig
node_program -->|"creates strategy"| node_strategy
node_enhancer -->|"reads options"| node_patchconfig
node_enhancer -->|"extracts archive"| node_asar
node_enhancer -->|"applies content patches"| node_contentpatch
node_enhancer -->|"injects panel and scripts"| node_injector
node_enhancer -->|"applies launch mode"| node_strategy
node_asar -->|"uses disk operations"| node_disk
node_disk -->|"checks integrity"| node_integrity
node_watcher -->|"reapplies patches"| node_enhancer
node_watcher -->|"resolves install"| node_installs
node_program -->|"starts watcher"| node_watcher
node_program -->|"initializes locale"| node_localization
node_paneluser -->|"uses panel"| node_webapp
node_webapp -.->|"uses session client"| node_session
node_session -->|"exchanges messages"| node_protocol
node_bridge -->|"routes messages"| node_protocol
node_bridge -->|"normalizes payloads"| node_normalizers
node_bridge -.->|"communicates with client"| node_wand
node_webapp -.->|"persists preferences"| node_browserstore

click node_program "https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Program.cs"
click node_mainui "https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/View/MainWindow/MainWindowVm.cs"
click node_settings "https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Services/SettingsManager.cs"
click node_installs "https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Utils/WeModInstalls.cs"
click node_enhancer "https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Enhancer.cs"
click node_patchconfig "https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Models/PatchConfig.cs"
click node_strategy "https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Patching/Strategies/StrategyFactory.cs"
click node_contentpatch "https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Patching/Content/AsarContentPatcher.cs"
click node_injector "https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Patching/Content/RemotePanelInjector.cs"
click node_asar "https://github.com/metekraly3808/wand-enhancer-source/blob/main/AsarSharp/AsarExtractor.cs"
click node_disk "https://github.com/metekraly3808/wand-enhancer-source/blob/main/AsarSharp/AsarFileSystem/Disk.cs"
click node_integrity "https://github.com/metekraly3808/wand-enhancer-source/blob/main/AsarSharp/Integrity/IntegrityHelper.cs"
click node_watcher "https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Services/UpdateWatcherService.cs"
click node_localization "https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Services/LocalizationManager.cs"
click node_webapp "https://github.com/metekraly3808/wand-enhancer-source/tree/main/web-panel/src/app"
click node_session "https://github.com/metekraly3808/wand-enhancer-source/blob/main/web-panel/src/remote-session/remote-session.client.ts"
click node_protocol "https://github.com/metekraly3808/wand-enhancer-source/blob/main/web-panel/protocol/messages.ts"
click node_bridge "https://github.com/metekraly3808/wand-enhancer-source/blob/main/web-panel/bridge/src/server.ts"
click node_normalizers "https://github.com/metekraly3808/wand-enhancer-source/blob/main/web-panel/bridge/src/normalizers/index.ts"
click node_browserstore "https://github.com/metekraly3808/wand-enhancer-source/blob/main/web-panel/src/shared/storage.ts"

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_program,node_mainui,node_user,node_paneluser,node_wand toneBlue
class node_enhancer,node_patchconfig,node_strategy,node_contentpatch,node_injector toneAmber
class node_asar,node_disk,node_integrity toneMint
class node_webapp,node_session,node_protocol,node_bridge,node_normalizers,node_browserstore toneRose
class node_settings,node_installs,node_watcher,node_localization toneIndigo
```

## Components

### Desktop app

- [Application startup](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Program.cs): `WandEnhancer/Program.cs`
- [Main window](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/View/MainWindow/MainWindowVm.cs): `WandEnhancer/View/MainWindow/MainWindowVm.cs`

### Client patching

- [Patch orchestration](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Enhancer.cs): `WandEnhancer/Core/Enhancer.cs`
- [Patch options](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Models/PatchConfig.cs): `WandEnhancer/Models/PatchConfig.cs`
- [Launch strategy](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Patching/Strategies/StrategyFactory.cs): `WandEnhancer/Core/Patching/Strategies/StrategyFactory.cs`
- [ASAR content patches](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Patching/Content/AsarContentPatcher.cs): `WandEnhancer/Core/Patching/Content/AsarContentPatcher.cs`
- [Panel and scripts](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Patching/Content/RemotePanelInjector.cs): `WandEnhancer/Core/Patching/Content/RemotePanelInjector.cs`

### Archive handling

- [ASAR extraction](https://github.com/metekraly3808/wand-enhancer-source/blob/main/AsarSharp/AsarExtractor.cs): `AsarSharp/AsarExtractor.cs`
- [Archive disk operations](https://github.com/metekraly3808/wand-enhancer-source/blob/main/AsarSharp/AsarFileSystem/Disk.cs): `AsarSharp/AsarFileSystem/Disk.cs`
- [Archive integrity](https://github.com/metekraly3808/wand-enhancer-source/blob/main/AsarSharp/Integrity/IntegrityHelper.cs): `AsarSharp/Integrity/IntegrityHelper.cs`

### Remote panel

- [Web panel UI](https://github.com/metekraly3808/wand-enhancer-source/tree/main/web-panel/src/app): `web-panel/src/app`
- [Remote session client](https://github.com/metekraly3808/wand-enhancer-source/blob/main/web-panel/src/remote-session/remote-session.client.ts): `web-panel/src/remote-session/remote-session.client.ts`
- [Panel protocol](https://github.com/metekraly3808/wand-enhancer-source/blob/main/web-panel/protocol/messages.ts): `web-panel/protocol/messages.ts`
- [LAN bridge server](https://github.com/metekraly3808/wand-enhancer-source/blob/main/web-panel/bridge/src/server.ts): `web-panel/bridge/src/server.ts`
- [Payload normalizers](https://github.com/metekraly3808/wand-enhancer-source/blob/main/web-panel/bridge/src/normalizers/index.ts): `web-panel/bridge/src/normalizers/index.ts`
- [Browser preferences](https://github.com/metekraly3808/wand-enhancer-source/blob/main/web-panel/src/shared/storage.ts): `web-panel/src/shared/storage.ts`

### Supporting services

- [Settings](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Services/SettingsManager.cs): `WandEnhancer/Core/Services/SettingsManager.cs`
- [Install discovery](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Utils/WeModInstalls.cs): `WandEnhancer/Utils/WeModInstalls.cs`
- [Update watcher](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Services/UpdateWatcherService.cs): `WandEnhancer/Core/Services/UpdateWatcherService.cs`
- [Localization](https://github.com/metekraly3808/wand-enhancer-source/blob/main/WandEnhancer/Core/Services/LocalizationManager.cs): `WandEnhancer/Core/Services/LocalizationManager.cs`

### Other components

- **Desktop user**
- **Phone user**
- **Wand client**

## Connections

- Desktop user → Application startup: launches (evidence: `WandEnhancer/Program.cs`)
- Application startup → Main window: opens (evidence: `WandEnhancer/Program.cs`)
- Main window → Patch orchestration: starts patching (evidence: `WandEnhancer/View/MainWindow/MainWindowVm.cs`)
- Main window → Install discovery: finds installation (evidence: `WandEnhancer/View/MainWindow/MainWindowVm.cs`)
- Main window → Settings: loads settings (evidence: `WandEnhancer/View/MainWindow/MainWindowVm.cs`)
- Settings → Patch options: stores options (evidence: `WandEnhancer/Core/Services/SettingsManager.cs`)
- Application startup → Launch strategy: creates strategy (evidence: `WandEnhancer/Program.cs`)
- Patch orchestration → Patch options: reads options (evidence: `WandEnhancer/Core/Enhancer.cs`)
- Patch orchestration → ASAR extraction: extracts archive (evidence: `WandEnhancer/Core/Enhancer.cs`)
- Patch orchestration → ASAR content patches: applies content patches (evidence: `WandEnhancer/Core/Enhancer.cs`)
- Patch orchestration → Panel and scripts: injects panel and scripts (evidence: `WandEnhancer/Core/Enhancer.cs`)
- Patch orchestration → Launch strategy: applies launch mode (evidence: `WandEnhancer/Core/Enhancer.cs`)
- ASAR extraction → Archive disk operations: uses disk operations (evidence: `AsarSharp/AsarExtractor.cs`)
- Archive disk operations → Archive integrity: checks integrity (evidence: `AsarSharp/AsarFileSystem/Disk.cs`)
- Update watcher → Patch orchestration: reapplies patches (evidence: `WandEnhancer/Core/Services/UpdateWatcherService.cs`)
- Update watcher → Install discovery: resolves install (evidence: `WandEnhancer/Core/Services/UpdateWatcherService.cs`)
- Application startup → Update watcher: starts watcher (evidence: `WandEnhancer/Program.cs`)
- Application startup → Localization: initializes locale
- Phone user → Web panel UI: uses panel (evidence: `README.md`)
- Web panel UI → Remote session client: uses session client
- Remote session client → Panel protocol: exchanges messages (evidence: `web-panel/src/remote-session/remote-session.client.ts`)
- LAN bridge server → Panel protocol: routes messages
- LAN bridge server → Payload normalizers: normalizes payloads (evidence: `web-panel/bridge/src/server.ts`)
- LAN bridge server → Wand client: communicates with client
- Web panel UI → Browser preferences: persists preferences
