# chunyu33/light-c architecture

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

- Interactive diagram: https://gitdiagram.com/chunyu33/light-c
- Repository: https://github.com/chunyu33/light-c

## Overview

LightC is a Windows desktop utility for reviewing disk usage and system-cleanup candidates, then selectively applying maintenance actions. The main workflow runs through the React dashboard and feature modules, the Tauri command boundary, and Rust scanners or system-maintenance code; results are presented for review before cleanup. README-described capabilities include disk growth, social-app caches, AI-model storage, drivers, registry entries, and system slimming. Several feature implementations were not sampled, so their nodes reflect exact tree paths, while uncertain implementation links are omitted or dashed.

Main entry points: [`src-tauri/src/commands`](https://github.com/chunyu33/light-c/tree/main/src-tauri/src/commands) (Command handlers), [`src/components/modules`](https://github.com/chunyu33/light-c/tree/main/src/components/modules) (Feature modules), [`src/App.tsx`](https://github.com/chunyu33/light-c/blob/main/src/App.tsx) (Dashboard shell), [`src/api/commands.ts`](https://github.com/chunyu33/light-c/blob/main/src/api/commands.ts) (Tauri command API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["Dashboard shell<br/>[App.tsx]"]
  node_dashboard["Dashboard state"]
  node_featureui["Feature modules"]
  node_modulecard["Module cards<br/>[ModuleCard.tsx]"]
  node_confirm["Review dialogs<br/>[ConfirmDialog.tsx]"]
  node_notifications["Toast feedback<br/>[Toast.tsx]"]
  node_localization["Localization<br/>[index.ts]"]
  node_modulemeta["Module catalog<br/>[moduleMeta.ts]"]
end

subgraph group_analysis["Disk analysis"]
  node_junkscan["Junk scanning<br/>[deep_junk.rs]"]
  node_scanengine["Scan engine<br/>[scan_engine.rs]"]
  node_diskanalysis["Disk analysis"]
  node_growth["Disk growth"]
  node_socialscan["Social cache scan"]
  node_modelscan["AI storage scan"]
  node_leftovers["Uninstall leftovers<br/>[leftovers.rs]"]
  node_hotspot["Directory analyzer<br/>[hotspot.rs]"]
  node_hotspotselect["Hotspot engine selector<br/>[engine_selector.rs]"]
end

subgraph group_maintenance["Cleanup and maintenance"]
  node_deletion["Safe deletion<br/>[delete_engine.rs]"]
  node_safety["Deletion safeguards"]
  node_systemslim["System slimming<br/>[mod.rs]"]
  node_drivers["Driver cleanup<br/>[mod.rs]"]
  node_diskhealth["Disk health<br/>[mod.rs]"]
  node_shellicons["Shell icon manager<br/>[shell_icons.rs]"]
end

subgraph group_platform["Tauri platform"]
  node_api["Tauri command API<br/>[commands.ts]"]
  node_commands["Command handlers"]
  node_runtime["Runtime setup<br/>[runtime.rs]"]
  node_storage["App data paths<br/>[data_dir.rs]"]
end

node_user(("Windows user"))

node_user -->|"uses"| node_app
node_app -->|"reads state"| node_dashboard
node_app -->|"selects modules"| node_modulemeta
node_dashboard -->|"requests data"| node_api
node_featureui -.->|"invokes commands"| node_api
node_featureui -->|"renders"| node_modulecard
node_featureui -->|"confirms cleanup"| node_confirm
node_featureui -.->|"reports results"| node_notifications
node_api -->|"invokes"| node_commands
node_commands -.->|"runs scans"| node_junkscan
node_commands -.->|"requests deletion"| node_deletion
node_scanengine -->|"checks paths"| node_safety
node_deletion -->|"checks protection"| node_safety
node_hotspot -->|"selects engine"| node_hotspotselect
node_runtime -->|"prepares paths"| node_storage
node_commands -.->|"runs analysis"| node_growth
node_commands -.->|"runs scans"| node_socialscan
node_commands -.->|"runs scans"| node_modelscan
node_commands -.->|"runs scans"| node_leftovers
node_commands -.->|"runs analysis"| node_diskanalysis
node_commands -.->|"applies changes"| node_systemslim
node_commands -.->|"manages drivers"| node_drivers
node_commands -.->|"gets health"| node_diskhealth
node_commands -.->|"manages icons"| node_shellicons
node_localization -.->|"localizes interface"| node_app

click node_app "https://github.com/chunyu33/light-c/blob/main/src/App.tsx"
click node_dashboard "https://github.com/chunyu33/light-c/blob/main/src/contexts/DashboardContext.tsx"
click node_featureui "https://github.com/chunyu33/light-c/tree/main/src/components/modules"
click node_modulecard "https://github.com/chunyu33/light-c/blob/main/src/components/ModuleCard.tsx"
click node_confirm "https://github.com/chunyu33/light-c/blob/main/src/components/ConfirmDialog.tsx"
click node_notifications "https://github.com/chunyu33/light-c/blob/main/src/components/Toast.tsx"
click node_localization "https://github.com/chunyu33/light-c/blob/main/src/i18n/index.ts"
click node_modulemeta "https://github.com/chunyu33/light-c/blob/main/src/config/moduleMeta.ts"
click node_api "https://github.com/chunyu33/light-c/blob/main/src/api/commands.ts"
click node_commands "https://github.com/chunyu33/light-c/tree/main/src-tauri/src/commands"
click node_runtime "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/runtime.rs"
click node_storage "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/data_dir.rs"
click node_junkscan "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/deep_junk.rs"
click node_scanengine "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/scan_engine.rs"
click node_diskanalysis "https://github.com/chunyu33/light-c/tree/main/src-tauri/src/scanner"
click node_growth "https://github.com/chunyu33/light-c/tree/main/src-tauri/src/disk_growth"
click node_socialscan "https://github.com/chunyu33/light-c/tree/main/src-tauri/src/scanner/social_scanner"
click node_modelscan "https://github.com/chunyu33/light-c/tree/main/src-tauri/src/ai_models"
click node_leftovers "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/leftovers.rs"
click node_hotspot "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/hotspot.rs"
click node_hotspotselect "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/hotspot_engine/engine_selector.rs"
click node_deletion "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/cleaner/delete_engine.rs"
click node_safety "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/cleaner/safety_constants.rs"
click node_systemslim "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/system_slim/mod.rs"
click node_drivers "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/driver_cleanup/mod.rs"
click node_diskhealth "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/disk_health/mod.rs"
click node_shellicons "https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/shell_icons.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_featureui,node_modulecard,node_confirm,node_notifications,node_localization,node_modulemeta,node_user toneBlue
class node_junkscan,node_scanengine,node_diskanalysis,node_growth,node_socialscan,node_modelscan,node_leftovers,node_hotspot,node_hotspotselect toneAmber
class node_deletion,node_safety,node_systemslim,node_drivers,node_diskhealth,node_shellicons toneMint
class node_api,node_commands,node_runtime,node_storage toneRose
```

## Components

### Desktop interface

- [Dashboard shell](https://github.com/chunyu33/light-c/blob/main/src/App.tsx): `src/App.tsx`
- [Dashboard state](https://github.com/chunyu33/light-c/blob/main/src/contexts/DashboardContext.tsx): `src/contexts/DashboardContext.tsx`
- [Feature modules](https://github.com/chunyu33/light-c/tree/main/src/components/modules): `src/components/modules`
- [Module cards](https://github.com/chunyu33/light-c/blob/main/src/components/ModuleCard.tsx): `src/components/ModuleCard.tsx`
- [Review dialogs](https://github.com/chunyu33/light-c/blob/main/src/components/ConfirmDialog.tsx): `src/components/ConfirmDialog.tsx`
- [Toast feedback](https://github.com/chunyu33/light-c/blob/main/src/components/Toast.tsx): `src/components/Toast.tsx`
- [Localization](https://github.com/chunyu33/light-c/blob/main/src/i18n/index.ts): `src/i18n/index.ts`
- [Module catalog](https://github.com/chunyu33/light-c/blob/main/src/config/moduleMeta.ts): `src/config/moduleMeta.ts`

### Disk analysis

- [Junk scanning](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/deep_junk.rs): `src-tauri/src/scanner/deep_junk.rs`
- [Scan engine](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/scan_engine.rs): `src-tauri/src/scanner/scan_engine.rs`
- [Disk analysis](https://github.com/chunyu33/light-c/tree/main/src-tauri/src/scanner): `src-tauri/src/scanner`
- [Disk growth](https://github.com/chunyu33/light-c/tree/main/src-tauri/src/disk_growth): `src-tauri/src/disk_growth`
- [Social cache scan](https://github.com/chunyu33/light-c/tree/main/src-tauri/src/scanner/social_scanner): `src-tauri/src/scanner/social_scanner`
- [AI storage scan](https://github.com/chunyu33/light-c/tree/main/src-tauri/src/ai_models): `src-tauri/src/ai_models`
- [Uninstall leftovers](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/leftovers.rs): `src-tauri/src/scanner/leftovers.rs`
- [Directory analyzer](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/hotspot.rs): `src-tauri/src/scanner/hotspot.rs`
- [Hotspot engine selector](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/hotspot_engine/engine_selector.rs): `src-tauri/src/scanner/hotspot_engine/engine_selector.rs`

### Cleanup and maintenance

- [Safe deletion](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/cleaner/delete_engine.rs): `src-tauri/src/cleaner/delete_engine.rs`
- [Deletion safeguards](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/cleaner/safety_constants.rs): `src-tauri/src/cleaner/safety_constants.rs`
- [System slimming](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/system_slim/mod.rs): `src-tauri/src/system_slim/mod.rs`
- [Driver cleanup](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/driver_cleanup/mod.rs): `src-tauri/src/driver_cleanup/mod.rs`
- [Disk health](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/disk_health/mod.rs): `src-tauri/src/disk_health/mod.rs`
- [Shell icon manager](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/scanner/shell_icons.rs): `src-tauri/src/scanner/shell_icons.rs`

### Tauri platform

- [Tauri command API](https://github.com/chunyu33/light-c/blob/main/src/api/commands.ts): `src/api/commands.ts`
- [Command handlers](https://github.com/chunyu33/light-c/tree/main/src-tauri/src/commands): `src-tauri/src/commands`
- [Runtime setup](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/runtime.rs): `src-tauri/src/runtime.rs`
- [App data paths](https://github.com/chunyu33/light-c/blob/main/src-tauri/src/data_dir.rs): `src-tauri/src/data_dir.rs`

### Other components

- **Windows user**

## Connections

- Windows user → Dashboard shell: uses (evidence: `src/App.tsx`)
- Dashboard shell → Dashboard state: reads state (evidence: `src/App.tsx`)
- Dashboard shell → Module catalog: selects modules
- Dashboard state → Tauri command API: requests data (evidence: `src/contexts/DashboardContext.tsx`)
- Feature modules → Tauri command API: invokes commands (evidence: `src/components/modules/ContextMenuModule.tsx`)
- Feature modules → Module cards: renders (evidence: `src/components/modules/ContextMenuModule.tsx`)
- Feature modules → Review dialogs: confirms cleanup (evidence: `src/components/modules/ContextMenuModule.tsx`)
- Feature modules → Toast feedback: reports results
- Tauri command API → Command handlers: invokes (evidence: `src/api/commands.ts`)
- Command handlers → Junk scanning: runs scans
- Command handlers → Safe deletion: requests deletion
- Scan engine → Deletion safeguards: checks paths (evidence: `src-tauri/src/scanner/scan_engine.rs`)
- Safe deletion → Deletion safeguards: checks protection (evidence: `src-tauri/src/cleaner/delete_engine.rs`)
- Directory analyzer → Hotspot engine selector: selects engine (evidence: `src-tauri/src/scanner/hotspot_engine/engine_selector.rs`)
- Runtime setup → App data paths: prepares paths (evidence: `src-tauri/src/data_dir.rs`)
- Command handlers → Disk growth: runs analysis
- Command handlers → Social cache scan: runs scans
- Command handlers → AI storage scan: runs scans
- Command handlers → Uninstall leftovers: runs scans
- Command handlers → Disk analysis: runs analysis
- Command handlers → System slimming: applies changes
- Command handlers → Driver cleanup: manages drivers
- Command handlers → Disk health: gets health
- Command handlers → Shell icon manager: manages icons
- Localization → Dashboard shell: localizes interface
