# maeneko/senboost architecture

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

- Interactive diagram: https://gitdiagram.com/maeneko/senboost
- Repository: https://github.com/maeneko/senboost

## Overview

SenBoost is an Electron desktop wrapper for zapret that lets users select and run a platform-specific packet-filtering strategy, manage lists and preferences, and check connectivity. The main process coordinates the window, tray, IPC, and recovery; the zapret layer selects a platform engine and prepares the strategy for it. The README documents Windows, macOS, and Linux backends, plus shared strategies. Some renderer-to-main IPC wiring and unsampled subsystems are represented only where documented or left unconnected; paths identify existing implementation files.

Main entry points: [`src/main/zapret/index.ts`](https://github.com/maeneko/senboost/blob/main/src/main/zapret/index.ts) (Zapret coordinator), [`src/main/index.ts`](https://github.com/maeneko/senboost/blob/main/src/main/index.ts) (Main process), [`src/main/zapret/paths.ts`](https://github.com/maeneko/senboost/blob/main/src/main/zapret/paths.ts) (Runtime paths), [`src/main/zapret/engine.ts`](https://github.com/maeneko/senboost/blob/main/src/main/zapret/engine.ts) (Engine state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["App view<br/>[App.tsx]"]
  node_zapret_card["Zapret controls<br/>[ZapretCard.tsx]"]
  node_settings_view["Settings view<br/>[SettingsView.tsx]"]
  node_list_editor["List editor<br/>[ListEditor.tsx]"]
  node_ui_hooks["Renderer hooks<br/>[useZapret.ts]"]
  node_diagnostics_hook["Diagnostics hook"]
  node_list_hooks["List hooks<br/>[useZapretLists.ts]"]
  node_list_meta["List metadata<br/>[zapretListMeta.ts]"]
end

subgraph group_shell["Application shell"]
  node_main["Main process<br/>[index.ts]"]
  node_ipc["IPC handlers<br/>[ipc.ts]"]
  node_preload["Preload bridge<br/>[index.ts]"]
  node_contract["IPC contract<br/>[ipc-contract.ts]"]
  node_window["Window lifecycle<br/>[window.ts]"]
  node_tray["System tray<br/>[tray.ts]"]
  node_autostart["Autostart<br/>[app-autostart.ts]"]
  node_settings[("App preferences<br/>[settings.ts]")]
end

subgraph group_control["Zapret control"]
  node_zapret_api["Zapret coordinator<br/>[index.ts]"]
  node_strategy["Strategy configuration<br/>[strategies.ts]"]
  node_lists[("User lists<br/>[lists.ts]")]
  node_diagnostics["Connectivity diagnostics<br/>[diagnostics.ts]"]
end

subgraph group_runtime["Platform runtimes"]
  node_engine_base["Engine state<br/>[engine.ts]"]
  node_windows_engine["Windows engine<br/>[engine.win32.ts]"]
  node_windows_service["Windows service<br/>[service.win32.ts]"]
  node_mac_engine["macOS engine<br/>[engine.darwin.ts]"]
  node_mac_runtime["utunws runtime<br/>[utunws.darwin.ts]"]
  node_linux_engine["Linux engine<br/>[engine.linux.ts]"]
  node_linux_runtime["nfqws runtime<br/>[nfqws.linux.ts]"]
  node_paths["Runtime paths<br/>[paths.ts]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_zapret_card
node_app -->|"renders"| node_settings_view
node_settings_view -->|"renders"| node_list_editor
node_settings_view -->|"uses"| node_list_hooks
node_settings_view -->|"uses"| node_list_meta
node_list_editor -->|"uses"| node_list_meta
node_zapret_card -->|"uses"| node_ui_hooks
node_zapret_card -->|"uses"| node_diagnostics_hook
node_ui_hooks -.->|"invokes API"| node_preload
node_diagnostics_hook -.->|"invokes API"| node_preload
node_list_hooks -.->|"invokes API"| node_preload
node_main -->|"registers"| node_ipc
node_main -->|"creates"| node_window
node_main -->|"creates"| node_tray
node_main -->|"loads"| node_settings
node_main -->|"recovers"| node_zapret_api
node_main -->|"follows"| node_autostart
node_ipc -->|"dispatches"| node_zapret_api
node_ipc -->|"uses"| node_settings
node_ipc -->|"uses types"| node_contract
node_preload -->|"uses types"| node_contract
node_tray -->|"starts or stops"| node_zapret_api
node_tray -->|"observes status"| node_engine_base
node_zapret_api -->|"selects on Windows"| node_windows_engine
node_zapret_api -->|"selects on macOS"| node_mac_engine
node_zapret_api -->|"selects on Linux"| node_linux_engine
node_zapret_api -->|"reads and edits"| node_lists
node_zapret_api -->|"lists strategies"| node_strategy
node_zapret_api -->|"runs checks"| node_diagnostics
node_zapret_api -->|"uses status API"| node_engine_base
node_engine_base -->|"persists preferences"| node_settings
node_windows_engine -->|"extends"| node_engine_base
node_windows_engine -->|"parses marker"| node_strategy
node_windows_engine -->|"queries or stops"| node_windows_service
node_windows_engine -->|"uses executable paths"| node_paths
node_mac_engine -->|"extends"| node_engine_base
node_mac_engine -->|"builds config"| node_strategy
node_mac_engine -->|"starts and stops"| node_mac_runtime
node_mac_engine -->|"checks executable"| node_paths
node_linux_engine -->|"extends"| node_engine_base
node_linux_engine -->|"builds config"| node_strategy
node_linux_engine -->|"starts and stops"| node_linux_runtime
node_linux_engine -->|"uses paths"| node_paths
node_windows_service -->|"uses service paths"| node_paths
node_mac_runtime -->|"uses paths"| node_paths
node_linux_runtime -->|"uses paths"| node_paths
node_strategy -->|"resolves list and fake paths"| node_paths

click node_app "https://github.com/maeneko/senboost/blob/main/src/renderer/src/App.tsx"
click node_zapret_card "https://github.com/maeneko/senboost/blob/main/src/renderer/src/components/ZapretCard.tsx"
click node_settings_view "https://github.com/maeneko/senboost/blob/main/src/renderer/src/components/SettingsView.tsx"
click node_list_editor "https://github.com/maeneko/senboost/blob/main/src/renderer/src/components/ListEditor.tsx"
click node_ui_hooks "https://github.com/maeneko/senboost/blob/main/src/renderer/src/hooks/useZapret.ts"
click node_diagnostics_hook "https://github.com/maeneko/senboost/blob/main/src/renderer/src/hooks/useZapretDiagnostics.ts"
click node_list_hooks "https://github.com/maeneko/senboost/blob/main/src/renderer/src/hooks/useZapretLists.ts"
click node_list_meta "https://github.com/maeneko/senboost/blob/main/src/renderer/src/lib/zapretListMeta.ts"
click node_main "https://github.com/maeneko/senboost/blob/main/src/main/index.ts"
click node_ipc "https://github.com/maeneko/senboost/blob/main/src/main/ipc.ts"
click node_preload "https://github.com/maeneko/senboost/blob/main/src/preload/index.ts"
click node_contract "https://github.com/maeneko/senboost/blob/main/src/shared/ipc-contract.ts"
click node_window "https://github.com/maeneko/senboost/blob/main/src/main/window.ts"
click node_tray "https://github.com/maeneko/senboost/blob/main/src/main/tray.ts"
click node_autostart "https://github.com/maeneko/senboost/blob/main/src/main/app-autostart.ts"
click node_settings "https://github.com/maeneko/senboost/blob/main/src/main/settings.ts"
click node_zapret_api "https://github.com/maeneko/senboost/blob/main/src/main/zapret/index.ts"
click node_strategy "https://github.com/maeneko/senboost/blob/main/src/main/zapret/strategies.ts"
click node_lists "https://github.com/maeneko/senboost/blob/main/src/main/zapret/lists.ts"
click node_diagnostics "https://github.com/maeneko/senboost/blob/main/src/main/zapret/diagnostics.ts"
click node_engine_base "https://github.com/maeneko/senboost/blob/main/src/main/zapret/engine.ts"
click node_windows_engine "https://github.com/maeneko/senboost/blob/main/src/main/zapret/engine.win32.ts"
click node_windows_service "https://github.com/maeneko/senboost/blob/main/src/main/zapret/service.win32.ts"
click node_mac_engine "https://github.com/maeneko/senboost/blob/main/src/main/zapret/engine.darwin.ts"
click node_mac_runtime "https://github.com/maeneko/senboost/blob/main/src/main/zapret/utunws.darwin.ts"
click node_linux_engine "https://github.com/maeneko/senboost/blob/main/src/main/zapret/engine.linux.ts"
click node_linux_runtime "https://github.com/maeneko/senboost/blob/main/src/main/zapret/nfqws.linux.ts"
click node_paths "https://github.com/maeneko/senboost/blob/main/src/main/zapret/paths.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_app,node_zapret_card,node_settings_view,node_list_editor,node_ui_hooks,node_diagnostics_hook,node_list_hooks,node_list_meta,node_user toneBlue
class node_main,node_ipc,node_preload,node_contract,node_window,node_tray,node_autostart,node_settings toneAmber
class node_zapret_api,node_strategy,node_lists,node_diagnostics toneMint
class node_engine_base,node_windows_engine,node_windows_service,node_mac_engine,node_mac_runtime,node_linux_engine,node_linux_runtime,node_paths toneRose
```

## Components

### Desktop interface

- [App view](https://github.com/maeneko/senboost/blob/main/src/renderer/src/App.tsx): `src/renderer/src/App.tsx`
- [Zapret controls](https://github.com/maeneko/senboost/blob/main/src/renderer/src/components/ZapretCard.tsx): `src/renderer/src/components/ZapretCard.tsx`
- [Settings view](https://github.com/maeneko/senboost/blob/main/src/renderer/src/components/SettingsView.tsx): `src/renderer/src/components/SettingsView.tsx`
- [List editor](https://github.com/maeneko/senboost/blob/main/src/renderer/src/components/ListEditor.tsx): `src/renderer/src/components/ListEditor.tsx`
- [Renderer hooks](https://github.com/maeneko/senboost/blob/main/src/renderer/src/hooks/useZapret.ts): `src/renderer/src/hooks/useZapret.ts`
- [Diagnostics hook](https://github.com/maeneko/senboost/blob/main/src/renderer/src/hooks/useZapretDiagnostics.ts): `src/renderer/src/hooks/useZapretDiagnostics.ts`
- [List hooks](https://github.com/maeneko/senboost/blob/main/src/renderer/src/hooks/useZapretLists.ts): `src/renderer/src/hooks/useZapretLists.ts`
- [List metadata](https://github.com/maeneko/senboost/blob/main/src/renderer/src/lib/zapretListMeta.ts): `src/renderer/src/lib/zapretListMeta.ts`

### Application shell

- [Main process](https://github.com/maeneko/senboost/blob/main/src/main/index.ts): `src/main/index.ts`
- [IPC handlers](https://github.com/maeneko/senboost/blob/main/src/main/ipc.ts): `src/main/ipc.ts`
- [Preload bridge](https://github.com/maeneko/senboost/blob/main/src/preload/index.ts): `src/preload/index.ts`
- [IPC contract](https://github.com/maeneko/senboost/blob/main/src/shared/ipc-contract.ts): `src/shared/ipc-contract.ts`
- [Window lifecycle](https://github.com/maeneko/senboost/blob/main/src/main/window.ts): `src/main/window.ts`
- [System tray](https://github.com/maeneko/senboost/blob/main/src/main/tray.ts): `src/main/tray.ts`
- [Autostart](https://github.com/maeneko/senboost/blob/main/src/main/app-autostart.ts): `src/main/app-autostart.ts`
- [App preferences](https://github.com/maeneko/senboost/blob/main/src/main/settings.ts): `src/main/settings.ts`

### Zapret control

- [Zapret coordinator](https://github.com/maeneko/senboost/blob/main/src/main/zapret/index.ts): `src/main/zapret/index.ts`
- [Strategy configuration](https://github.com/maeneko/senboost/blob/main/src/main/zapret/strategies.ts): `src/main/zapret/strategies.ts`
- [User lists](https://github.com/maeneko/senboost/blob/main/src/main/zapret/lists.ts): `src/main/zapret/lists.ts`
- [Connectivity diagnostics](https://github.com/maeneko/senboost/blob/main/src/main/zapret/diagnostics.ts): `src/main/zapret/diagnostics.ts`

### Platform runtimes

- [Engine state](https://github.com/maeneko/senboost/blob/main/src/main/zapret/engine.ts): `src/main/zapret/engine.ts`
- [Windows engine](https://github.com/maeneko/senboost/blob/main/src/main/zapret/engine.win32.ts): `src/main/zapret/engine.win32.ts`
- [Windows service](https://github.com/maeneko/senboost/blob/main/src/main/zapret/service.win32.ts): `src/main/zapret/service.win32.ts`
- [macOS engine](https://github.com/maeneko/senboost/blob/main/src/main/zapret/engine.darwin.ts): `src/main/zapret/engine.darwin.ts`
- [utunws runtime](https://github.com/maeneko/senboost/blob/main/src/main/zapret/utunws.darwin.ts): `src/main/zapret/utunws.darwin.ts`
- [Linux engine](https://github.com/maeneko/senboost/blob/main/src/main/zapret/engine.linux.ts): `src/main/zapret/engine.linux.ts`
- [nfqws runtime](https://github.com/maeneko/senboost/blob/main/src/main/zapret/nfqws.linux.ts): `src/main/zapret/nfqws.linux.ts`
- [Runtime paths](https://github.com/maeneko/senboost/blob/main/src/main/zapret/paths.ts): `src/main/zapret/paths.ts`

### Other components

- **User**

## Connections

- User → App view: uses
- App view → Zapret controls: renders (evidence: `src/renderer/src/App.tsx`)
- App view → Settings view: renders (evidence: `src/renderer/src/App.tsx`)
- Settings view → List editor: renders (evidence: `src/renderer/src/components/SettingsView.tsx`)
- Settings view → List hooks: uses (evidence: `src/renderer/src/components/SettingsView.tsx`)
- Settings view → List metadata: uses (evidence: `src/renderer/src/components/SettingsView.tsx`)
- List editor → List metadata: uses (evidence: `src/renderer/src/components/ListEditor.tsx`)
- Zapret controls → Renderer hooks: uses (evidence: `src/renderer/src/components/ZapretCard.tsx`)
- Zapret controls → Diagnostics hook: uses (evidence: `src/renderer/src/components/ZapretCard.tsx`)
- Renderer hooks → Preload bridge: invokes API
- Diagnostics hook → Preload bridge: invokes API
- List hooks → Preload bridge: invokes API
- Main process → IPC handlers: registers (evidence: `src/main/index.ts`)
- Main process → Window lifecycle: creates (evidence: `src/main/index.ts`)
- Main process → System tray: creates (evidence: `src/main/index.ts`)
- Main process → App preferences: loads (evidence: `src/main/index.ts`)
- Main process → Zapret coordinator: recovers (evidence: `src/main/index.ts`)
- Main process → Autostart: follows (evidence: `src/main/index.ts`)
- IPC handlers → Zapret coordinator: dispatches (evidence: `src/main/ipc.ts`)
- IPC handlers → App preferences: uses (evidence: `src/main/ipc.ts`)
- IPC handlers → IPC contract: uses types (evidence: `src/main/ipc.ts`)
- Preload bridge → IPC contract: uses types (evidence: `src/preload/index.ts`)
- System tray → Zapret coordinator: starts or stops (evidence: `src/main/tray.ts`)
- System tray → Engine state: observes status (evidence: `src/main/tray.ts`)
- Zapret coordinator → Windows engine: selects on Windows (evidence: `src/main/zapret/index.ts`)
- Zapret coordinator → macOS engine: selects on macOS (evidence: `src/main/zapret/index.ts`)
- Zapret coordinator → Linux engine: selects on Linux (evidence: `src/main/zapret/index.ts`)
- Zapret coordinator → User lists: reads and edits (evidence: `src/main/zapret/index.ts`)
- Zapret coordinator → Strategy configuration: lists strategies (evidence: `src/main/zapret/index.ts`)
- Zapret coordinator → Connectivity diagnostics: runs checks (evidence: `src/main/zapret/index.ts`)
- Zapret coordinator → Engine state: uses status API (evidence: `src/main/zapret/index.ts`)
- Engine state → App preferences: persists preferences (evidence: `src/main/zapret/engine.ts`)
- Windows engine → Engine state: extends (evidence: `src/main/zapret/engine.win32.ts`)
- Windows engine → Strategy configuration: parses marker (evidence: `src/main/zapret/engine.win32.ts`)
- Windows engine → Windows service: queries or stops (evidence: `src/main/zapret/engine.win32.ts`)
- Windows engine → Runtime paths: uses executable paths (evidence: `src/main/zapret/engine.win32.ts`)
- macOS engine → Engine state: extends (evidence: `src/main/zapret/engine.darwin.ts`)
- macOS engine → Strategy configuration: builds config (evidence: `src/main/zapret/engine.darwin.ts`)
- macOS engine → utunws runtime: starts and stops (evidence: `src/main/zapret/engine.darwin.ts`)
- macOS engine → Runtime paths: checks executable (evidence: `src/main/zapret/engine.darwin.ts`)
- Linux engine → Engine state: extends (evidence: `src/main/zapret/engine.linux.ts`)
- Linux engine → Strategy configuration: builds config (evidence: `src/main/zapret/engine.linux.ts`)
- Linux engine → nfqws runtime: starts and stops (evidence: `src/main/zapret/engine.linux.ts`)
- Linux engine → Runtime paths: uses paths
- Windows service → Runtime paths: uses service paths (evidence: `src/main/zapret/service.win32.ts`)
- utunws runtime → Runtime paths: uses paths (evidence: `src/main/zapret/utunws.darwin.ts`)
- nfqws runtime → Runtime paths: uses paths (evidence: `src/main/zapret/nfqws.linux.ts`)
- Strategy configuration → Runtime paths: resolves list and fake paths (evidence: `src/main/zapret/strategies.ts`)
