# spoofdpiapp/spoofdpi-app architecture

> Architecture diagram of the GitHub repository spoofdpiapp/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/spoofdpiapp/spoofdpi-app
- Repository: https://github.com/spoofdpiapp/spoofdpi-app

## Overview

SpoofDPI App is a macOS menu-bar utility that launches the bundled SpoofDPI process to restore access to services such as YouTube. Users control protection and its parameters through the main window or menu-bar switch; the protection service monitors and restarts the process. The app also provides automatic launch, window/menu-bar behavior, and update checks. Source excerpts show the app startup and protection flows; several other service relationships are known only from the SOURCE INDEX, so uncertain wiring is omitted.

Main entry points: [`SpoofDPI App/App.swift`](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/App.swift) (App lifecycle), [`SpoofDPI App/Framework/Services/MenuBarIconService.swift`](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/MenuBarIconService.swift) (Menu-bar controls), [`SpoofDPI App/Framework/Services/ProtectionService.swift`](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/ProtectionService.swift) (Protection manager), [`SpoofDPI App/Scenes/MainScene.ContentView.swift`](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Scenes/MainScene.ContentView.swift) (Main window UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_app["App lifecycle<br/>[App.swift]"]
  node_scene["Main scene<br/>[MainScene.swift]"]
  node_content["Main window UI"]
  node_menubar["Menu-bar controls"]
end

subgraph group_protection["Protection runtime"]
  node_protection["Protection manager"]
  node_dpi["SpoofDPI process"]
end

subgraph group_services["App services"]
  node_settings["Persistent settings"]
  node_autolaunch["Automatic launch"]
  node_updates["Update checker"]
  node_window["Window behavior"]
end

subgraph group_internal["Shared framework"]
  node_extensions["Framework extensions"]
  node_configurable["Configurable support<br/>[Configurable.swift]"]
  node_utils["Process utilities<br/>[Utils.swift]"]
  node_localized["Localized strings"]
  node_symbols["System symbols<br/>[SystemSymbol.swift]"]
end

node_user(("Mac user"))
node_terminal["macOS process control"]
node_buildnumber["Build number feed"]

node_user -->|"configures"| node_content
node_user -->|"controls"| node_menubar
node_app -->|"creates"| node_scene
node_app -->|"initializes"| node_autolaunch
node_app -->|"initializes"| node_menubar
node_app -->|"initializes"| node_protection
node_app -->|"initializes"| node_updates
node_app -->|"initializes"| node_window
node_app -->|"stops on exit"| node_protection
node_scene -->|"displays"| node_content
node_content -->|"reads status"| node_protection
node_content -->|"reads and updates"| node_settings
node_menubar -->|"observes and updates"| node_settings
node_menubar -->|"observes status"| node_protection
node_menubar -->|"opens window"| node_window
node_protection -->|"observes parameters"| node_settings
node_protection -->|"runs process commands"| node_utils
node_protection -->|"launches or stops"| node_dpi
node_utils -.->|"executes commands"| node_terminal
node_updates -->|"fetches build number"| node_buildnumber
node_updates -->|"stores latest build"| node_settings
node_updates -->|"opens alert window"| node_window
node_autolaunch -.->|"uses settings"| node_settings
node_autolaunch -.->|"uses window"| node_window
node_extensions -.->|"supports"| node_configurable
node_content -->|"uses labels"| node_localized
node_menubar -->|"uses labels"| node_localized
node_menubar -->|"uses icons"| node_symbols

click node_app "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/App.swift"
click node_scene "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Scenes/MainScene.swift"
click node_content "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Scenes/MainScene.ContentView.swift"
click node_menubar "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/MenuBarIconService.swift"
click node_settings "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/SettingsService.swift"
click node_protection "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/ProtectionService.swift"
click node_dpi "https://github.com/spoofdpiapp/spoofdpi-app/tree/main/SpoofDPI%20App/Other/Binaries"
click node_autolaunch "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/AutoLaunchService.swift"
click node_updates "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/UpdateService.swift"
click node_window "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/WindowService.swift"
click node_extensions "https://github.com/spoofdpiapp/spoofdpi-app/tree/main/SpoofDPI%20App/Framework/Extensions"
click node_configurable "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Configurable.swift"
click node_utils "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Utils.swift"
click node_localized "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Other/LocalizedString.swift"
click node_symbols "https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Other/SystemSymbol.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_scene,node_content,node_menubar,node_user toneBlue
class node_protection,node_dpi toneAmber
class node_settings,node_autolaunch,node_updates,node_window toneMint
class node_extensions,node_configurable,node_utils,node_localized,node_symbols toneRose
class node_terminal,node_buildnumber toneIndigo
```

## Components

### App experience

- [App lifecycle](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/App.swift): `SpoofDPI App/App.swift`
- [Main scene](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Scenes/MainScene.swift): `SpoofDPI App/Scenes/MainScene.swift`
- [Main window UI](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Scenes/MainScene.ContentView.swift): `SpoofDPI App/Scenes/MainScene.ContentView.swift`
- [Menu-bar controls](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/MenuBarIconService.swift): `SpoofDPI App/Framework/Services/MenuBarIconService.swift`

### Protection runtime

- [Protection manager](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/ProtectionService.swift): `SpoofDPI App/Framework/Services/ProtectionService.swift`
- [SpoofDPI process](https://github.com/spoofdpiapp/spoofdpi-app/tree/main/SpoofDPI%20App/Other/Binaries): `SpoofDPI App/Other/Binaries`

### App services

- [Persistent settings](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/SettingsService.swift): `SpoofDPI App/Framework/Services/SettingsService.swift`
- [Automatic launch](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/AutoLaunchService.swift): `SpoofDPI App/Framework/Services/AutoLaunchService.swift`
- [Update checker](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/UpdateService.swift): `SpoofDPI App/Framework/Services/UpdateService.swift`
- [Window behavior](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Services/WindowService.swift): `SpoofDPI App/Framework/Services/WindowService.swift`

### Shared framework

- [Framework extensions](https://github.com/spoofdpiapp/spoofdpi-app/tree/main/SpoofDPI%20App/Framework/Extensions): `SpoofDPI App/Framework/Extensions`
- [Configurable support](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Configurable.swift): `SpoofDPI App/Framework/Configurable.swift`
- [Process utilities](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Framework/Utils.swift): `SpoofDPI App/Framework/Utils.swift`
- [Localized strings](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Other/LocalizedString.swift): `SpoofDPI App/Other/LocalizedString.swift`
- [System symbols](https://github.com/spoofdpiapp/spoofdpi-app/blob/main/SpoofDPI%20App/Other/SystemSymbol.swift): `SpoofDPI App/Other/SystemSymbol.swift`

### Other components

- **Mac user**
- **macOS process control**
- **Build number feed**

## Connections

- Mac user → Main window UI: configures (evidence: `README.md`)
- Mac user → Menu-bar controls: controls (evidence: `SpoofDPI App/Framework/Services/MenuBarIconService.swift`)
- App lifecycle → Main scene: creates (evidence: `SpoofDPI App/App.swift`)
- App lifecycle → Automatic launch: initializes (evidence: `SpoofDPI App/App.swift`)
- App lifecycle → Menu-bar controls: initializes (evidence: `SpoofDPI App/App.swift`)
- App lifecycle → Protection manager: initializes (evidence: `SpoofDPI App/App.swift`)
- App lifecycle → Update checker: initializes (evidence: `SpoofDPI App/App.swift`)
- App lifecycle → Window behavior: initializes (evidence: `SpoofDPI App/App.swift`)
- App lifecycle → Protection manager: stops on exit (evidence: `SpoofDPI App/App.swift`)
- Main scene → Main window UI: displays (evidence: `SpoofDPI App/Scenes/MainScene.swift`)
- Main window UI → Protection manager: reads status (evidence: `SpoofDPI App/Scenes/MainScene.ContentView.swift`)
- Main window UI → Persistent settings: reads and updates (evidence: `SpoofDPI App/Scenes/MainScene.ContentView.swift`)
- Menu-bar controls → Persistent settings: observes and updates (evidence: `SpoofDPI App/Framework/Services/MenuBarIconService.swift`)
- Menu-bar controls → Protection manager: observes status (evidence: `SpoofDPI App/Framework/Services/MenuBarIconService.swift`)
- Menu-bar controls → Window behavior: opens window (evidence: `SpoofDPI App/Framework/Services/MenuBarIconService.swift`)
- Protection manager → Persistent settings: observes parameters (evidence: `SpoofDPI App/Framework/Services/ProtectionService.swift`)
- Protection manager → Process utilities: runs process commands (evidence: `SpoofDPI App/Framework/Services/ProtectionService.swift`)
- Protection manager → SpoofDPI process: launches or stops (evidence: `SpoofDPI App/Framework/Services/ProtectionService.swift`)
- Process utilities → macOS process control: executes commands
- Update checker → Build number feed: fetches build number (evidence: `SpoofDPI App/Framework/Services/UpdateService.swift`)
- Update checker → Persistent settings: stores latest build (evidence: `SpoofDPI App/Framework/Services/UpdateService.swift`)
- Update checker → Window behavior: opens alert window (evidence: `SpoofDPI App/Framework/Services/UpdateService.swift`)
- Automatic launch → Persistent settings: uses settings (evidence: `SpoofDPI App/Framework/Services/AutoLaunchService.swift`)
- Automatic launch → Window behavior: uses window (evidence: `SpoofDPI App/Framework/Services/AutoLaunchService.swift`)
- Framework extensions → Configurable support: supports (evidence: `SpoofDPI App/Framework/Extensions/NSObject.swift`)
- Main window UI → Localized strings: uses labels (evidence: `SpoofDPI App/Scenes/MainScene.ContentView.swift`)
- Menu-bar controls → Localized strings: uses labels (evidence: `SpoofDPI App/Framework/Services/MenuBarIconService.swift`)
- Menu-bar controls → System symbols: uses icons (evidence: `SpoofDPI App/Framework/Services/MenuBarIconService.swift`)
