# rebots-online/windisk-freer architecture

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

- Interactive diagram: https://gitdiagram.com/rebots-online/windisk-freer
- Repository: https://github.com/rebots-online/windisk-freer

## Overview

Disk Occupancy is a Windows disk-usage analyzer and cleaner. Its main workflow selects a fixed drive or folder, scans the filesystem, presents size and file-count summaries in a tree and treemap, then lets licensed users mark and delete items to the Recycle Bin. The single-file application also owns licensing, activation QR display, and scan controls. README documents several UI and cleanup behaviors whose detailed handlers were not included in the excerpts; edges are limited to relationships shown in the excerpts or README.

Main entry points: [`disk_occupancy.py`](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py) (Application window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Filesystem scanning"]
  node_drive["Drive and folder selection<br/>[disk_occupancy.py]"]
  node_scanner["Filesystem scanner<br/>[disk_occupancy.py]"]
  node_scanresult["Scan tree and denied count<br/>[disk_occupancy.py]"]
end

subgraph group_views["Analysis views"]
  node_app["Application window<br/>[disk_occupancy.py]"]
  node_model["Tree model<br/>[disk_occupancy.py]"]
  node_folderview["Folder tree<br/>[disk_occupancy.py]"]
  node_treemap["Treemap view<br/>[disk_occupancy.py]"]
end

subgraph group_cleanup["Selection and cleanup"]
  node_selection["Deletion selection<br/>[disk_occupancy.py]"]
  node_deletegate["Pro deletion gate<br/>[disk_occupancy.py]"]
  node_recycle["Recycle Bin cleanup<br/>[disk_occupancy.py]"]
end

subgraph group_license["Licensing"]
  node_licenseui["License dialog and QR<br/>[disk_occupancy.py]"]
  node_licensemgr["License verification and storage<br/>[disk_occupancy.py]"]
end

node_user(("User"))
node_registry[("Windows user registry")]
node_trash["send2trash service"]
node_explorer["Windows Explorer"]

node_user -->|"uses"| node_app
node_app -->|"chooses path"| node_drive
node_app -->|"starts scan"| node_scanner
node_scanner -->|"produces tree"| node_scanresult
node_app -->|"sets scan root"| node_model
node_model -->|"supplies rows"| node_folderview
node_model -.->|"supplies tree data"| node_treemap
node_user -->|"marks items"| node_selection
node_app -->|"requests deletion"| node_deletegate
node_deletegate -.->|"checks Pro status"| node_licensemgr
node_app -->|"deletes selected"| node_recycle
node_recycle -->|"sends to bin"| node_trash
node_user -->|"activates license"| node_licenseui
node_licenseui -.->|"saves key"| node_licensemgr
node_licensemgr -->|"persists license"| node_registry
node_user -->|"opens location"| node_explorer

click node_app "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py"
click node_drive "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py"
click node_scanner "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py"
click node_scanresult "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py"
click node_model "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py"
click node_folderview "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py"
click node_treemap "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py"
click node_selection "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py"
click node_deletegate "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py"
click node_recycle "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py"
click node_licenseui "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py"
click node_licensemgr "https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.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_drive,node_scanner,node_scanresult,node_user toneBlue
class node_app,node_model,node_folderview,node_treemap,node_registry toneAmber
class node_selection,node_deletegate,node_recycle toneMint
class node_licenseui,node_licensemgr toneRose
class node_trash,node_explorer toneIndigo
```

## Components

### Filesystem scanning

- [Drive and folder selection](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`
- [Filesystem scanner](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`
- [Scan tree and denied count](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`

### Analysis views

- [Application window](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`
- [Tree model](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`
- [Folder tree](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`
- [Treemap view](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`

### Selection and cleanup

- [Deletion selection](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`
- [Pro deletion gate](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`
- [Recycle Bin cleanup](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`

### Licensing

- [License dialog and QR](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`
- [License verification and storage](https://github.com/rebots-online/windisk-freer/blob/master/disk_occupancy.py): `disk_occupancy.py`

### Other components

- **User**
- **Windows user registry**
- **send2trash service**
- **Windows Explorer**

## Connections

- User → Application window: uses (evidence: `README.md`)
- Application window → Drive and folder selection: chooses path (evidence: `README.md`)
- Application window → Filesystem scanner: starts scan (evidence: `disk_occupancy.py`)
- Filesystem scanner → Scan tree and denied count: produces tree (evidence: `disk_occupancy.py`)
- Application window → Tree model: sets scan root (evidence: `disk_occupancy.py`)
- Tree model → Folder tree: supplies rows (evidence: `disk_occupancy.py`)
- Tree model → Treemap view: supplies tree data (evidence: `disk_occupancy.py`)
- User → Deletion selection: marks items (evidence: `README.md`)
- Application window → Pro deletion gate: requests deletion (evidence: `README.md`)
- Pro deletion gate → License verification and storage: checks Pro status (evidence: `disk_occupancy.py`)
- Application window → Recycle Bin cleanup: deletes selected (evidence: `README.md`)
- Recycle Bin cleanup → send2trash service: sends to bin (evidence: `README.md`)
- User → License dialog and QR: activates license (evidence: `README.md`)
- License dialog and QR → License verification and storage: saves key (evidence: `disk_occupancy.py`)
- License verification and storage → Windows user registry: persists license (evidence: `README.md`)
- User → Windows Explorer: opens location (evidence: `README.md`)
