# dreamofxm/diskwise architecture

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

- Interactive diagram: https://gitdiagram.com/dreamofxm/diskwise
- Repository: https://github.com/dreamofxm/diskwise

## Overview

DiskWise is a native macOS disk-usage and cleanup app. Users scan the accessible volume, inspect measured space or specialized file categories, then move selected items to Trash and undo within the session; emptying Trash remains Finder’s responsibility. The README documents several feature branches whose view-to-backend wiring is not present in the sampled excerpts, so those relationships are shown only where documented, and uncertain links are omitted.

Main entry points: [`Sources/DiskCleaner/DiskCleanerApp.swift`](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/DiskCleanerApp.swift) (App shell), [`Sources/DiskCleanerCore/Scanner.swift`](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/Scanner.swift) (Volume scanner), [`Sources/DiskCleaner/Views/OverviewView.swift`](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/OverviewView.swift) (Overview), [`Sources/DiskCleaner/Views`](https://github.com/dreamofxm/diskwise/tree/main/Sources/DiskCleaner/Views) (Feature pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App interface"]
  node_app["App shell"]
  node_overview["Overview<br/>[OverviewView.swift]"]
  node_featureviews["Feature pages"]
  node_trashview["Trash page<br/>[TrashView.swift]"]
  node_appearance["Appearance"]
  node_theme["Theme manager<br/>[ThemeManager.swift]"]
end

subgraph group_scan["Space analysis"]
  node_scanner["Volume scanner<br/>[Scanner.swift]"]
  node_scope["Scan scope<br/>[ScanScope.swift]"]
  node_progress["Scan progress<br/>[ScanProgress.swift]"]
  node_models["Scan models<br/>[Models.swift]"]
end

subgraph group_features["Cleanup features"]
  node_jobs["File scan jobs<br/>[ScanJobs.swift]"]
  node_cacheview["Cache cleanup<br/>[CachesView.swift]"]
  node_cachedb["Safety knowledge base<br/>[safety_db.json]"]
  node_docker["Docker usage"]
  node_duplicates["Duplicate files"]
  node_largeold["Large and old files<br/>[BigOldViews.swift]"]
end

subgraph group_safety["Safe removal"]
  node_homeaccess["Home access<br/>[HomeAccess.swift]"]
  node_grant["Access grants<br/>[HomeGrant.swift]"]
  node_trash["Trash operations<br/>[HomeAccess.swift]"]
end

node_user(("Mac user"))
node_filesystem[("macOS filesystem")]
node_finder(("Finder"))
node_runtimes["Container runtimes"]

node_user -->|"opens and navigates"| node_app
node_app -->|"shows selected page"| node_overview
node_app -->|"shows selected page"| node_featureviews
node_app -->|"shows selected page"| node_trashview
node_app -->|"shows selected page"| node_appearance
node_overview -->|"selects scan scope"| node_scope
node_overview -->|"requests volume scan"| node_scanner
node_scanner -->|"reads directory usage"| node_filesystem
node_scanner -->|"produces usage results"| node_models
node_scanner -->|"reports scan progress"| node_progress
node_grant -.->|"requests protected access"| node_filesystem
node_featureviews -->|"requests category scans"| node_jobs
node_jobs -->|"reads files and metadata"| node_filesystem
node_jobs -.->|"queries installed engines"| node_runtimes
node_cacheview -->|"reads cleanup guidance"| node_cachedb
node_featureviews -->|"requests safe removal"| node_homeaccess
node_trashview -->|"undoes or empties"| node_homeaccess
node_homeaccess -->|"moves items to Trash"| node_filesystem
node_trashview -.->|"asks to empty Trash"| node_finder
node_appearance -->|"selects skin"| node_theme
node_theme -->|"provides active theme"| node_app

click node_app "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/DiskCleanerApp.swift"
click node_overview "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/OverviewView.swift"
click node_featureviews "https://github.com/dreamofxm/diskwise/tree/main/Sources/DiskCleaner/Views"
click node_trashview "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/TrashView.swift"
click node_appearance "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/AppearanceView.swift"
click node_theme "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Theme/ThemeManager.swift"
click node_scanner "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/Scanner.swift"
click node_scope "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/ScanScope.swift"
click node_progress "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/ScanProgress.swift"
click node_models "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/Models.swift"
click node_homeaccess "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/HomeAccess.swift"
click node_grant "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/HomeGrant.swift"
click node_jobs "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/ScanJobs.swift"
click node_cacheview "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/CachesView.swift"
click node_cachedb "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Resources/safety_db.json"
click node_docker "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/NMDockerViews.swift"
click node_duplicates "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/DupOrphansViews.swift"
click node_largeold "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/BigOldViews.swift"
click node_trash "https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/HomeAccess.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_overview,node_featureviews,node_trashview,node_appearance,node_theme,node_user toneBlue
class node_scanner,node_scope,node_progress,node_models,node_filesystem toneAmber
class node_jobs,node_cacheview,node_cachedb,node_docker,node_duplicates,node_largeold toneMint
class node_homeaccess,node_grant,node_trash toneRose
class node_finder,node_runtimes toneIndigo
```

## Components

### App interface

- [App shell](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/DiskCleanerApp.swift): `Sources/DiskCleaner/DiskCleanerApp.swift`
- [Overview](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/OverviewView.swift): `Sources/DiskCleaner/Views/OverviewView.swift`
- [Feature pages](https://github.com/dreamofxm/diskwise/tree/main/Sources/DiskCleaner/Views): `Sources/DiskCleaner/Views`
- [Trash page](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/TrashView.swift): `Sources/DiskCleaner/Views/TrashView.swift`
- [Appearance](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/AppearanceView.swift): `Sources/DiskCleaner/Views/AppearanceView.swift`
- [Theme manager](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Theme/ThemeManager.swift): `Sources/DiskCleaner/Theme/ThemeManager.swift`

### Space analysis

- [Volume scanner](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/Scanner.swift): `Sources/DiskCleanerCore/Scanner.swift`
- [Scan scope](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/ScanScope.swift): `Sources/DiskCleanerCore/ScanScope.swift`
- [Scan progress](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/ScanProgress.swift): `Sources/DiskCleanerCore/ScanProgress.swift`
- [Scan models](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/Models.swift): `Sources/DiskCleanerCore/Models.swift`

### Cleanup features

- [File scan jobs](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/ScanJobs.swift): `Sources/DiskCleanerCore/ScanJobs.swift`
- [Cache cleanup](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/CachesView.swift): `Sources/DiskCleaner/Views/CachesView.swift`
- [Safety knowledge base](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Resources/safety_db.json): `Sources/DiskCleaner/Resources/safety_db.json`
- [Docker usage](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/NMDockerViews.swift): `Sources/DiskCleaner/Views/NMDockerViews.swift`
- [Duplicate files](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/DupOrphansViews.swift): `Sources/DiskCleaner/Views/DupOrphansViews.swift`
- [Large and old files](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/Views/BigOldViews.swift): `Sources/DiskCleaner/Views/BigOldViews.swift`

### Safe removal

- [Home access](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/HomeAccess.swift): `Sources/DiskCleanerCore/HomeAccess.swift`
- [Access grants](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleaner/HomeGrant.swift): `Sources/DiskCleaner/HomeGrant.swift`
- [Trash operations](https://github.com/dreamofxm/diskwise/blob/main/Sources/DiskCleanerCore/HomeAccess.swift): `Sources/DiskCleanerCore/HomeAccess.swift`

### Other components

- **Mac user**
- **macOS filesystem**
- **Finder**
- **Container runtimes**

## Connections

- Mac user → App shell: opens and navigates
- App shell → Overview: shows selected page
- App shell → Feature pages: shows selected page
- App shell → Trash page: shows selected page
- App shell → Appearance: shows selected page
- Overview → Scan scope: selects scan scope
- Overview → Volume scanner: requests volume scan
- Volume scanner → macOS filesystem: reads directory usage
- Volume scanner → Scan models: produces usage results
- Volume scanner → Scan progress: reports scan progress
- Access grants → macOS filesystem: requests protected access
- Feature pages → File scan jobs: requests category scans
- File scan jobs → macOS filesystem: reads files and metadata
- File scan jobs → Container runtimes: queries installed engines
- Cache cleanup → Safety knowledge base: reads cleanup guidance
- Feature pages → Home access: requests safe removal
- Trash page → Home access: undoes or empties
- Home access → macOS filesystem: moves items to Trash
- Trash page → Finder: asks to empty Trash
- Appearance → Theme manager: selects skin
- Theme manager → App shell: provides active theme
