# devanshgoel-123/diskpilot architecture

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

- Interactive diagram: https://gitdiagram.com/devanshgoel-123/diskpilot
- Repository: https://github.com/devanshgoel-123/diskpilot

## Overview

DiskPilot is a macOS storage-analysis and cleanup desktop app. Users launch a scan, inspect classified storage and recommendations, then preview and confirm cleanup; the documented safety architecture separates read-only scanning, classification, planning, and execution. The graph also preserves major documented capabilities such as duplicates, Docker, file-type browsing, assistant, and developer tooling. Several backend feature modules were not excerpted, so their links are shown only where the README or source index supports them.

Main entry points: [`src/App.tsx`](https://github.com/devanshgoel-123/diskpilot/blob/main/src/App.tsx) (App shell), [`src-tauri/src/scanner/mod.rs`](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/scanner/mod.rs) (Filesystem scanner), [`src-tauri/src/commands.rs`](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/commands.rs) (Command handlers), [`src/lib/api.ts`](https://github.com/devanshgoel-123/diskpilot/blob/main/src/lib/api.ts) (Typed API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_storage_ui["Storage views<br/>[StoragePage.tsx]"]
  node_overview["Overview<br/>[OverviewPage.tsx]"]
  node_recommend_ui["Recommendations"]
  node_api["Typed API<br/>[api.ts]"]
  node_store["UI state<br/>[store.ts]"]
end

subgraph group_analysis["Storage analysis"]
  node_engine["Tauri engine<br/>[lib.rs]"]
  node_commands["Command handlers<br/>[commands.rs]"]
  node_scanner["Filesystem scanner<br/>[mod.rs]"]
  node_classifier["Classification rules<br/>[rules.rs]"]
  node_data_model["Shared data model<br/>[model.rs]"]
  node_filekinds["Files by type<br/>[filekinds.rs]"]
  node_apps["App footprints<br/>[apps.rs]"]
  node_history[("Scan history<br/>[history.rs]")]
end

subgraph group_cleanup["Safe cleanup"]
  node_recommend["Recommendation policy<br/>[policies.rs]"]
  node_cleanup_plan["Cleanup planning<br/>[planner.rs]"]
  node_cleanup_exec["Cleanup execution<br/>[executor.rs]"]
  node_trash["Trash workflow<br/>[trash.rs]"]
  node_duplicates["Duplicate detection<br/>[duplicates.rs]"]
end

subgraph group_special["Developer features"]
  node_docker["Docker tools<br/>[mod.rs]"]
  node_agents["Coding agents<br/>[claude.rs]"]
  node_devtools["Developer tools<br/>[mod.rs]"]
  node_assistant["AI assistant<br/>[mod.rs]"]
end

node_user(("Mac user"))

node_user -->|"uses"| node_app
node_app -->|"initializes"| node_store
node_app -->|"routes to"| node_storage_ui
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_recommend_ui
node_storage_ui -.->|"requests data"| node_api
node_recommend_ui -.->|"requests data"| node_api
node_store -->|"invokes"| node_api
node_api -->|"dispatches commands"| node_commands
node_engine -->|"registers"| node_commands
node_commands -.->|"starts scans"| node_scanner
node_scanner -->|"classifies entries"| node_classifier
node_scanner -->|"groups files"| node_filekinds
node_scanner -->|"produces scan data"| node_data_model
node_classifier -->|"uses types"| node_data_model
node_recommend -->|"evaluates results"| node_classifier
node_recommend -->|"builds plan"| node_cleanup_plan
node_recommend_ui -.->|"previews cleanup"| node_cleanup_plan
node_cleanup_plan -.->|"executes confirmed plan"| node_cleanup_exec
node_cleanup_exec -.->|"moves items"| node_trash
node_user -->|"reviews copies"| node_duplicates
node_user -->|"manages Docker data"| node_docker
node_user -->|"inspects agent data"| node_agents
node_user -->|"inspects toolchains"| node_devtools
node_user -.->|"asks questions"| node_assistant
node_commands -.->|"reports app storage"| node_apps
node_engine -->|"opens history store"| node_history

click node_app "https://github.com/devanshgoel-123/diskpilot/blob/main/src/App.tsx"
click node_storage_ui "https://github.com/devanshgoel-123/diskpilot/blob/main/src/features/storage/StoragePage.tsx"
click node_overview "https://github.com/devanshgoel-123/diskpilot/blob/main/src/features/overview/OverviewPage.tsx"
click node_recommend_ui "https://github.com/devanshgoel-123/diskpilot/blob/main/src/features/recommendations/RecommendationsPage.tsx"
click node_api "https://github.com/devanshgoel-123/diskpilot/blob/main/src/lib/api.ts"
click node_store "https://github.com/devanshgoel-123/diskpilot/blob/main/src/lib/store.ts"
click node_engine "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/lib.rs"
click node_commands "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/commands.rs"
click node_scanner "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/scanner/mod.rs"
click node_classifier "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/classifier/rules.rs"
click node_data_model "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/model.rs"
click node_recommend "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/recommend/policies.rs"
click node_cleanup_plan "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/cleanup/planner.rs"
click node_cleanup_exec "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/cleanup/executor.rs"
click node_trash "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/trash.rs"
click node_duplicates "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/duplicates.rs"
click node_filekinds "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/filekinds.rs"
click node_apps "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/apps.rs"
click node_docker "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/docker/mod.rs"
click node_agents "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/agents/claude.rs"
click node_devtools "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/devtools/mod.rs"
click node_assistant "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/assistant/mod.rs"
click node_history "https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/history.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_app,node_storage_ui,node_overview,node_recommend_ui,node_api,node_store,node_user toneBlue
class node_engine,node_commands,node_scanner,node_classifier,node_data_model,node_filekinds,node_apps,node_history toneAmber
class node_recommend,node_cleanup_plan,node_cleanup_exec,node_trash,node_duplicates toneMint
class node_docker,node_agents,node_devtools,node_assistant toneRose
```

## Components

### Desktop experience

- [App shell](https://github.com/devanshgoel-123/diskpilot/blob/main/src/App.tsx): `src/App.tsx`
- [Storage views](https://github.com/devanshgoel-123/diskpilot/blob/main/src/features/storage/StoragePage.tsx): `src/features/storage/StoragePage.tsx`
- [Overview](https://github.com/devanshgoel-123/diskpilot/blob/main/src/features/overview/OverviewPage.tsx): `src/features/overview/OverviewPage.tsx`
- [Recommendations](https://github.com/devanshgoel-123/diskpilot/blob/main/src/features/recommendations/RecommendationsPage.tsx): `src/features/recommendations/RecommendationsPage.tsx`
- [Typed API](https://github.com/devanshgoel-123/diskpilot/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [UI state](https://github.com/devanshgoel-123/diskpilot/blob/main/src/lib/store.ts): `src/lib/store.ts`

### Storage analysis

- [Tauri engine](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Command handlers](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/commands.rs): `src-tauri/src/commands.rs`
- [Filesystem scanner](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/scanner/mod.rs): `src-tauri/src/scanner/mod.rs`
- [Classification rules](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/classifier/rules.rs): `src-tauri/src/classifier/rules.rs`
- [Shared data model](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/model.rs): `src-tauri/src/model.rs`
- [Files by type](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/filekinds.rs): `src-tauri/src/filekinds.rs`
- [App footprints](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/apps.rs): `src-tauri/src/apps.rs`
- [Scan history](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/history.rs): `src-tauri/src/history.rs`

### Safe cleanup

- [Recommendation policy](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/recommend/policies.rs): `src-tauri/src/recommend/policies.rs`
- [Cleanup planning](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/cleanup/planner.rs): `src-tauri/src/cleanup/planner.rs`
- [Cleanup execution](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/cleanup/executor.rs): `src-tauri/src/cleanup/executor.rs`
- [Trash workflow](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/trash.rs): `src-tauri/src/trash.rs`
- [Duplicate detection](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/duplicates.rs): `src-tauri/src/duplicates.rs`

### Developer features

- [Docker tools](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/docker/mod.rs): `src-tauri/src/docker/mod.rs`
- [Coding agents](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/agents/claude.rs): `src-tauri/src/agents/claude.rs`
- [Developer tools](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/devtools/mod.rs): `src-tauri/src/devtools/mod.rs`
- [AI assistant](https://github.com/devanshgoel-123/diskpilot/blob/main/src-tauri/src/assistant/mod.rs): `src-tauri/src/assistant/mod.rs`

### Other components

- **Mac user**

## Connections

- Mac user → App shell: uses (evidence: `README.md`)
- App shell → UI state: initializes (evidence: `src/App.tsx`)
- App shell → Storage views: routes to (evidence: `src/App.tsx`)
- App shell → Overview: routes to (evidence: `src/App.tsx`)
- App shell → Recommendations: routes to (evidence: `src/App.tsx`)
- Storage views → Typed API: requests data
- Recommendations → Typed API: requests data
- UI state → Typed API: invokes (evidence: `src/lib/store.ts`)
- Typed API → Command handlers: dispatches commands (evidence: `src/lib/api.ts`)
- Tauri engine → Command handlers: registers (evidence: `src-tauri/src/lib.rs`)
- Command handlers → Filesystem scanner: starts scans
- Filesystem scanner → Classification rules: classifies entries (evidence: `src-tauri/src/scanner/mod.rs`)
- Filesystem scanner → Files by type: groups files (evidence: `src-tauri/src/scanner/mod.rs`)
- Filesystem scanner → Shared data model: produces scan data (evidence: `src-tauri/src/scanner/mod.rs`)
- Classification rules → Shared data model: uses types (evidence: `src-tauri/src/classifier/mod.rs`)
- Recommendation policy → Classification rules: evaluates results (evidence: `src-tauri/src/recommend/mod.rs`)
- Recommendation policy → Cleanup planning: builds plan (evidence: `src-tauri/src/recommend/mod.rs`)
- Recommendations → Cleanup planning: previews cleanup
- Cleanup planning → Cleanup execution: executes confirmed plan
- Cleanup execution → Trash workflow: moves items
- Mac user → Duplicate detection: reviews copies (evidence: `README.md`)
- Mac user → Docker tools: manages Docker data (evidence: `README.md`)
- Mac user → Coding agents: inspects agent data (evidence: `README.md`)
- Mac user → Developer tools: inspects toolchains (evidence: `README.md`)
- Mac user → AI assistant: asks questions
- Command handlers → App footprints: reports app storage
- Tauri engine → Scan history: opens history store (evidence: `src-tauri/src/lib.rs`)
