# dsi-hub/hooklink architecture

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

- Interactive diagram: https://gitdiagram.com/dsi-hub/hooklink
- Repository: https://github.com/dsi-hub/hooklink

## Overview

HookLink is a macOS app that guides a player from checking Mac prerequisites and selecting their game/device through building an installable app, copying game files to an iPhone, and managing updates and saves. The graph separates the UI, build orchestration, device/save operations, and update handling. README documents build capabilities whose implementation is only partly sampled; links to those stages are therefore limited to documented relationships. The graph does not map nxnative internals, which are external to this repository.

Main entry points: [`Sources/HookLink/Views.swift`](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Views.swift) (Workflow views), [`Sources/HookLink/Model.swift`](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Model.swift) (Build and device state), [`Sources/HookLink/Updates.swift`](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Updates.swift) (Update checks), [`Sources/HookLink/Saves.swift`](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Saves.swift) (Save backup restore)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["App interface"]
  node_app["App lifecycle<br/>[App.swift]"]
  node_views["Workflow views<br/>[Views.swift]"]
  node_progress["Task progress<br/>[Progress.swift]"]
  node_sky["Window backdrop<br/>[Sky.swift]"]
end

subgraph group_build["Build workflow"]
  node_workflow["Build and device state<br/>[Model.swift]"]
  node_commands["Command runner<br/>[Runner.swift]"]
  node_engine["nxnative build engine"]
  node_resolution["Resolution tuning<br/>[hl_resolution.py]"]
end

subgraph group_device["Phone and saves"]
  node_devicecopy["Game file transfer<br/>[Model.swift]"]
  node_phone[("iPhone game storage")]
  node_saveops["Save backup restore<br/>[Saves.swift]"]
  node_backupstore[("Mac save backups<br/>[Saves.swift]")]
end

subgraph group_maintenance["Maintenance"]
  node_updates["Update checks<br/>[Updates.swift]"]
  node_github["GitHub releases"]
  node_engineupdate["Engine updates<br/>[Updates.swift]"]
end

node_player(("Player"))
node_gamefile["Player game dump"]
node_sideloader["Sideloading tool"]

node_player -->|"uses"| node_views
node_views -->|"invokes workflow"| node_workflow
node_app -->|"presents"| node_views
node_views -.->|"shows progress"| node_progress
node_views -.->|"shows backdrop"| node_sky
node_workflow -->|"runs commands"| node_commands
node_workflow -.->|"runs build"| node_engine
node_gamefile -->|"provides dump"| node_workflow
node_workflow -->|"runs tuning"| node_resolution
node_workflow -->|"coordinates copy"| node_devicecopy
node_devicecopy -->|"copies game files"| node_phone
node_devicecopy -->|"backs up first"| node_saveops
node_saveops -->|"reads and writes saves"| node_phone
node_saveops -->|"stores backups"| node_backupstore
node_player -->|"installs IPA"| node_sideloader
node_app -->|"checks on launch"| node_updates
node_views -->|"shows update actions"| node_updates
node_updates -->|"checks releases"| node_github
node_updates -->|"checks engine"| node_engineupdate
node_engineupdate -->|"runs update command"| node_commands

click node_app "https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/App.swift"
click node_views "https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Views.swift"
click node_progress "https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Progress.swift"
click node_sky "https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Sky.swift"
click node_workflow "https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Model.swift"
click node_commands "https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Runner.swift"
click node_resolution "https://github.com/dsi-hub/hooklink/blob/main/Resources/tools/hl_resolution.py"
click node_devicecopy "https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Model.swift"
click node_saveops "https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Saves.swift"
click node_backupstore "https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Saves.swift"
click node_updates "https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Updates.swift"
click node_engineupdate "https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Updates.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_views,node_progress,node_sky toneBlue
class node_workflow,node_commands,node_engine,node_resolution toneAmber
class node_devicecopy,node_phone,node_saveops,node_backupstore toneMint
class node_updates,node_github,node_engineupdate toneRose
class node_player,node_gamefile,node_sideloader toneIndigo
```

## Components

### App interface

- [App lifecycle](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/App.swift): `Sources/HookLink/App.swift`
- [Workflow views](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Views.swift): `Sources/HookLink/Views.swift`
- [Task progress](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Progress.swift): `Sources/HookLink/Progress.swift`
- [Window backdrop](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Sky.swift): `Sources/HookLink/Sky.swift`

### Build workflow

- [Build and device state](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Model.swift): `Sources/HookLink/Model.swift`
- [Command runner](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Runner.swift): `Sources/HookLink/Runner.swift`
- **nxnative build engine**
- [Resolution tuning](https://github.com/dsi-hub/hooklink/blob/main/Resources/tools/hl_resolution.py): `Resources/tools/hl_resolution.py`

### Phone and saves

- [Game file transfer](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Model.swift): `Sources/HookLink/Model.swift`
- **iPhone game storage**
- [Save backup restore](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Saves.swift): `Sources/HookLink/Saves.swift`
- [Mac save backups](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Saves.swift): `Sources/HookLink/Saves.swift`

### Maintenance

- [Update checks](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Updates.swift): `Sources/HookLink/Updates.swift`
- **GitHub releases**
- [Engine updates](https://github.com/dsi-hub/hooklink/blob/main/Sources/HookLink/Updates.swift): `Sources/HookLink/Updates.swift`

### Other components

- **Player**
- **Player game dump**
- **Sideloading tool**

## Connections

- Player → Workflow views: uses (evidence: `README.md`)
- Workflow views → Build and device state: invokes workflow (evidence: `Sources/HookLink/Views.swift`)
- App lifecycle → Workflow views: presents (evidence: `Sources/HookLink/App.swift`)
- Workflow views → Task progress: shows progress
- Workflow views → Window backdrop: shows backdrop
- Build and device state → Command runner: runs commands (evidence: `Sources/HookLink/Model.swift`)
- Build and device state → nxnative build engine: runs build
- Player game dump → Build and device state: provides dump (evidence: `README.md`)
- Build and device state → Resolution tuning: runs tuning (evidence: `Sources/HookLink/Model.swift`)
- Build and device state → Game file transfer: coordinates copy (evidence: `Sources/HookLink/Model.swift`)
- Game file transfer → iPhone game storage: copies game files (evidence: `README.md`)
- Game file transfer → Save backup restore: backs up first (evidence: `README.md`)
- Save backup restore → iPhone game storage: reads and writes saves (evidence: `Sources/HookLink/Saves.swift`)
- Save backup restore → Mac save backups: stores backups (evidence: `Sources/HookLink/Saves.swift`)
- Player → Sideloading tool: installs IPA (evidence: `README.md`)
- App lifecycle → Update checks: checks on launch (evidence: `Sources/HookLink/App.swift`)
- Workflow views → Update checks: shows update actions (evidence: `Sources/HookLink/Views.swift`)
- Update checks → GitHub releases: checks releases (evidence: `Sources/HookLink/Updates.swift`)
- Update checks → Engine updates: checks engine (evidence: `Sources/HookLink/Updates.swift`)
- Engine updates → Command runner: runs update command (evidence: `Sources/HookLink/Updates.swift`)
