# keepcoolch/smbmounter architecture

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

- Interactive diagram: https://gitdiagram.com/keepcoolch/smbmounter
- Repository: https://github.com/keepcoolch/smbmounter

## Overview

SMBMounter is a macOS menu-bar app for configuring and managing SMB and WebDAV network shares. Users add a target and credentials, then connect manually or rely on auto-mount and reconnect; the app resolves and preflights hosts, asks Finder to mount, verifies mounted volumes, and reflects status in its UI. ShareManager coordinates these stages, persistence, and monitoring. The manager excerpt is partial, so some documented capabilities are shown at its source path without asserting unsampled internal call details.

Main entry points: [`SMBMounter/ShareManager.swift`](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareManager.swift) (Share manager), [`SMBMounter/ContentView.swift`](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ContentView.swift) (Share overview), [`SMBMounter/AppDelegate.swift`](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/AppDelegate.swift) (App lifecycle), [`SMBMounter/ShareEditView.swift`](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareEditView.swift) (Share editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Menu Bar Interface"]
  node_app["App lifecycle<br/>[AppDelegate.swift]"]
  node_content["Share overview<br/>[ContentView.swift]"]
  node_editor["Share editor"]
  node_row["Share status row<br/>[ShareRowView.swift]"]
end

subgraph group_connection["Connection Lifecycle"]
  node_manager["Share manager<br/>[ShareManager.swift]"]
  node_reachability["Host preflight<br/>[ShareManager.swift]"]
  node_mount["Mount and retry<br/>[ShareManager.swift]"]
  node_verification["Mount verification<br/>[ShareManager.swift]"]
end

subgraph group_state["Share State"]
  node_model["Share model<br/>[SMBShare.swift]"]
  node_keychain[("Credential Keychain")]
  node_sharefile[("Saved shares")]
end

node_user(("Mac user"))
node_network["Network and Bonjour"]
node_finder["Finder mount"]
node_volumes[("Mounted volumes")]
node_notifications["macOS notifications"]
node_workspace["Finder workspace"]

node_user -->|"launches"| node_app
node_app -->|"starts monitoring"| node_manager
node_app -->|"presents"| node_content
node_user -->|"manages shares"| node_content
node_content -->|"opens editor"| node_editor
node_editor -->|"saves changes"| node_manager
node_content -->|"connects or disconnects"| node_manager
node_content -->|"displays"| node_row
node_row -->|"requests mount action"| node_manager
node_manager -->|"updates share state"| node_model
node_manager -->|"loads and saves"| node_sharefile
node_editor -->|"reads saved password"| node_keychain
node_manager -->|"stores credentials"| node_keychain
node_manager -->|"resolves and preflights"| node_reachability
node_reachability -->|"probes host"| node_network
node_manager -->|"starts mount flow"| node_mount
node_mount -->|"mounts via URL"| node_finder
node_manager -->|"checks mount status"| node_verification
node_verification -->|"examines mounted volumes"| node_volumes
node_manager -->|"sends connection notices"| node_notifications
node_content -->|"opens mount point"| node_workspace

click node_app "https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/AppDelegate.swift"
click node_content "https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ContentView.swift"
click node_editor "https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareEditView.swift"
click node_row "https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareRowView.swift"
click node_manager "https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareManager.swift"
click node_reachability "https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareManager.swift"
click node_mount "https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareManager.swift"
click node_verification "https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareManager.swift"
click node_model "https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/SMBShare.swift"
click node_keychain "https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/KeychainHelper.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_content,node_editor,node_row,node_user toneBlue
class node_manager,node_reachability,node_mount,node_verification,node_volumes toneAmber
class node_model,node_keychain,node_sharefile toneMint
class node_network,node_finder,node_notifications,node_workspace toneIndigo
```

## Components

### Menu Bar Interface

- [App lifecycle](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/AppDelegate.swift): `SMBMounter/AppDelegate.swift`
- [Share overview](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ContentView.swift): `SMBMounter/ContentView.swift`
- [Share editor](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareEditView.swift): `SMBMounter/ShareEditView.swift`
- [Share status row](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareRowView.swift): `SMBMounter/ShareRowView.swift`

### Connection Lifecycle

- [Share manager](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareManager.swift): `SMBMounter/ShareManager.swift`
- [Host preflight](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareManager.swift): `SMBMounter/ShareManager.swift`
- [Mount and retry](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareManager.swift): `SMBMounter/ShareManager.swift`
- [Mount verification](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/ShareManager.swift): `SMBMounter/ShareManager.swift`

### Share State

- [Share model](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/SMBShare.swift): `SMBMounter/SMBShare.swift`
- [Credential Keychain](https://github.com/keepcoolch/smbmounter/blob/main/SMBMounter/KeychainHelper.swift): `SMBMounter/KeychainHelper.swift`
- **Saved shares**

### Other components

- **Mac user**
- **Network and Bonjour**
- **Finder mount**
- **Mounted volumes**
- **macOS notifications**
- **Finder workspace**

## Connections

- Mac user → App lifecycle: launches
- App lifecycle → Share manager: starts monitoring
- App lifecycle → Share overview: presents
- Mac user → Share overview: manages shares
- Share overview → Share editor: opens editor
- Share editor → Share manager: saves changes
- Share overview → Share manager: connects or disconnects
- Share overview → Share status row: displays
- Share status row → Share manager: requests mount action
- Share manager → Share model: updates share state
- Share manager → Saved shares: loads and saves
- Share editor → Credential Keychain: reads saved password
- Share manager → Credential Keychain: stores credentials
- Share manager → Host preflight: resolves and preflights
- Host preflight → Network and Bonjour: probes host
- Share manager → Mount and retry: starts mount flow
- Mount and retry → Finder mount: mounts via URL
- Share manager → Mount verification: checks mount status
- Mount verification → Mounted volumes: examines mounted volumes
- Share manager → macOS notifications: sends connection notices
- Share overview → Finder workspace: opens mount point
