# adileo/squirreldisk architecture

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

- Interactive diagram: https://gitdiagram.com/adileo/squirreldisk
- Repository: https://github.com/adileo/squirreldisk

## Overview

SquirrelDisk is a cross-platform disk-usage explorer and cleanup app. Users start a local, remote, or cloud scan; the scanner builds a live tree that the app presents as a sunburst or treemap, then users collect items and safely delete or back them up. Other documented capabilities include CLI scans, filesystem-change refresh, account management, self-updates, localization, and on-device sponsor selection. Some subsystem links reflect README descriptions because their implementation excerpts were not provided; those links are marked dashed.

Main entry points: [`src/ui/app.rs`](https://github.com/adileo/squirreldisk/blob/main/src/ui/app.rs) (Desktop app), [`src/tree.rs`](https://github.com/adileo/squirreldisk/blob/main/src/tree.rs) (Disk tree), [`src/scan/remote.rs`](https://github.com/adileo/squirreldisk/blob/main/src/scan/remote.rs) (Remote scanner), [`src/scan/local.rs`](https://github.com/adileo/squirreldisk/blob/main/src/scan/local.rs) (Local scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Scanning"]
  node_scan_dispatch["Scan dispatch<br/>[mod.rs]"]
  node_local_scan["Local scanner<br/>[local.rs]"]
  node_platform_scan["Platform filesystem access<br/>[platform.rs]"]
  node_remote_scan["Remote scanner<br/>[remote.rs]"]
  node_demo_scan["Demo scanner<br/>[demo.rs]"]
  node_path_builder["Path tree builder<br/>[pathtree.rs]"]
  node_disk_tree[("Disk tree<br/>[tree.rs]")]
end

subgraph group_explore["Explore and manage"]
  node_app["Desktop app<br/>[app.rs]"]
  node_sunburst["Sunburst view<br/>[sunburst.rs]"]
  node_treemap["Treemap view<br/>[treemap.rs]"]
  node_ui_view["Exploration panels<br/>[view.rs]"]
  node_widgets["UI widgets<br/>[widgets.rs]"]
  node_cli["Command-line scans<br/>[cli.rs]"]
end

subgraph group_operations["Cleanup and integrations"]
  node_delete["Cleanup operations<br/>[delete.rs]"]
  node_safety["Deletion safeguards<br/>[safety.rs]"]
  node_rclone["Cloud account and transfer<br/>[rclone.rs]"]
  node_watch["Filesystem watcher<br/>[watch.rs]"]
end

subgraph group_app_services["App services"]
  node_settings[("Settings<br/>[settings.rs]")]
  node_update["Self updater<br/>[update.rs]"]
  node_i18n["Localization<br/>[i18n.rs]"]
  node_sponsors["Sponsor selection<br/>[mod.rs]"]
end

node_user(("User"))
node_cli_user(("CLI user"))
node_filesystem["Local filesystem"]
node_remote_hosts["SSH and cloud sources"]
node_sponsor_catalog["Sponsor catalog service"]

node_user -->|"starts scan"| node_app
node_cli_user -->|"runs scan"| node_cli
node_cli -->|"scans locally"| node_local_scan
node_cli -->|"prints results"| node_disk_tree
node_app -.->|"requests scan"| node_scan_dispatch
node_scan_dispatch -->|"dispatches local"| node_local_scan
node_scan_dispatch -->|"dispatches remote"| node_remote_scan
node_scan_dispatch -->|"dispatches demo"| node_demo_scan
node_local_scan -->|"reads entries"| node_platform_scan
node_local_scan -->|"builds tree"| node_disk_tree
node_remote_scan -->|"builds paths"| node_path_builder
node_remote_scan -->|"builds tree"| node_disk_tree
node_remote_scan -->|"uses rclone"| node_rclone
node_demo_scan -->|"builds demo tree"| node_disk_tree
node_filesystem -->|"provides entries"| node_local_scan
node_remote_hosts -->|"provides data"| node_remote_scan
node_app -->|"explores tree"| node_disk_tree
node_app -->|"renders chart"| node_sunburst
node_app -->|"renders chart"| node_treemap
node_app -->|"shows details"| node_ui_view
node_sunburst -->|"reads tree"| node_disk_tree
node_treemap -->|"reads tree"| node_disk_tree
node_ui_view -->|"reads tree"| node_disk_tree
node_app -->|"uses controls"| node_widgets
node_user -->|"requests cleanup"| node_delete
node_delete -->|"checks targets"| node_safety
node_delete -->|"resolves items"| node_disk_tree
node_delete -->|"backs up remotely"| node_rclone
node_app -.->|"refreshes scans"| node_watch
node_app -.->|"loads preferences"| node_settings
node_app -.->|"checks updates"| node_update
node_app -.->|"translates interface"| node_i18n
node_app -->|"shows banner"| node_sponsors
node_sponsors -->|"fetches catalog"| node_sponsor_catalog
node_user -.->|"manages accounts"| node_rclone

click node_scan_dispatch "https://github.com/adileo/squirreldisk/blob/main/src/scan/mod.rs"
click node_local_scan "https://github.com/adileo/squirreldisk/blob/main/src/scan/local.rs"
click node_platform_scan "https://github.com/adileo/squirreldisk/blob/main/src/scan/platform.rs"
click node_remote_scan "https://github.com/adileo/squirreldisk/blob/main/src/scan/remote.rs"
click node_demo_scan "https://github.com/adileo/squirreldisk/blob/main/src/scan/demo.rs"
click node_path_builder "https://github.com/adileo/squirreldisk/blob/main/src/scan/pathtree.rs"
click node_disk_tree "https://github.com/adileo/squirreldisk/blob/main/src/tree.rs"
click node_app "https://github.com/adileo/squirreldisk/blob/main/src/ui/app.rs"
click node_sunburst "https://github.com/adileo/squirreldisk/blob/main/src/ui/sunburst.rs"
click node_treemap "https://github.com/adileo/squirreldisk/blob/main/src/ui/treemap.rs"
click node_ui_view "https://github.com/adileo/squirreldisk/blob/main/src/ui/view.rs"
click node_widgets "https://github.com/adileo/squirreldisk/blob/main/src/ui/widgets.rs"
click node_cli "https://github.com/adileo/squirreldisk/blob/main/src/cli.rs"
click node_delete "https://github.com/adileo/squirreldisk/blob/main/src/delete.rs"
click node_safety "https://github.com/adileo/squirreldisk/blob/main/src/safety.rs"
click node_rclone "https://github.com/adileo/squirreldisk/blob/main/src/rclone.rs"
click node_watch "https://github.com/adileo/squirreldisk/blob/main/src/watch.rs"
click node_settings "https://github.com/adileo/squirreldisk/blob/main/src/settings.rs"
click node_update "https://github.com/adileo/squirreldisk/blob/main/src/update.rs"
click node_i18n "https://github.com/adileo/squirreldisk/blob/main/src/i18n.rs"
click node_sponsors "https://github.com/adileo/squirreldisk/blob/main/src/sponsor/mod.rs"

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_scan_dispatch,node_local_scan,node_platform_scan,node_remote_scan,node_demo_scan,node_path_builder,node_disk_tree,node_user,node_cli_user toneBlue
class node_app,node_sunburst,node_treemap,node_ui_view,node_widgets,node_cli toneAmber
class node_delete,node_safety,node_rclone,node_watch toneMint
class node_settings,node_update,node_i18n,node_sponsors toneRose
class node_filesystem,node_remote_hosts,node_sponsor_catalog toneIndigo
```

## Components

### Scanning

- [Scan dispatch](https://github.com/adileo/squirreldisk/blob/main/src/scan/mod.rs): `src/scan/mod.rs`
- [Local scanner](https://github.com/adileo/squirreldisk/blob/main/src/scan/local.rs): `src/scan/local.rs`
- [Platform filesystem access](https://github.com/adileo/squirreldisk/blob/main/src/scan/platform.rs): `src/scan/platform.rs`
- [Remote scanner](https://github.com/adileo/squirreldisk/blob/main/src/scan/remote.rs): `src/scan/remote.rs`
- [Demo scanner](https://github.com/adileo/squirreldisk/blob/main/src/scan/demo.rs): `src/scan/demo.rs`
- [Path tree builder](https://github.com/adileo/squirreldisk/blob/main/src/scan/pathtree.rs): `src/scan/pathtree.rs`
- [Disk tree](https://github.com/adileo/squirreldisk/blob/main/src/tree.rs): `src/tree.rs`

### Explore and manage

- [Desktop app](https://github.com/adileo/squirreldisk/blob/main/src/ui/app.rs): `src/ui/app.rs`
- [Sunburst view](https://github.com/adileo/squirreldisk/blob/main/src/ui/sunburst.rs): `src/ui/sunburst.rs`
- [Treemap view](https://github.com/adileo/squirreldisk/blob/main/src/ui/treemap.rs): `src/ui/treemap.rs`
- [Exploration panels](https://github.com/adileo/squirreldisk/blob/main/src/ui/view.rs): `src/ui/view.rs`
- [UI widgets](https://github.com/adileo/squirreldisk/blob/main/src/ui/widgets.rs): `src/ui/widgets.rs`
- [Command-line scans](https://github.com/adileo/squirreldisk/blob/main/src/cli.rs): `src/cli.rs`

### Cleanup and integrations

- [Cleanup operations](https://github.com/adileo/squirreldisk/blob/main/src/delete.rs): `src/delete.rs`
- [Deletion safeguards](https://github.com/adileo/squirreldisk/blob/main/src/safety.rs): `src/safety.rs`
- [Cloud account and transfer](https://github.com/adileo/squirreldisk/blob/main/src/rclone.rs): `src/rclone.rs`
- [Filesystem watcher](https://github.com/adileo/squirreldisk/blob/main/src/watch.rs): `src/watch.rs`

### App services

- [Settings](https://github.com/adileo/squirreldisk/blob/main/src/settings.rs): `src/settings.rs`
- [Self updater](https://github.com/adileo/squirreldisk/blob/main/src/update.rs): `src/update.rs`
- [Localization](https://github.com/adileo/squirreldisk/blob/main/src/i18n.rs): `src/i18n.rs`
- [Sponsor selection](https://github.com/adileo/squirreldisk/blob/main/src/sponsor/mod.rs): `src/sponsor/mod.rs`

### Other components

- **User**
- **CLI user**
- **Local filesystem**
- **SSH and cloud sources**
- **Sponsor catalog service**

## Connections

- User → Desktop app: starts scan
- CLI user → Command-line scans: runs scan
- Command-line scans → Local scanner: scans locally (evidence: `src/cli.rs`)
- Command-line scans → Disk tree: prints results (evidence: `src/cli.rs`)
- Desktop app → Scan dispatch: requests scan (evidence: `src/ui/app.rs`)
- Scan dispatch → Local scanner: dispatches local (evidence: `src/scan/mod.rs`)
- Scan dispatch → Remote scanner: dispatches remote (evidence: `src/scan/mod.rs`)
- Scan dispatch → Demo scanner: dispatches demo (evidence: `src/scan/mod.rs`)
- Local scanner → Platform filesystem access: reads entries (evidence: `src/scan/local.rs`)
- Local scanner → Disk tree: builds tree (evidence: `src/scan/local.rs`)
- Remote scanner → Path tree builder: builds paths (evidence: `src/scan/remote.rs`)
- Remote scanner → Disk tree: builds tree (evidence: `src/scan/remote.rs`)
- Remote scanner → Cloud account and transfer: uses rclone (evidence: `src/scan/remote.rs`)
- Demo scanner → Disk tree: builds demo tree (evidence: `src/scan/demo.rs`)
- Local filesystem → Local scanner: provides entries
- SSH and cloud sources → Remote scanner: provides data
- Desktop app → Disk tree: explores tree (evidence: `src/ui/app.rs`)
- Desktop app → Sunburst view: renders chart (evidence: `src/ui/app.rs`)
- Desktop app → Treemap view: renders chart (evidence: `src/ui/app.rs`)
- Desktop app → Exploration panels: shows details (evidence: `src/ui/app.rs`)
- Sunburst view → Disk tree: reads tree (evidence: `src/ui/sunburst.rs`)
- Treemap view → Disk tree: reads tree (evidence: `src/ui/treemap.rs`)
- Exploration panels → Disk tree: reads tree (evidence: `src/ui/view.rs`)
- Desktop app → UI widgets: uses controls (evidence: `src/ui/app.rs`)
- User → Cleanup operations: requests cleanup
- Cleanup operations → Deletion safeguards: checks targets (evidence: `src/delete.rs`)
- Cleanup operations → Disk tree: resolves items (evidence: `src/delete.rs`)
- Cleanup operations → Cloud account and transfer: backs up remotely (evidence: `src/delete.rs`)
- Desktop app → Filesystem watcher: refreshes scans (evidence: `src/ui/app.rs`)
- Desktop app → Settings: loads preferences (evidence: `src/ui/app.rs`)
- Desktop app → Self updater: checks updates (evidence: `src/ui/app.rs`)
- Desktop app → Localization: translates interface (evidence: `src/ui/app.rs`)
- Desktop app → Sponsor selection: shows banner (evidence: `src/ui/app.rs`)
- Sponsor selection → Sponsor catalog service: fetches catalog (evidence: `src/sponsor/mod.rs`)
- User → Cloud account and transfer: manages accounts
