# jensyleo/hardwaresentry architecture

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

- Interactive diagram: https://gitdiagram.com/jensyleo/hardwaresentry
- Repository: https://github.com/jensyleo/hardwaresentry

## Overview

HardwareSentry is a macOS menu-bar hardware change monitor. Its main workflow is: the app starts and configures the monitor registry; domain monitors observe system or device changes and raise events; the app’s notification pipeline presents custom banners. Settings configure event switches, detail fields, icons, and tuning; users can also preview notifications and review local history. The README documents all thirteen monitor domains and additional capabilities. Edges are limited to relationships shown in excerpts, the source index, or README; many monitor implementations and settings screens were not sampled.

Main entry points: [`HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift) (Monitor registry), [`HardwareSentryCore/Sources/SentryContract/MonitorContext.swift`](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SentryContract/MonitorContext.swift) (Monitor context), [`HardwareSentry/AppDelegate.swift`](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/AppDelegate.swift) (App coordinator), [`HardwareSentry/HardwareSentryApp.swift`](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/HardwareSentryApp.swift) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and settings"]
  node_appentry["App entry"]
  node_appdelegate["App coordinator<br/>[AppDelegate.swift]"]
  node_eventsettings["Event settings"]
  node_tuning["Monitor tuning"]
  node_settings["Settings views<br/>[SettingsView.swift]"]
  node_iconssettings["Icon choices"]
  node_preview["Notification preview"]
  node_history[("Notification history")]
  node_help["Help reference<br/>[HelpView.swift]"]
end

subgraph group_monitoring["Hardware monitoring"]
  node_registry["Monitor registry"]
  node_audio["Audio monitor<br/>[AudioMonitor.swift]"]
  node_bluetooth["Bluetooth monitor"]
  node_camera["Camera monitor"]
  node_display["Display monitor"]
  node_gamepad["Gamepad monitor"]
  node_network["Network monitor"]
  node_power["Power monitor<br/>[PowerMonitor.swift]"]
  node_printer["Printer monitor"]
  node_scanner["Scanner monitor"]
  node_thermal["Thermal monitor"]
  node_thunderbolt["Thunderbolt monitor"]
  node_usb["USB monitor<br/>[USBMonitor.swift]"]
  node_volume["Volume monitor"]
end

subgraph group_contracts["Events and icons"]
  node_contract["Monitor contract<br/>[Monitor.swift]"]
  node_context["Monitor context"]
  node_bodyline["Message detail lines<br/>[BodyLine.swift]"]
  node_devicekind["Device icon identity"]
  node_iconcatalog["System icon catalog"]
  node_iconsource["Icon sources<br/>[IconSource.swift]"]
end

subgraph group_delivery["Notification delivery"]
  node_signalcore["SignalCore"]
  node_banners["Custom banner delivery<br/>[AppDelegate.swift]"]
end

node_user(("Mac user"))

node_user -->|"launches"| node_appentry
node_appentry -->|"starts"| node_appdelegate
node_appentry -->|"opens"| node_settings
node_appdelegate -->|"starts and configures"| node_registry
node_registry -->|"assembles"| node_audio
node_registry -->|"assembles"| node_bluetooth
node_registry -->|"assembles"| node_camera
node_registry -->|"assembles"| node_display
node_registry -->|"assembles"| node_gamepad
node_registry -->|"assembles"| node_network
node_registry -->|"assembles"| node_power
node_registry -->|"assembles"| node_printer
node_registry -->|"assembles"| node_scanner
node_registry -->|"assembles"| node_thermal
node_registry -->|"assembles"| node_thunderbolt
node_registry -->|"assembles"| node_usb
node_registry -->|"assembles"| node_volume
node_eventsettings -->|"reads module catalogue"| node_registry
node_tuning -->|"supplies tuning"| node_registry
node_appdelegate -->|"applies preferences"| node_tuning
node_settings -->|"configures events"| node_eventsettings
node_settings -->|"configures icons"| node_iconssettings
node_preview -->|"uses event choices"| node_eventsettings
node_preview -->|"uses icon choices"| node_iconssettings
node_appentry -->|"opens"| node_help
node_appdelegate -->|"records notices"| node_history
node_network -->|"raises events through"| node_context
node_power -->|"raises events through"| node_context
node_volume -->|"raises events through"| node_context
node_thermal -->|"raises events through"| node_context
node_scanner -->|"raises events through"| node_context
node_context -->|"dispatches notifications"| node_signalcore
node_appdelegate -->|"runs dispatcher"| node_signalcore
node_appdelegate -->|"presents banners"| node_banners
node_iconssettings -->|"selects device artwork"| node_iconcatalog
node_iconssettings -->|"selects icon sources"| node_iconsource
node_contract -->|"defines monitor API"| node_context
node_context -->|"filters optional details"| node_bodyline
node_context -->|"carries device identity"| node_devicekind

click node_appentry "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/HardwareSentryApp.swift"
click node_appdelegate "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/AppDelegate.swift"
click node_eventsettings "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/EventSettingsModel.swift"
click node_tuning "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/MonitorTuningModel.swift"
click node_settings "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/SettingsView.swift"
click node_iconssettings "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/IconSourceModel.swift"
click node_preview "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/NotificationPreviewView.swift"
click node_history "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/NotificationHistoryStore.swift"
click node_help "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Help/HelpView.swift"
click node_registry "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift"
click node_audio "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/AudioMonitor/AudioMonitor.swift"
click node_bluetooth "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/BluetoothMonitor/BluetoothMonitor.swift"
click node_camera "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/CameraMonitor/CameraMonitor.swift"
click node_display "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/DisplayMonitor/DisplayMonitor.swift"
click node_gamepad "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/GamepadMonitor/GamepadMonitor.swift"
click node_network "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/NetworkMonitor/NetworkMonitor.swift"
click node_power "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/PowerMonitor/PowerMonitor.swift"
click node_printer "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/PrinterMonitor/PrinterMonitor.swift"
click node_scanner "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/ScannerMonitor/ScannerMonitor.swift"
click node_thermal "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/ThermalMonitor/ThermalMonitor.swift"
click node_thunderbolt "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/ThunderboltMonitor/ThunderboltMonitor.swift"
click node_usb "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/USBMonitor/USBMonitor.swift"
click node_volume "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/VolumeMonitor/VolumeMonitor.swift"
click node_contract "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SentryContract/Monitor.swift"
click node_context "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SentryContract/MonitorContext.swift"
click node_bodyline "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SentryContract/BodyLine.swift"
click node_devicekind "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SentryContract/DeviceIconKind.swift"
click node_iconcatalog "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SystemIcons/SystemIconCatalog.swift"
click node_iconsource "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SystemIcons/IconSource.swift"
click node_banners "https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/AppDelegate.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_appentry,node_appdelegate,node_eventsettings,node_tuning,node_settings,node_iconssettings,node_preview,node_history,node_help,node_user toneBlue
class node_registry,node_audio,node_bluetooth,node_camera,node_display,node_gamepad,node_network,node_power,node_printer,node_scanner,node_thermal,node_thunderbolt,node_usb,node_volume toneAmber
class node_contract,node_context,node_bodyline,node_devicekind,node_iconcatalog,node_iconsource toneMint
class node_signalcore,node_banners toneRose
```

## Components

### App and settings

- [App entry](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/HardwareSentryApp.swift): `HardwareSentry/HardwareSentryApp.swift`
- [App coordinator](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/AppDelegate.swift): `HardwareSentry/AppDelegate.swift`
- [Event settings](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/EventSettingsModel.swift): `HardwareSentry/Settings/EventSettingsModel.swift`
- [Monitor tuning](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/MonitorTuningModel.swift): `HardwareSentry/Settings/MonitorTuningModel.swift`
- [Settings views](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/SettingsView.swift): `HardwareSentry/Settings/SettingsView.swift`
- [Icon choices](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/IconSourceModel.swift): `HardwareSentry/Settings/IconSourceModel.swift`
- [Notification preview](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/NotificationPreviewView.swift): `HardwareSentry/Settings/NotificationPreviewView.swift`
- [Notification history](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Settings/NotificationHistoryStore.swift): `HardwareSentry/Settings/NotificationHistoryStore.swift`
- [Help reference](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/Help/HelpView.swift): `HardwareSentry/Help/HelpView.swift`

### Hardware monitoring

- [Monitor registry](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift): `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`
- [Audio monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/AudioMonitor/AudioMonitor.swift): `HardwareSentryCore/Sources/AudioMonitor/AudioMonitor.swift`
- [Bluetooth monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/BluetoothMonitor/BluetoothMonitor.swift): `HardwareSentryCore/Sources/BluetoothMonitor/BluetoothMonitor.swift`
- [Camera monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/CameraMonitor/CameraMonitor.swift): `HardwareSentryCore/Sources/CameraMonitor/CameraMonitor.swift`
- [Display monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/DisplayMonitor/DisplayMonitor.swift): `HardwareSentryCore/Sources/DisplayMonitor/DisplayMonitor.swift`
- [Gamepad monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/GamepadMonitor/GamepadMonitor.swift): `HardwareSentryCore/Sources/GamepadMonitor/GamepadMonitor.swift`
- [Network monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/NetworkMonitor/NetworkMonitor.swift): `HardwareSentryCore/Sources/NetworkMonitor/NetworkMonitor.swift`
- [Power monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/PowerMonitor/PowerMonitor.swift): `HardwareSentryCore/Sources/PowerMonitor/PowerMonitor.swift`
- [Printer monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/PrinterMonitor/PrinterMonitor.swift): `HardwareSentryCore/Sources/PrinterMonitor/PrinterMonitor.swift`
- [Scanner monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/ScannerMonitor/ScannerMonitor.swift): `HardwareSentryCore/Sources/ScannerMonitor/ScannerMonitor.swift`
- [Thermal monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/ThermalMonitor/ThermalMonitor.swift): `HardwareSentryCore/Sources/ThermalMonitor/ThermalMonitor.swift`
- [Thunderbolt monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/ThunderboltMonitor/ThunderboltMonitor.swift): `HardwareSentryCore/Sources/ThunderboltMonitor/ThunderboltMonitor.swift`
- [USB monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/USBMonitor/USBMonitor.swift): `HardwareSentryCore/Sources/USBMonitor/USBMonitor.swift`
- [Volume monitor](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/VolumeMonitor/VolumeMonitor.swift): `HardwareSentryCore/Sources/VolumeMonitor/VolumeMonitor.swift`

### Events and icons

- [Monitor contract](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SentryContract/Monitor.swift): `HardwareSentryCore/Sources/SentryContract/Monitor.swift`
- [Monitor context](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SentryContract/MonitorContext.swift): `HardwareSentryCore/Sources/SentryContract/MonitorContext.swift`
- [Message detail lines](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SentryContract/BodyLine.swift): `HardwareSentryCore/Sources/SentryContract/BodyLine.swift`
- [Device icon identity](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SentryContract/DeviceIconKind.swift): `HardwareSentryCore/Sources/SentryContract/DeviceIconKind.swift`
- [System icon catalog](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SystemIcons/SystemIconCatalog.swift): `HardwareSentryCore/Sources/SystemIcons/SystemIconCatalog.swift`
- [Icon sources](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentryCore/Sources/SystemIcons/IconSource.swift): `HardwareSentryCore/Sources/SystemIcons/IconSource.swift`

### Notification delivery

- **SignalCore**
- [Custom banner delivery](https://github.com/jensyleo/hardwaresentry/blob/main/HardwareSentry/AppDelegate.swift): `HardwareSentry/AppDelegate.swift`

### Other components

- **Mac user**

## Connections

- Mac user → App entry: launches (evidence: `README.md`)
- App entry → App coordinator: starts (evidence: `HardwareSentry/HardwareSentryApp.swift`)
- App entry → Settings views: opens (evidence: `HardwareSentry/HardwareSentryApp.swift`)
- App coordinator → Monitor registry: starts and configures (evidence: `HardwareSentry/AppDelegate.swift`)
- Monitor registry → Audio monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → Bluetooth monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → Camera monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → Display monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → Gamepad monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → Network monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → Power monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → Printer monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → Scanner monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → Thermal monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → Thunderbolt monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → USB monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Monitor registry → Volume monitor: assembles (evidence: `HardwareSentryCore/Sources/MonitorRegistry/MonitorRegistry.swift`)
- Event settings → Monitor registry: reads module catalogue (evidence: `HardwareSentry/Settings/EventSettingsModel.swift`)
- Monitor tuning → Monitor registry: supplies tuning (evidence: `HardwareSentry/Settings/MonitorTuningModel.swift`)
- App coordinator → Monitor tuning: applies preferences (evidence: `HardwareSentry/AppDelegate.swift`)
- Settings views → Event settings: configures events
- Settings views → Icon choices: configures icons
- Notification preview → Event settings: uses event choices (evidence: `HardwareSentry/Settings/NotificationPreviewView.swift`)
- Notification preview → Icon choices: uses icon choices (evidence: `HardwareSentry/Settings/NotificationPreviewView.swift`)
- App entry → Help reference: opens (evidence: `HardwareSentry/HardwareSentryApp.swift`)
- App coordinator → Notification history: records notices (evidence: `HardwareSentry/AppDelegate.swift`)
- Network monitor → Monitor context: raises events through (evidence: `HardwareSentryCore/Sources/NetworkMonitor/NetworkMonitor.swift`)
- Power monitor → Monitor context: raises events through (evidence: `HardwareSentryCore/Sources/PowerMonitor/PowerMonitor.swift`)
- Volume monitor → Monitor context: raises events through (evidence: `HardwareSentryCore/Sources/VolumeMonitor/VolumeMonitor.swift`)
- Thermal monitor → Monitor context: raises events through (evidence: `HardwareSentryCore/Sources/ThermalMonitor/ThermalMonitor.swift`)
- Scanner monitor → Monitor context: raises events through (evidence: `HardwareSentryCore/Sources/ScannerMonitor/ScannerMonitor.swift`)
- Monitor context → SignalCore: dispatches notifications (evidence: `HardwareSentryCore/Sources/SentryContract/MonitorContext.swift`)
- App coordinator → SignalCore: runs dispatcher (evidence: `HardwareSentry/AppDelegate.swift`)
- App coordinator → Custom banner delivery: presents banners (evidence: `HardwareSentry/AppDelegate.swift`)
- Icon choices → System icon catalog: selects device artwork (evidence: `HardwareSentry/AppDelegate.swift`)
- Icon choices → Icon sources: selects icon sources (evidence: `HardwareSentry/Settings/NotificationPreviewView.swift`)
- Monitor contract → Monitor context: defines monitor API (evidence: `HardwareSentryCore/Sources/SentryContract/Monitor.swift`)
- Monitor context → Message detail lines: filters optional details (evidence: `HardwareSentryCore/Sources/SentryContract/MonitorContext.swift`)
- Monitor context → Device icon identity: carries device identity (evidence: `HardwareSentryCore/Sources/SentryContract/MonitorContext.swift`)
