# zep4yrs/bluetidy architecture

> Architecture diagram of the GitHub repository zep4yrs/bluetidy, 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/zep4yrs/bluetidy
- Repository: https://github.com/zep4yrs/bluetidy

## Overview

BlueTidy is a Windows desktop tool for understanding disk usage and safely governing software assets. Users start from the dashboard, scan software or a folder, review size and risk evidence, then optionally preflight cleanup or migration and retain a rollback record. The folder workflow also supports cached tree exploration, CSV export, and snapshot comparison. The README documents these product capabilities; backend internals are only indexed as read, so links into those internals are limited to documented relationships rather than inferred call chains.

Main entry points: [`apps/desktop/src/App.tsx`](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/App.tsx) (Application shell), [`apps/desktop/src/api.ts`](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/api.ts) (Native API bridge), [`apps/desktop/src/components/FolderMigrationPanel.tsx`](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/FolderMigrationPanel.tsx) (Folder workspace), [`crates/collector/src/lib.rs`](https://github.com/zep4yrs/bluetidy/blob/main/crates/collector/src/lib.rs) (Asset discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop experience"]
  node_app["Application shell<br/>[App.tsx]"]
  node_dashboard["Space dashboard<br/>[DashboardPanel.tsx]"]
  node_settings[("Settings persistence<br/>[settings.ts]")]
  node_settings_modal["Settings editor<br/>[SettingsModal.tsx]"]
end

subgraph group_folder["Folder analysis"]
  node_folder_panel["Folder workspace"]
  node_usage_tree["Usage tree"]
  node_treemap["Folder treemap<br/>[FolderTreemap.tsx]"]
end

subgraph group_assets["Software governance"]
  node_asset_table["Asset browser<br/>[AssetTable.tsx]"]
  node_collector["Asset discovery<br/>[lib.rs]"]
  node_migrator["Migration and cleanup<br/>[lib.rs]"]
  node_governance["Migration governance"]
  node_cleanup["Cleanup review<br/>[CleanupPanel.tsx]"]
  node_batch["Batch operations<br/>[BatchPanel.tsx]"]
end

subgraph group_backend["Native services"]
  node_api["Native API bridge<br/>[api.ts]"]
  node_tauri["Tauri command layer<br/>[lib.rs]"]
  node_asset_model["Asset model<br/>[lib.rs]"]
  node_snapshot_store[("Folder snapshots<br/>[lib.rs]")]
end

subgraph group_advice["Guidance"]
  node_advisor_ui["TidyPilot panel<br/>[AdvisorPanel.tsx]"]
  node_advisor["Advisor rules and API<br/>[lib.rs]"]
end

node_user(("User"))
node_ai_service["Compatible AI service"]
node_os["Windows environment"]

node_user -->|"uses"| node_app
node_app -->|"presents"| node_dashboard
node_app -->|"presents"| node_advisor_ui
node_app -->|"presents"| node_governance
node_app -->|"presents"| node_cleanup
node_app -->|"loads and saves"| node_settings
node_app -->|"presents"| node_settings_modal
node_dashboard -.->|"opens"| node_asset_table
node_user -->|"scans folders"| node_folder_panel
node_folder_panel -->|"renders"| node_usage_tree
node_folder_panel -->|"renders"| node_treemap
node_folder_panel -->|"requests scans"| node_api
node_folder_panel -->|"compares snapshots"| node_snapshot_store
node_user -->|"scans assets"| node_app
node_app -.->|"invokes"| node_api
node_api -->|"invokes commands"| node_tauri
node_tauri -->|"discovers assets"| node_collector
node_collector -->|"reads installed software"| node_os
node_collector -.->|"produces assets"| node_asset_model
node_user -->|"reviews assets"| node_asset_table
node_user -->|"preflights migration"| node_governance
node_governance -.->|"requests plans"| node_api
node_user -->|"reviews cleanup"| node_cleanup
node_cleanup -.->|"requests cleanup"| node_api
node_user -->|"selects batch work"| node_batch
node_api -->|"requests operations"| node_migrator
node_migrator -->|"moves and cleans"| node_os
node_migrator -->|"records transactions"| node_snapshot_store
node_advisor_ui -.->|"sends questions"| node_api
node_api -->|"requests advice"| node_advisor
node_advisor -.->|"optionally queries"| node_ai_service
node_settings_modal -->|"edits"| node_settings
node_settings -.->|"persists settings"| node_api

click node_app "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/App.tsx"
click node_dashboard "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/DashboardPanel.tsx"
click node_asset_table "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/AssetTable.tsx"
click node_folder_panel "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/FolderMigrationPanel.tsx"
click node_usage_tree "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/FolderUsageTree.tsx"
click node_treemap "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/FolderTreemap.tsx"
click node_api "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/api.ts"
click node_tauri "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src-tauri/src/lib.rs"
click node_collector "https://github.com/zep4yrs/bluetidy/blob/main/crates/collector/src/lib.rs"
click node_asset_model "https://github.com/zep4yrs/bluetidy/blob/main/crates/asset-model/src/lib.rs"
click node_migrator "https://github.com/zep4yrs/bluetidy/blob/main/crates/migrator/src/lib.rs"
click node_governance "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/GovernancePanel.tsx"
click node_cleanup "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/CleanupPanel.tsx"
click node_batch "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/BatchPanel.tsx"
click node_advisor_ui "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/AdvisorPanel.tsx"
click node_advisor "https://github.com/zep4yrs/bluetidy/blob/main/crates/advisor/src/lib.rs"
click node_settings "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/settings.ts"
click node_settings_modal "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/SettingsModal.tsx"
click node_snapshot_store "https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src-tauri/src/lib.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_dashboard,node_settings,node_settings_modal,node_user toneBlue
class node_folder_panel,node_usage_tree,node_treemap toneAmber
class node_asset_table,node_collector,node_migrator,node_governance,node_cleanup,node_batch toneMint
class node_api,node_tauri,node_asset_model,node_snapshot_store toneRose
class node_advisor_ui,node_advisor,node_ai_service,node_os toneIndigo
```

## Components

### Desktop experience

- [Application shell](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/App.tsx): `apps/desktop/src/App.tsx`
- [Space dashboard](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/DashboardPanel.tsx): `apps/desktop/src/components/DashboardPanel.tsx`
- [Settings persistence](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/settings.ts): `apps/desktop/src/settings.ts`
- [Settings editor](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/SettingsModal.tsx): `apps/desktop/src/components/SettingsModal.tsx`

### Folder analysis

- [Folder workspace](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/FolderMigrationPanel.tsx): `apps/desktop/src/components/FolderMigrationPanel.tsx`
- [Usage tree](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/FolderUsageTree.tsx): `apps/desktop/src/components/FolderUsageTree.tsx`
- [Folder treemap](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/FolderTreemap.tsx): `apps/desktop/src/components/FolderTreemap.tsx`

### Software governance

- [Asset browser](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/AssetTable.tsx): `apps/desktop/src/components/AssetTable.tsx`
- [Asset discovery](https://github.com/zep4yrs/bluetidy/blob/main/crates/collector/src/lib.rs): `crates/collector/src/lib.rs`
- [Migration and cleanup](https://github.com/zep4yrs/bluetidy/blob/main/crates/migrator/src/lib.rs): `crates/migrator/src/lib.rs`
- [Migration governance](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/GovernancePanel.tsx): `apps/desktop/src/components/GovernancePanel.tsx`
- [Cleanup review](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/CleanupPanel.tsx): `apps/desktop/src/components/CleanupPanel.tsx`
- [Batch operations](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/BatchPanel.tsx): `apps/desktop/src/components/BatchPanel.tsx`

### Native services

- [Native API bridge](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/api.ts): `apps/desktop/src/api.ts`
- [Tauri command layer](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src-tauri/src/lib.rs): `apps/desktop/src-tauri/src/lib.rs`
- [Asset model](https://github.com/zep4yrs/bluetidy/blob/main/crates/asset-model/src/lib.rs): `crates/asset-model/src/lib.rs`
- [Folder snapshots](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src-tauri/src/lib.rs): `apps/desktop/src-tauri/src/lib.rs`

### Guidance

- [TidyPilot panel](https://github.com/zep4yrs/bluetidy/blob/main/apps/desktop/src/components/AdvisorPanel.tsx): `apps/desktop/src/components/AdvisorPanel.tsx`
- [Advisor rules and API](https://github.com/zep4yrs/bluetidy/blob/main/crates/advisor/src/lib.rs): `crates/advisor/src/lib.rs`

### Other components

- **User**
- **Compatible AI service**
- **Windows environment**

## Connections

- User → Application shell: uses (evidence: `README.md`)
- Application shell → Space dashboard: presents (evidence: `apps/desktop/src/App.tsx`)
- Application shell → TidyPilot panel: presents (evidence: `apps/desktop/src/App.tsx`)
- Application shell → Migration governance: presents (evidence: `apps/desktop/src/App.tsx`)
- Application shell → Cleanup review: presents (evidence: `apps/desktop/src/App.tsx`)
- Application shell → Settings persistence: loads and saves (evidence: `apps/desktop/src/App.tsx`)
- Application shell → Settings editor: presents (evidence: `apps/desktop/src/App.tsx`)
- Space dashboard → Asset browser: opens
- User → Folder workspace: scans folders (evidence: `README.md`)
- Folder workspace → Usage tree: renders (evidence: `apps/desktop/src/components/FolderMigrationPanel.tsx`)
- Folder workspace → Folder treemap: renders (evidence: `apps/desktop/src/components/FolderMigrationPanel.tsx`)
- Folder workspace → Native API bridge: requests scans (evidence: `apps/desktop/src/components/FolderMigrationPanel.tsx`)
- Folder workspace → Folder snapshots: compares snapshots (evidence: `README.md`)
- User → Application shell: scans assets (evidence: `apps/desktop/src/App.tsx`)
- Application shell → Native API bridge: invokes (evidence: `apps/desktop/src/App.tsx`)
- Native API bridge → Tauri command layer: invokes commands (evidence: `apps/desktop/src/api.ts`)
- Tauri command layer → Asset discovery: discovers assets (evidence: `README.md`)
- Asset discovery → Windows environment: reads installed software (evidence: `README.md`)
- Asset discovery → Asset model: produces assets
- User → Asset browser: reviews assets (evidence: `README.md`)
- User → Migration governance: preflights migration (evidence: `README.md`)
- Migration governance → Native API bridge: requests plans (evidence: `apps/desktop/src/components/GovernancePanel.tsx`)
- User → Cleanup review: reviews cleanup (evidence: `README.md`)
- Cleanup review → Native API bridge: requests cleanup (evidence: `apps/desktop/src/components/CleanupPanel.tsx`)
- User → Batch operations: selects batch work (evidence: `README.md`)
- Native API bridge → Migration and cleanup: requests operations (evidence: `README.md`)
- Migration and cleanup → Windows environment: moves and cleans (evidence: `README.md`)
- Migration and cleanup → Folder snapshots: records transactions (evidence: `README.md`)
- TidyPilot panel → Native API bridge: sends questions (evidence: `apps/desktop/src/components/AdvisorPanel.tsx`)
- Native API bridge → Advisor rules and API: requests advice (evidence: `README.md`)
- Advisor rules and API → Compatible AI service: optionally queries (evidence: `README.md`)
- Settings editor → Settings persistence: edits (evidence: `apps/desktop/src/components/SettingsModal.tsx`)
- Settings persistence → Native API bridge: persists settings (evidence: `apps/desktop/src/api.ts`)
