# buresdv/cork architecture

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

- Interactive diagram: https://gitdiagram.com/buresdv/cork
- Repository: https://github.com/buresdv/cork

## Overview

Cork is a macOS SwiftUI interface for managing Homebrew packages and related workflows. Users browse installed packages, inspect details, then install, update, or remove them; separate areas cover taps, services, maintenance, backups, and menu-bar actions. The source excerpts show app startup, package loading, and service operations, but most feature implementations were not sampled. Accordingly, feature coverage follows the README and file tree, while edges are limited to visible calls or explicitly documented capabilities.

Main entry points: [`Modules/TerminalSupport/Logic/Shell Commands.swift`](https://github.com/buresdv/cork/blob/main/Modules/TerminalSupport/Logic/Shell%20Commands.swift) (Brew command runner), [`Cork/Logic/Services/Modification/Start Service.swift`](https://github.com/buresdv/cork/blob/main/Cork/Logic/Services/Modification/Start%20Service.swift) (Service controls), [`Cork/ContentView.swift`](https://github.com/buresdv/cork/blob/main/Cork/ContentView.swift) (Main window), [`Cork/Logic/Updating and Upgrading/Update All Packages.swift`](https://github.com/buresdv/cork/blob/main/Cork/Logic/Updating%20and%20Upgrading/Update%20All%20Packages.swift) (Update packages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_app["App entry<br/>[CorkApp.swift]"]
  node_window["Main window<br/>[ContentView.swift]"]
  node_settings["Settings and licensing"]
  node_menu["Menu bar"]
end

subgraph group_packages["Package management"]
  node_inventory["Package inventory"]
  node_package_state["Package state"]
  node_detail["Package details"]
  node_search_install["Search and install"]
  node_install_logic["Install packages"]
  node_updates["Update packages"]
  node_outdated["Outdated tracking"]
  node_removal["Remove packages"]
  node_tags[("Package tags")]
  node_taps["Tap management<br/>[Add Tap.swift]"]
end

subgraph group_brew["Homebrew operations"]
  node_brew["Brew command runner"]
  node_services_ui["Services interface"]
  node_service_discovery["Service discovery"]
  node_service_model["Service model<br/>[Service.swift]"]
  node_service_detail["Service details"]
  node_service_control["Service controls"]
end

subgraph group_features["Additional capabilities"]
  node_maintenance["Maintenance"]
  node_backup["Brewfile import/export"]
  node_intents["Shortcuts and intents<br/>[intent.swift]"]
end

node_user(("User"))
node_homebrew["Homebrew"]

node_user -->|"launches"| node_app
node_app -->|"presents"| node_window
node_user -->|"manages packages"| node_window
node_window -->|"loads packages"| node_inventory
node_inventory -.->|"runs commands"| node_brew
node_brew -->|"invokes"| node_homebrew
node_user -->|"inspects packages"| node_detail
node_user -->|"searches packages"| node_search_install
node_search_install -.->|"starts install"| node_install_logic
node_install_logic -.->|"runs commands"| node_brew
node_user -->|"updates packages"| node_updates
node_updates -.->|"runs commands"| node_brew
node_outdated -.->|"checks updates"| node_brew
node_user -->|"removes packages"| node_removal
node_user -->|"tags packages"| node_tags
node_user -.->|"manages taps"| node_taps
node_user -->|"manages services"| node_services_ui
node_services_ui -.->|"loads services"| node_service_discovery
node_service_discovery -.->|"runs commands"| node_brew
node_service_detail -->|"loads details"| node_service_model
node_service_control -->|"runs service command"| node_brew
node_service_control -->|"reloads services"| node_service_discovery
node_service_control -->|"loads details"| node_service_model
node_user -->|"clears downloads"| node_maintenance
node_user -.->|"imports or exports"| node_backup
node_user -->|"uses menu actions"| node_menu
node_menu -->|"starts updates"| node_updates
node_user -.->|"invokes shortcuts"| node_intents
node_user -.->|"configures app"| node_settings

click node_app "https://github.com/buresdv/cork/blob/main/Cork/CorkApp.swift"
click node_window "https://github.com/buresdv/cork/blob/main/Cork/ContentView.swift"
click node_settings "https://github.com/buresdv/cork/blob/main/Cork/Views/Settings/Settings%20View.swift"
click node_menu "https://github.com/buresdv/cork/blob/main/Cork/Views/Menu%20Bar/Menu%20Bar%20Item.swift"
click node_inventory "https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Logic/Package%20Loading/Load%20Up%20Installed%20Packages.swift"
click node_package_state "https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Trackers/Brew%20Packages%20Tracker.swift"
click node_detail "https://github.com/buresdv/cork/blob/main/Cork/Views/Packages/Package%20Details/Package%20Details.swift"
click node_search_install "https://github.com/buresdv/cork/blob/main/Cork/Views/Installation/Install%20Package.swift"
click node_install_logic "https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Logic/Installation%20%26%20Removal/Install%20Package/Install%20Package.swift"
click node_updates "https://github.com/buresdv/cork/blob/main/Cork/Logic/Updating%20and%20Upgrading/Update%20All%20Packages.swift"
click node_outdated "https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Logic/Package%20Loading/Get%20Outdated%20Packages.swift"
click node_removal "https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Logic/Installation%20%26%20Removal/Removal/Uninstall%20Packages.swift"
click node_tags "https://github.com/buresdv/cork/blob/main/Modules/Shared/Modules/Persistence/Tagged%20Packages%20Storage.swift"
click node_taps "https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Logic/Taps/Add%20Tap.swift"
click node_brew "https://github.com/buresdv/cork/blob/main/Modules/TerminalSupport/Logic/Shell%20Commands.swift"
click node_services_ui "https://github.com/buresdv/cork/blob/main/Cork/Views/Services/Homebrew%20Services%20View.swift"
click node_service_discovery "https://github.com/buresdv/cork/blob/main/Cork/Logic/Services/Load%20up%20Services.swift"
click node_service_model "https://github.com/buresdv/cork/blob/main/Cork/Models/Services/Service.swift"
click node_service_detail "https://github.com/buresdv/cork/blob/main/Cork/Views/Services/Service%20Detail/Service%20Detail.swift"
click node_service_control "https://github.com/buresdv/cork/blob/main/Cork/Logic/Services/Modification/Start%20Service.swift"
click node_maintenance "https://github.com/buresdv/cork/blob/main/Cork/Logic/Maintenance/Steps/Purge%20Brew%20Cache.swift"
click node_backup "https://github.com/buresdv/cork/blob/main/Modules/Features/Brewfiles/Logic/Import%20Brewfile.swift"
click node_intents "https://github.com/buresdv/cork/blob/main/Modules/Intents/intent.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_window,node_settings,node_menu,node_user toneBlue
class node_inventory,node_package_state,node_detail,node_search_install,node_install_logic,node_updates,node_outdated,node_removal,node_tags,node_taps toneAmber
class node_brew,node_services_ui,node_service_discovery,node_service_model,node_service_detail,node_service_control toneMint
class node_maintenance,node_backup,node_intents toneRose
class node_homebrew toneIndigo
```

## Components

### App experience

- [App entry](https://github.com/buresdv/cork/blob/main/Cork/CorkApp.swift): `Cork/CorkApp.swift`
- [Main window](https://github.com/buresdv/cork/blob/main/Cork/ContentView.swift): `Cork/ContentView.swift`
- [Settings and licensing](https://github.com/buresdv/cork/blob/main/Cork/Views/Settings/Settings%20View.swift): `Cork/Views/Settings/Settings View.swift`
- [Menu bar](https://github.com/buresdv/cork/blob/main/Cork/Views/Menu%20Bar/Menu%20Bar%20Item.swift): `Cork/Views/Menu Bar/Menu Bar Item.swift`

### Package management

- [Package inventory](https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Logic/Package%20Loading/Load%20Up%20Installed%20Packages.swift): `Modules/Packages/PackagesModels/Logic/Package Loading/Load Up Installed Packages.swift`
- [Package state](https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Trackers/Brew%20Packages%20Tracker.swift): `Modules/Packages/PackagesModels/Trackers/Brew Packages Tracker.swift`
- [Package details](https://github.com/buresdv/cork/blob/main/Cork/Views/Packages/Package%20Details/Package%20Details.swift): `Cork/Views/Packages/Package Details/Package Details.swift`
- [Search and install](https://github.com/buresdv/cork/blob/main/Cork/Views/Installation/Install%20Package.swift): `Cork/Views/Installation/Install Package.swift`
- [Install packages](https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Logic/Installation%20%26%20Removal/Install%20Package/Install%20Package.swift): `Modules/Packages/PackagesModels/Logic/Installation & Removal/Install Package/Install Package.swift`
- [Update packages](https://github.com/buresdv/cork/blob/main/Cork/Logic/Updating%20and%20Upgrading/Update%20All%20Packages.swift): `Cork/Logic/Updating and Upgrading/Update All Packages.swift`
- [Outdated tracking](https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Logic/Package%20Loading/Get%20Outdated%20Packages.swift): `Modules/Packages/PackagesModels/Logic/Package Loading/Get Outdated Packages.swift`
- [Remove packages](https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Logic/Installation%20%26%20Removal/Removal/Uninstall%20Packages.swift): `Modules/Packages/PackagesModels/Logic/Installation & Removal/Removal/Uninstall Packages.swift`
- [Package tags](https://github.com/buresdv/cork/blob/main/Modules/Shared/Modules/Persistence/Tagged%20Packages%20Storage.swift): `Modules/Shared/Modules/Persistence/Tagged Packages Storage.swift`
- [Tap management](https://github.com/buresdv/cork/blob/main/Modules/Packages/PackagesModels/Logic/Taps/Add%20Tap.swift): `Modules/Packages/PackagesModels/Logic/Taps/Add Tap.swift`

### Homebrew operations

- [Brew command runner](https://github.com/buresdv/cork/blob/main/Modules/TerminalSupport/Logic/Shell%20Commands.swift): `Modules/TerminalSupport/Logic/Shell Commands.swift`
- [Services interface](https://github.com/buresdv/cork/blob/main/Cork/Views/Services/Homebrew%20Services%20View.swift): `Cork/Views/Services/Homebrew Services View.swift`
- [Service discovery](https://github.com/buresdv/cork/blob/main/Cork/Logic/Services/Load%20up%20Services.swift): `Cork/Logic/Services/Load up Services.swift`
- [Service model](https://github.com/buresdv/cork/blob/main/Cork/Models/Services/Service.swift): `Cork/Models/Services/Service.swift`
- [Service details](https://github.com/buresdv/cork/blob/main/Cork/Views/Services/Service%20Detail/Service%20Detail.swift): `Cork/Views/Services/Service Detail/Service Detail.swift`
- [Service controls](https://github.com/buresdv/cork/blob/main/Cork/Logic/Services/Modification/Start%20Service.swift): `Cork/Logic/Services/Modification/Start Service.swift`

### Additional capabilities

- [Maintenance](https://github.com/buresdv/cork/blob/main/Cork/Logic/Maintenance/Steps/Purge%20Brew%20Cache.swift): `Cork/Logic/Maintenance/Steps/Purge Brew Cache.swift`
- [Brewfile import/export](https://github.com/buresdv/cork/blob/main/Modules/Features/Brewfiles/Logic/Import%20Brewfile.swift): `Modules/Features/Brewfiles/Logic/Import Brewfile.swift`
- [Shortcuts and intents](https://github.com/buresdv/cork/blob/main/Modules/Intents/intent.swift): `Modules/Intents/intent.swift`

### Other components

- **User**
- **Homebrew**

## Connections

- User → App entry: launches (evidence: `Cork/CorkApp.swift`)
- App entry → Main window: presents (evidence: `Cork/CorkApp.swift`)
- User → Main window: manages packages (evidence: `README.md`)
- Main window → Package inventory: loads packages (evidence: `Cork/ContentView.swift`)
- Package inventory → Brew command runner: runs commands
- Brew command runner → Homebrew: invokes (evidence: `README.md`)
- User → Package details: inspects packages (evidence: `README.md`)
- User → Search and install: searches packages (evidence: `README.md`)
- Search and install → Install packages: starts install
- Install packages → Brew command runner: runs commands
- User → Update packages: updates packages (evidence: `README.md`)
- Update packages → Brew command runner: runs commands
- Outdated tracking → Brew command runner: checks updates
- User → Remove packages: removes packages (evidence: `README.md`)
- User → Package tags: tags packages (evidence: `README.md`)
- User → Tap management: manages taps
- User → Services interface: manages services (evidence: `README.md`)
- Services interface → Service discovery: loads services
- Service discovery → Brew command runner: runs commands
- Service details → Service model: loads details (evidence: `Cork/Views/Services/Service Detail/Service Detail.swift`)
- Service controls → Brew command runner: runs service command (evidence: `Cork/Logic/Services/Modification/Start Service.swift`)
- Service controls → Service discovery: reloads services (evidence: `Cork/Logic/Services/Modification/Start Service.swift`)
- Service controls → Service model: loads details (evidence: `Cork/Logic/Services/Modification/Start Service.swift`)
- User → Maintenance: clears downloads (evidence: `README.md`)
- User → Brewfile import/export: imports or exports
- User → Menu bar: uses menu actions (evidence: `README.md`)
- Menu bar → Update packages: starts updates (evidence: `README.md`)
- User → Shortcuts and intents: invokes shortcuts
- User → Settings and licensing: configures app
