# flandykumara/storage-cleaner architecture

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

- Interactive diagram: https://gitdiagram.com/flandykumara/storage-cleaner
- Repository: https://github.com/flandykumara/storage-cleaner

## Overview

Storage Cleaner is a local Windows storage scanner with a browser UI and an explicit, user-confirmed cleanup workflow. The main flow scans a chosen drive or folder, classifies findings, presents a report for review, then performs only the selected cleanup actions. Separate capabilities include folder browsing, file search, file-type totals, installed-app and system guidance, duplicate detection, and terminal reporting. The excerpts show the Python orchestration and cleanup calls; UI-side request wiring and some rule details are not sampled, so those links are limited to documented relationships.

Main entry points: [`main.py`](https://github.com/flandykumara/storage-cleaner/blob/main/main.py) (Scan state and report), [`actions.py`](https://github.com/flandykumara/storage-cleaner/blob/main/actions.py) (Cleanup executor), [`rules.py`](https://github.com/flandykumara/storage-cleaner/blob/main/rules.py) (Cleanup rules), [`scanner.py`](https://github.com/flandykumara/storage-cleaner/blob/main/scanner.py) (Drive scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Storage scanning"]
  node_scanner["Drive scanner<br/>[scanner.py]"]
  node_duplicate["Duplicate detector<br/>[scanner.py]"]
end

subgraph group_classify["Analysis and guidance"]
  node_rules["Cleanup rules<br/>[rules.py]"]
  node_personal["Personal-file categories<br/>[rules.py]"]
  node_guidance["System and app guidance<br/>[rules.py]"]
end

subgraph group_interface["Local interface"]
  node_state["Scan state and report<br/>[main.py]"]
  node_http["Local API server<br/>[main.py]"]
  node_ui["Browser interface<br/>[ui.html]"]
  node_browse["Folder and file views<br/>[main.py]"]
  node_extensions["File-type totals<br/>[main.py]"]
  node_terminal["Terminal report<br/>[main.py]"]
end

subgraph group_cleanup["Cleanup operations"]
  node_actions["Cleanup executor<br/>[actions.py]"]
end

node_user(("User"))
node_browser(("Browser"))
node_recycle["Windows Recycle Bin"]

node_user -->|"opens"| node_browser
node_browser -->|"requests"| node_http
node_http -->|"serves"| node_ui
node_http -->|"routes requests"| node_state
node_state -->|"runs scan"| node_scanner
node_state -->|"classifies results"| node_rules
node_state -->|"checks candidates"| node_duplicate
node_state -->|"builds guidance"| node_guidance
node_state -->|"calculates totals"| node_extensions
node_state -->|"provides views"| node_browse
node_rules -->|"defines categories"| node_personal
node_user -->|"starts scan"| node_http
node_user -->|"confirms cleanup"| node_http
node_http -->|"calls cleanup"| node_actions
node_actions -->|"checks protection"| node_rules
node_actions -->|"checks links"| node_scanner
node_actions -->|"recycles files"| node_recycle
node_user -->|"requests report"| node_terminal

click node_scanner "https://github.com/flandykumara/storage-cleaner/blob/main/scanner.py"
click node_duplicate "https://github.com/flandykumara/storage-cleaner/blob/main/scanner.py"
click node_rules "https://github.com/flandykumara/storage-cleaner/blob/main/rules.py"
click node_personal "https://github.com/flandykumara/storage-cleaner/blob/main/rules.py"
click node_guidance "https://github.com/flandykumara/storage-cleaner/blob/main/rules.py"
click node_state "https://github.com/flandykumara/storage-cleaner/blob/main/main.py"
click node_http "https://github.com/flandykumara/storage-cleaner/blob/main/main.py"
click node_ui "https://github.com/flandykumara/storage-cleaner/blob/main/ui.html"
click node_browse "https://github.com/flandykumara/storage-cleaner/blob/main/main.py"
click node_extensions "https://github.com/flandykumara/storage-cleaner/blob/main/main.py"
click node_terminal "https://github.com/flandykumara/storage-cleaner/blob/main/main.py"
click node_actions "https://github.com/flandykumara/storage-cleaner/blob/main/actions.py"

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_scanner,node_duplicate,node_user,node_browser toneBlue
class node_rules,node_personal,node_guidance toneAmber
class node_state,node_http,node_ui,node_browse,node_extensions,node_terminal toneMint
class node_actions toneRose
class node_recycle toneIndigo
```

## Components

### Storage scanning

- [Drive scanner](https://github.com/flandykumara/storage-cleaner/blob/main/scanner.py): `scanner.py`
- [Duplicate detector](https://github.com/flandykumara/storage-cleaner/blob/main/scanner.py): `scanner.py`

### Analysis and guidance

- [Cleanup rules](https://github.com/flandykumara/storage-cleaner/blob/main/rules.py): `rules.py`
- [Personal-file categories](https://github.com/flandykumara/storage-cleaner/blob/main/rules.py): `rules.py`
- [System and app guidance](https://github.com/flandykumara/storage-cleaner/blob/main/rules.py): `rules.py`

### Local interface

- [Scan state and report](https://github.com/flandykumara/storage-cleaner/blob/main/main.py): `main.py`
- [Local API server](https://github.com/flandykumara/storage-cleaner/blob/main/main.py): `main.py`
- [Browser interface](https://github.com/flandykumara/storage-cleaner/blob/main/ui.html): `ui.html`
- [Folder and file views](https://github.com/flandykumara/storage-cleaner/blob/main/main.py): `main.py`
- [File-type totals](https://github.com/flandykumara/storage-cleaner/blob/main/main.py): `main.py`
- [Terminal report](https://github.com/flandykumara/storage-cleaner/blob/main/main.py): `main.py`

### Cleanup operations

- [Cleanup executor](https://github.com/flandykumara/storage-cleaner/blob/main/actions.py): `actions.py`

### Other components

- **User**
- **Browser**
- **Windows Recycle Bin**

## Connections

- User → Browser: opens (evidence: `README.md`)
- Browser → Local API server: requests (evidence: `main.py`)
- Local API server → Browser interface: serves (evidence: `main.py`)
- Local API server → Scan state and report: routes requests (evidence: `main.py`)
- Scan state and report → Drive scanner: runs scan (evidence: `main.py`)
- Scan state and report → Cleanup rules: classifies results (evidence: `main.py`)
- Scan state and report → Duplicate detector: checks candidates (evidence: `main.py`)
- Scan state and report → System and app guidance: builds guidance (evidence: `main.py`)
- Scan state and report → File-type totals: calculates totals (evidence: `main.py`)
- Scan state and report → Folder and file views: provides views (evidence: `main.py`)
- Cleanup rules → Personal-file categories: defines categories (evidence: `rules.py`)
- User → Local API server: starts scan (evidence: `README.md`)
- User → Local API server: confirms cleanup (evidence: `README.md`)
- Local API server → Cleanup executor: calls cleanup (evidence: `main.py`)
- Cleanup executor → Cleanup rules: checks protection (evidence: `actions.py`)
- Cleanup executor → Drive scanner: checks links (evidence: `actions.py`)
- Cleanup executor → Windows Recycle Bin: recycles files (evidence: `actions.py`)
- User → Terminal report: requests report (evidence: `README.md`)
