# elvich/spoofdpi-app architecture

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

- Interactive diagram: https://gitdiagram.com/elvich/spoofdpi-app
- Repository: https://github.com/elvich/spoofdpi-app

## Overview

SpoofDPI-App is a macOS control and configuration wrapper for the SpoofDPI terminal binary. The user enables the proxy in the main window or menu-bar control; the app ensures the binary is installed, starts it with system-proxy, IPv4-DNS-only, and configured window-size arguments, and surfaces process output/errors. Settings cover network behavior, appearance, and Dock visibility. Edges reflect calls or view composition shown in excerpts, plus the README's stated product purpose; the binary's internals are not sampled.

Main entry points: [`spoofdpiApp/SpoofDPIManager.swift`](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/SpoofDPIManager.swift) (Proxy manager), [`spoofdpiApp/spoofdpiAppApp.swift`](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/spoofdpiAppApp.swift) (App shell), [`spoofdpiApp/ContentView.swift`](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/ContentView.swift) (Main window), [`spoofdpiApp/Settings/SettingsView.swift`](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Settings/SettingsView.swift) (Settings tabs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lifecycle["App lifecycle"]
  node_app["App shell"]
end

subgraph group_proxy["Proxy control"]
  node_manager["Proxy manager"]
  node_binary["SpoofDPI binary"]
  node_process["Running process"]
end

subgraph group_settings["Settings"]
  node_settings["Settings tabs<br/>[SettingsView.swift]"]
  node_network["Network settings"]
  node_appsettings["App settings"]
  node_visual["Visual settings"]
end

subgraph group_presentation["Presentation"]
  node_main["Main window<br/>[ContentView.swift]"]
  node_background["ASCII background"]
  node_toggle["Proxy toggle"]
  node_color["Color conversion<br/>[ColorHex.swift]"]
end

node_user(("Mac user"))
node_macos["macOS services"]

node_user -->|"controls"| node_main
node_app -->|"opens"| node_main
node_app -->|"creates"| node_manager
node_app -->|"opens"| node_settings
node_app -->|"installs binary"| node_manager
node_main -->|"controls"| node_manager
node_main -->|"renders"| node_background
node_main -->|"styles toggle"| node_toggle
node_manager -->|"copies and runs"| node_binary
node_manager -->|"starts and stops"| node_process
node_process -->|"streams output"| node_manager
node_settings -->|"embeds"| node_network
node_settings -->|"embeds"| node_appsettings
node_settings -->|"embeds"| node_visual
node_network -.->|"sets window size"| node_manager
node_appsettings -->|"changes Dock policy"| node_macos
node_visual -->|"converts colors"| node_color
node_background -->|"parses accent"| node_color
node_toggle -->|"parses accent"| node_color
node_app -->|"provides menu bar"| node_macos

click node_app "https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/spoofdpiAppApp.swift"
click node_main "https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/ContentView.swift"
click node_manager "https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/SpoofDPIManager.swift"
click node_binary "https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Resources/spoofdpi-terminal"
click node_background "https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/BackgroundView.swift"
click node_toggle "https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/CustomToggleStyle.swift"
click node_settings "https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Settings/SettingsView.swift"
click node_network "https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Settings/NetworkSettingsView.swift"
click node_appsettings "https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Settings/AppSettingsView.swift"
click node_visual "https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Settings/VisualSettingsView.swift"
click node_color "https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Settings/ColorHex.swift"

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_user toneBlue
class node_manager,node_binary,node_process toneAmber
class node_settings,node_network,node_appsettings,node_visual toneMint
class node_main,node_background,node_toggle,node_color toneRose
class node_macos toneIndigo
```

## Components

### App lifecycle

- [App shell](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/spoofdpiAppApp.swift): `spoofdpiApp/spoofdpiAppApp.swift`

### Proxy control

- [Proxy manager](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/SpoofDPIManager.swift): `spoofdpiApp/SpoofDPIManager.swift`
- [SpoofDPI binary](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Resources/spoofdpi-terminal): `spoofdpiApp/Resources/spoofdpi-terminal`
- **Running process**

### Settings

- [Settings tabs](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Settings/SettingsView.swift): `spoofdpiApp/Settings/SettingsView.swift`
- [Network settings](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Settings/NetworkSettingsView.swift): `spoofdpiApp/Settings/NetworkSettingsView.swift`
- [App settings](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Settings/AppSettingsView.swift): `spoofdpiApp/Settings/AppSettingsView.swift`
- [Visual settings](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Settings/VisualSettingsView.swift): `spoofdpiApp/Settings/VisualSettingsView.swift`

### Presentation

- [Main window](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/ContentView.swift): `spoofdpiApp/ContentView.swift`
- [ASCII background](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/BackgroundView.swift): `spoofdpiApp/BackgroundView.swift`
- [Proxy toggle](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/CustomToggleStyle.swift): `spoofdpiApp/CustomToggleStyle.swift`
- [Color conversion](https://github.com/elvich/spoofdpi-app/blob/main/spoofdpiApp/Settings/ColorHex.swift): `spoofdpiApp/Settings/ColorHex.swift`

### Other components

- **Mac user**
- **macOS services**

## Connections

- Mac user → Main window: controls (evidence: `spoofdpiApp/ContentView.swift`)
- App shell → Main window: opens (evidence: `spoofdpiApp/spoofdpiAppApp.swift`)
- App shell → Proxy manager: creates (evidence: `spoofdpiApp/spoofdpiAppApp.swift`)
- App shell → Settings tabs: opens (evidence: `spoofdpiApp/spoofdpiAppApp.swift`)
- App shell → Proxy manager: installs binary (evidence: `spoofdpiApp/spoofdpiAppApp.swift`)
- Main window → Proxy manager: controls (evidence: `spoofdpiApp/ContentView.swift`)
- Main window → ASCII background: renders (evidence: `spoofdpiApp/ContentView.swift`)
- Main window → Proxy toggle: styles toggle (evidence: `spoofdpiApp/ContentView.swift`)
- Proxy manager → SpoofDPI binary: copies and runs (evidence: `spoofdpiApp/SpoofDPIManager.swift`)
- Proxy manager → Running process: starts and stops (evidence: `spoofdpiApp/SpoofDPIManager.swift`)
- Running process → Proxy manager: streams output (evidence: `spoofdpiApp/SpoofDPIManager.swift`)
- Settings tabs → Network settings: embeds (evidence: `spoofdpiApp/Settings/SettingsView.swift`)
- Settings tabs → App settings: embeds (evidence: `spoofdpiApp/Settings/SettingsView.swift`)
- Settings tabs → Visual settings: embeds (evidence: `spoofdpiApp/Settings/SettingsView.swift`)
- Network settings → Proxy manager: sets window size
- App settings → macOS services: changes Dock policy (evidence: `spoofdpiApp/Settings/AppSettingsView.swift`)
- Visual settings → Color conversion: converts colors (evidence: `spoofdpiApp/Settings/VisualSettingsView.swift`)
- ASCII background → Color conversion: parses accent (evidence: `spoofdpiApp/BackgroundView.swift`)
- Proxy toggle → Color conversion: parses accent (evidence: `spoofdpiApp/CustomToggleStyle.swift`)
- App shell → macOS services: provides menu bar (evidence: `spoofdpiApp/spoofdpiAppApp.swift`)
