# dnschanger/dnschanger-desktop architecture

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

- Interactive diagram: https://gitdiagram.com/dnschanger/dnschanger-desktop
- Repository: https://github.com/dnschanger/dnschanger-desktop

## Overview

dnsChanger is a cross-platform desktop DNS manager. Users browse and manage DNS servers, connect or disconnect to change system DNS, and can configure preferences or use tools such as benchmarking, network switching, DNS flushing, and scheduled shutdown. Electron IPC bridges the React UI to main-process handlers, which use persistent settings and platform-specific network operations. The graph preserves README-level product scope and documented IPC capabilities; relationships for unsampled feature handlers are shown only where the supplied index or excerpts support them.

Main entry points: [`src/renderer/app.tsx`](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/renderer/app.tsx) (App shell), [`src/preload/index.ts`](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/preload/index.ts) (Preload API), [`src/main/ipc`](https://github.com/dnschanger/dnschanger-desktop/tree/main/src/main/ipc) (IPC handlers), [`src/main/store/store.ts`](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/store/store.ts) (Application store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["App shell<br/>[app.tsx]"]
  node_pages["Product pages"]
  node_settings["Settings screen<br/>[setting.page.tsx]"]
  node_explore["Server exploration<br/>[explore.page.tsx]"]
  node_home["DNS home<br/>[home.page.tsx]"]
  node_tools["Network tools"]
  node_servercards["Server cards"]
end

subgraph group_bridge["Electron integration"]
  node_preload["Preload API<br/>[index.ts]"]
  node_main["Electron main<br/>[index.ts]"]
  node_ipc["IPC handlers"]
  node_keys["IPC event keys"]
end

subgraph group_dns["DNS operations"]
  node_dnsservice["DNS service<br/>[dns.service.ts]"]
  node_platform["Platform contract<br/>[platform.ts]"]
  node_windows["Windows operations"]
  node_linux["Linux operations<br/>[linux.platform.ts]"]
  node_mac["macOS operations<br/>[mac.platform.ts]"]
  node_benchmark["DNS benchmark"]
end

subgraph group_state["Persistence and services"]
  node_store[("Application store<br/>[store.ts]")]
  node_settingsdata["Settings model"]
  node_serverdata["Server model"]
  node_shutdown["Scheduled shutdown<br/>[shutdown.ts]"]
  node_updates["Update service<br/>[update.ts]"]
end

subgraph group_localization["Localization"]
  node_i18n["Translation runtime<br/>[i18n-util.ts]"]
  node_locale["Locale loading<br/>[i18n-util.async.ts]"]
  node_translations["Locale dictionaries"]
end

node_user(("Desktop user"))
node_os(("Operating system"))

node_user -->|"uses"| node_app
node_app -->|"selects page"| node_pages
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_explore
node_app -->|"renders"| node_home
node_app -->|"renders"| node_tools
node_home -->|"uses"| node_servercards
node_app -->|"calls exposed API"| node_preload
node_preload -->|"dispatches events"| node_keys
node_main -->|"loads handlers"| node_ipc
node_preload -.->|"IPC requests"| node_ipc
node_ipc -.->|"runs DNS actions"| node_dnsservice
node_dnsservice -->|"delegates"| node_platform
node_windows -->|"implements"| node_platform
node_linux -.->|"implements"| node_platform
node_mac -.->|"implements"| node_platform
node_os -->|"system commands"| node_windows
node_dnsservice -.->|"benchmarks servers"| node_benchmark
node_ipc -->|"reads and writes"| node_store
node_main -->|"reads settings"| node_store
node_store -->|"stores"| node_settingsdata
node_store -->|"stores"| node_serverdata
node_preload -->|"exposes store access"| node_store
node_settings -.->|"requests preferences"| node_preload
node_tools -.->|"invokes tool actions"| node_preload
node_ipc -->|"registers shutdown"| node_shutdown
node_main -->|"starts updates"| node_updates
node_app -->|"loads locale"| node_locale
node_locale -->|"loads dictionaries"| node_translations
node_app -->|"provides translations"| node_i18n

click node_app "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/renderer/app.tsx"
click node_pages "https://github.com/dnschanger/dnschanger-desktop/tree/main/src/renderer/pages"
click node_settings "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/renderer/pages/setting.page.tsx"
click node_explore "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/renderer/pages/explore.page.tsx"
click node_home "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/renderer/pages/home.page.tsx"
click node_tools "https://github.com/dnschanger/dnschanger-desktop/tree/main/src/renderer/pages/tools"
click node_servercards "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/renderer/component/cards/server.card.component.tsx"
click node_preload "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/preload/index.ts"
click node_main "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/index.ts"
click node_ipc "https://github.com/dnschanger/dnschanger-desktop/tree/main/src/main/ipc"
click node_keys "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/shared/constants/eventsKeys.constant.ts"
click node_dnsservice "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/services/dns.service.ts"
click node_platform "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/platforms/platform.ts"
click node_windows "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/platforms/windows/windows.platform.ts"
click node_linux "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/platforms/linux/linux.platform.ts"
click node_mac "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/platforms/mac/mac.platform.ts"
click node_benchmark "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/services/dns-benchmark.service.ts"
click node_store "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/store/store.ts"
click node_settingsdata "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/shared/interfaces/settings.interface.ts"
click node_serverdata "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/shared/interfaces/server.interface.ts"
click node_shutdown "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/ipc/shutdown.ts"
click node_updates "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/update.ts"
click node_i18n "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/i18n/i18n-util.ts"
click node_locale "https://github.com/dnschanger/dnschanger-desktop/blob/main/src/i18n/i18n-util.async.ts"
click node_translations "https://github.com/dnschanger/dnschanger-desktop/tree/main/src/i18n"

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_pages,node_settings,node_explore,node_home,node_tools,node_servercards,node_user toneBlue
class node_preload,node_main,node_ipc,node_keys toneAmber
class node_dnsservice,node_platform,node_windows,node_linux,node_mac,node_benchmark toneMint
class node_store,node_settingsdata,node_serverdata,node_shutdown,node_updates toneRose
class node_i18n,node_locale,node_translations,node_os toneIndigo
```

## Components

### Desktop interface

- [App shell](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/renderer/app.tsx): `src/renderer/app.tsx`
- [Product pages](https://github.com/dnschanger/dnschanger-desktop/tree/main/src/renderer/pages): `src/renderer/pages`
- [Settings screen](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/renderer/pages/setting.page.tsx): `src/renderer/pages/setting.page.tsx`
- [Server exploration](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/renderer/pages/explore.page.tsx): `src/renderer/pages/explore.page.tsx`
- [DNS home](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/renderer/pages/home.page.tsx): `src/renderer/pages/home.page.tsx`
- [Network tools](https://github.com/dnschanger/dnschanger-desktop/tree/main/src/renderer/pages/tools): `src/renderer/pages/tools`
- [Server cards](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/renderer/component/cards/server.card.component.tsx): `src/renderer/component/cards/server.card.component.tsx`

### Electron integration

- [Preload API](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/preload/index.ts): `src/preload/index.ts`
- [Electron main](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/index.ts): `src/main/index.ts`
- [IPC handlers](https://github.com/dnschanger/dnschanger-desktop/tree/main/src/main/ipc): `src/main/ipc`
- [IPC event keys](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/shared/constants/eventsKeys.constant.ts): `src/shared/constants/eventsKeys.constant.ts`

### DNS operations

- [DNS service](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/services/dns.service.ts): `src/main/services/dns.service.ts`
- [Platform contract](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/platforms/platform.ts): `src/main/platforms/platform.ts`
- [Windows operations](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/platforms/windows/windows.platform.ts): `src/main/platforms/windows/windows.platform.ts`
- [Linux operations](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/platforms/linux/linux.platform.ts): `src/main/platforms/linux/linux.platform.ts`
- [macOS operations](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/platforms/mac/mac.platform.ts): `src/main/platforms/mac/mac.platform.ts`
- [DNS benchmark](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/services/dns-benchmark.service.ts): `src/main/services/dns-benchmark.service.ts`

### Persistence and services

- [Application store](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/store/store.ts): `src/main/store/store.ts`
- [Settings model](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/shared/interfaces/settings.interface.ts): `src/shared/interfaces/settings.interface.ts`
- [Server model](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/shared/interfaces/server.interface.ts): `src/shared/interfaces/server.interface.ts`
- [Scheduled shutdown](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/ipc/shutdown.ts): `src/main/ipc/shutdown.ts`
- [Update service](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/main/update.ts): `src/main/update.ts`

### Localization

- [Translation runtime](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/i18n/i18n-util.ts): `src/i18n/i18n-util.ts`
- [Locale loading](https://github.com/dnschanger/dnschanger-desktop/blob/main/src/i18n/i18n-util.async.ts): `src/i18n/i18n-util.async.ts`
- [Locale dictionaries](https://github.com/dnschanger/dnschanger-desktop/tree/main/src/i18n): `src/i18n`

### Other components

- **Desktop user**
- **Operating system**

## Connections

- Desktop user → App shell: uses (evidence: `src/renderer/app.tsx`)
- App shell → Product pages: selects page (evidence: `src/renderer/app.tsx`)
- App shell → Settings screen: renders (evidence: `src/renderer/app.tsx`)
- App shell → Server exploration: renders (evidence: `src/renderer/app.tsx`)
- App shell → DNS home: renders (evidence: `src/renderer/app.tsx`)
- App shell → Network tools: renders (evidence: `src/renderer/app.tsx`)
- DNS home → Server cards: uses (evidence: `src/renderer/component/cards/server.card.component.tsx`)
- App shell → Preload API: calls exposed API (evidence: `src/renderer/app.tsx`)
- Preload API → IPC event keys: dispatches events (evidence: `src/preload/index.ts`)
- Electron main → IPC handlers: loads handlers (evidence: `src/main/index.ts`)
- Preload API → IPC handlers: IPC requests
- IPC handlers → DNS service: runs DNS actions
- DNS service → Platform contract: delegates (evidence: `src/main/services/dns.service.ts`)
- Windows operations → Platform contract: implements (evidence: `src/main/platforms/windows/windows.platform.ts`)
- Linux operations → Platform contract: implements
- macOS operations → Platform contract: implements
- Operating system → Windows operations: system commands (evidence: `src/main/platforms/windows/windows.platform.ts`)
- DNS service → DNS benchmark: benchmarks servers
- IPC handlers → Application store: reads and writes (evidence: `src/main/ipc/dialogs.ts`)
- Electron main → Application store: reads settings (evidence: `src/main/index.ts`)
- Application store → Settings model: stores (evidence: `src/main/store/store.ts`)
- Application store → Server model: stores (evidence: `src/main/store/store.ts`)
- Preload API → Application store: exposes store access (evidence: `src/preload/index.ts`)
- Settings screen → Preload API: requests preferences
- Network tools → Preload API: invokes tool actions
- IPC handlers → Scheduled shutdown: registers shutdown (evidence: `src/main/index.ts`)
- Electron main → Update service: starts updates (evidence: `src/main/index.ts`)
- App shell → Locale loading: loads locale (evidence: `src/renderer/app.tsx`)
- Locale loading → Locale dictionaries: loads dictionaries (evidence: `src/i18n/i18n-util.async.ts`)
- App shell → Translation runtime: provides translations (evidence: `src/renderer/app.tsx`)
