# krezio/roomy architecture

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

- Interactive diagram: https://gitdiagram.com/krezio/roomy
- Repository: https://github.com/krezio/roomy

## Overview

Roomy is an offline Windows disk-space analyzer and safe cleanup desktop app. The main workflow is a user-triggered scan, review of categorized cleanup candidates, confirmation, and cleanup; a separate space map drills into drive contents. Optional background checks report low space or cache candidates without deleting anything. The graph also preserves settings, startup/tray control, notifications, and safety-related cleanup services. Edges are limited to calls visible in excerpts or references documented by the source index; unsampled features are represented without speculative connections.

Main entry points: [`src/Roomy/ViewModels/MainVM.cs`](https://github.com/krezio/roomy/blob/main/src/Roomy/ViewModels/MainVM.cs) (Cleanup view model), [`src/Roomy/Core/Scanner.cs`](https://github.com/krezio/roomy/blob/main/src/Roomy/Core/Scanner.cs) (Cleanup scanner), [`src/Roomy/Services/DesktopController.cs`](https://github.com/krezio/roomy/blob/main/src/Roomy/Services/DesktopController.cs) (Desktop controller), [`src/Roomy/App.xaml.cs`](https://github.com/krezio/roomy/blob/main/src/Roomy/App.xaml.cs) (App startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Desktop interaction"]
  node_app["App startup<br/>[App.xaml.cs]"]
  node_window["Main window<br/>[MainWindow.xaml.cs]"]
  node_mainvm["Cleanup view model<br/>[MainVM.cs]"]
  node_category["Category view model<br/>[CategoryVM.cs]"]
  node_settings["Settings window"]
  node_controls["Custom controls<br/>[Controls.cs]"]
end

subgraph group_analysis["Space analysis"]
  node_scanner["Cleanup scanner<br/>[Scanner.cs]"]
  node_spacevm["Space map view model<br/>[SpaceMapVM.cs]"]
  node_spacescan["Drive space scanner<br/>[SpaceScanner.cs]"]
  node_steam["Steam library reader<br/>[Steam.cs]"]
end

subgraph group_cleanup["Cleanup and safety"]
  node_cleaner["Cleanup executor<br/>[Cleaner.cs]"]
  node_fileops["File safety operations<br/>[FileOps.cs]"]
  node_safefs["Safe filesystem<br/>[SafeFs.cs]"]
  node_native["Windows shell APIs<br/>[Native.cs]"]
end

subgraph group_background["Background features"]
  node_controller["Desktop controller"]
  node_monitor["Background monitor"]
  node_notifications["Toast notifications"]
  node_startup["Startup registration"]
end

subgraph group_support["Shared services"]
  node_preferences[("Preferences store<br/>[Preferences.cs]")]
  node_localization["Localization<br/>[Loc.cs]"]
  node_demo["Demo data<br/>[DemoData.cs]"]
end

node_user(("User"))
node_external{{"Windows environment"}}

node_user -->|"launches"| node_app
node_app -->|"creates"| node_mainvm
node_app -->|"creates"| node_controller
node_user -.->|"uses"| node_window
node_window -->|"binds"| node_mainvm
node_mainvm -->|"runs steps"| node_scanner
node_mainvm -->|"creates"| node_category
node_category -->|"updates selection"| node_mainvm
node_mainvm -->|"cleans selections"| node_cleaner
node_scanner -->|"reads library"| node_steam
node_scanner -->|"reads cache paths"| node_external
node_mainvm -->|"provides map"| node_spacevm
node_spacevm -->|"scans folders"| node_spacescan
node_spacevm -->|"loads sample tree"| node_demo
node_cleaner -->|"delegates file ops"| node_fileops
node_fileops -->|"checks paths"| node_safefs
node_fileops -->|"uses shell APIs"| node_native
node_scanner -->|"queries recycle bin"| node_native
node_app -->|"loads settings"| node_preferences
node_controller -->|"saves settings"| node_preferences
node_controller -->|"refreshes checks"| node_monitor
node_controller -->|"manages alerts"| node_notifications
node_monitor -->|"checks candidates"| node_scanner
node_controller -->|"opens settings"| node_settings
node_settings -->|"applies preferences"| node_controller
node_settings -->|"configures startup"| node_startup
node_app -->|"handles uninstall"| node_startup
node_notifications -->|"shows Windows toasts"| node_external
node_scanner -->|"labels candidates"| node_localization
node_controls -.->|"renders desktop UI"| node_external
node_demo -->|"uses library types"| node_steam

click node_app "https://github.com/krezio/roomy/blob/main/src/Roomy/App.xaml.cs"
click node_window "https://github.com/krezio/roomy/blob/main/src/Roomy/MainWindow.xaml.cs"
click node_mainvm "https://github.com/krezio/roomy/blob/main/src/Roomy/ViewModels/MainVM.cs"
click node_category "https://github.com/krezio/roomy/blob/main/src/Roomy/ViewModels/CategoryVM.cs"
click node_scanner "https://github.com/krezio/roomy/blob/main/src/Roomy/Core/Scanner.cs"
click node_spacevm "https://github.com/krezio/roomy/blob/main/src/Roomy/ViewModels/SpaceMapVM.cs"
click node_spacescan "https://github.com/krezio/roomy/blob/main/src/Roomy/Core/SpaceScanner.cs"
click node_steam "https://github.com/krezio/roomy/blob/main/src/Roomy/Core/Steam.cs"
click node_cleaner "https://github.com/krezio/roomy/blob/main/src/Roomy/Core/Cleaner.cs"
click node_fileops "https://github.com/krezio/roomy/blob/main/src/Roomy/Core/FileOps.cs"
click node_safefs "https://github.com/krezio/roomy/blob/main/src/Roomy/Core/SafeFs.cs"
click node_native "https://github.com/krezio/roomy/blob/main/src/Roomy/Core/Native.cs"
click node_preferences "https://github.com/krezio/roomy/blob/main/src/Roomy/Core/Preferences.cs"
click node_controller "https://github.com/krezio/roomy/blob/main/src/Roomy/Services/DesktopController.cs"
click node_monitor "https://github.com/krezio/roomy/blob/main/src/Roomy/Services/BackgroundMonitor.cs"
click node_notifications "https://github.com/krezio/roomy/blob/main/src/Roomy/Services/NotificationService.cs"
click node_startup "https://github.com/krezio/roomy/blob/main/src/Roomy/Services/StartupRegistration.cs"
click node_settings "https://github.com/krezio/roomy/blob/main/src/Roomy/Views/SettingsWindow.xaml.cs"
click node_localization "https://github.com/krezio/roomy/blob/main/src/Roomy/Localization/Loc.cs"
click node_demo "https://github.com/krezio/roomy/blob/main/src/Roomy/Core/DemoData.cs"
click node_controls "https://github.com/krezio/roomy/blob/main/src/Roomy/Controls/Controls.cs"

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_window,node_mainvm,node_category,node_settings,node_controls,node_user toneBlue
class node_scanner,node_spacevm,node_spacescan,node_steam toneAmber
class node_cleaner,node_fileops,node_safefs,node_native toneMint
class node_controller,node_monitor,node_notifications,node_startup toneRose
class node_preferences,node_localization,node_demo,node_external toneIndigo
```

## Components

### Desktop interaction

- [App startup](https://github.com/krezio/roomy/blob/main/src/Roomy/App.xaml.cs): `src/Roomy/App.xaml.cs`
- [Main window](https://github.com/krezio/roomy/blob/main/src/Roomy/MainWindow.xaml.cs): `src/Roomy/MainWindow.xaml.cs`
- [Cleanup view model](https://github.com/krezio/roomy/blob/main/src/Roomy/ViewModels/MainVM.cs): `src/Roomy/ViewModels/MainVM.cs`
- [Category view model](https://github.com/krezio/roomy/blob/main/src/Roomy/ViewModels/CategoryVM.cs): `src/Roomy/ViewModels/CategoryVM.cs`
- [Settings window](https://github.com/krezio/roomy/blob/main/src/Roomy/Views/SettingsWindow.xaml.cs): `src/Roomy/Views/SettingsWindow.xaml.cs`
- [Custom controls](https://github.com/krezio/roomy/blob/main/src/Roomy/Controls/Controls.cs): `src/Roomy/Controls/Controls.cs`

### Space analysis

- [Cleanup scanner](https://github.com/krezio/roomy/blob/main/src/Roomy/Core/Scanner.cs): `src/Roomy/Core/Scanner.cs`
- [Space map view model](https://github.com/krezio/roomy/blob/main/src/Roomy/ViewModels/SpaceMapVM.cs): `src/Roomy/ViewModels/SpaceMapVM.cs`
- [Drive space scanner](https://github.com/krezio/roomy/blob/main/src/Roomy/Core/SpaceScanner.cs): `src/Roomy/Core/SpaceScanner.cs`
- [Steam library reader](https://github.com/krezio/roomy/blob/main/src/Roomy/Core/Steam.cs): `src/Roomy/Core/Steam.cs`

### Cleanup and safety

- [Cleanup executor](https://github.com/krezio/roomy/blob/main/src/Roomy/Core/Cleaner.cs): `src/Roomy/Core/Cleaner.cs`
- [File safety operations](https://github.com/krezio/roomy/blob/main/src/Roomy/Core/FileOps.cs): `src/Roomy/Core/FileOps.cs`
- [Safe filesystem](https://github.com/krezio/roomy/blob/main/src/Roomy/Core/SafeFs.cs): `src/Roomy/Core/SafeFs.cs`
- [Windows shell APIs](https://github.com/krezio/roomy/blob/main/src/Roomy/Core/Native.cs): `src/Roomy/Core/Native.cs`

### Background features

- [Desktop controller](https://github.com/krezio/roomy/blob/main/src/Roomy/Services/DesktopController.cs): `src/Roomy/Services/DesktopController.cs`
- [Background monitor](https://github.com/krezio/roomy/blob/main/src/Roomy/Services/BackgroundMonitor.cs): `src/Roomy/Services/BackgroundMonitor.cs`
- [Toast notifications](https://github.com/krezio/roomy/blob/main/src/Roomy/Services/NotificationService.cs): `src/Roomy/Services/NotificationService.cs`
- [Startup registration](https://github.com/krezio/roomy/blob/main/src/Roomy/Services/StartupRegistration.cs): `src/Roomy/Services/StartupRegistration.cs`

### Shared services

- [Preferences store](https://github.com/krezio/roomy/blob/main/src/Roomy/Core/Preferences.cs): `src/Roomy/Core/Preferences.cs`
- [Localization](https://github.com/krezio/roomy/blob/main/src/Roomy/Localization/Loc.cs): `src/Roomy/Localization/Loc.cs`
- [Demo data](https://github.com/krezio/roomy/blob/main/src/Roomy/Core/DemoData.cs): `src/Roomy/Core/DemoData.cs`

### Other components

- **User**
- **Windows environment**

## Connections

- User → App startup: launches (evidence: `README.md`)
- App startup → Cleanup view model: creates (evidence: `src/Roomy/App.xaml.cs`)
- App startup → Desktop controller: creates (evidence: `src/Roomy/App.xaml.cs`)
- User → Main window: uses
- Main window → Cleanup view model: binds (evidence: `src/Roomy/MainWindow.xaml.cs`)
- Cleanup view model → Cleanup scanner: runs steps (evidence: `src/Roomy/ViewModels/MainVM.cs`)
- Cleanup view model → Category view model: creates (evidence: `src/Roomy/ViewModels/MainVM.cs`)
- Category view model → Cleanup view model: updates selection (evidence: `src/Roomy/ViewModels/CategoryVM.cs`)
- Cleanup view model → Cleanup executor: cleans selections (evidence: `src/Roomy/ViewModels/MainVM.cs`)
- Cleanup scanner → Steam library reader: reads library (evidence: `src/Roomy/Core/Scanner.cs`)
- Cleanup scanner → Windows environment: reads cache paths (evidence: `src/Roomy/Core/Scanner.cs`)
- Cleanup view model → Space map view model: provides map (evidence: `src/Roomy/ViewModels/MainVM.cs`)
- Space map view model → Drive space scanner: scans folders (evidence: `src/Roomy/ViewModels/SpaceMapVM.cs`)
- Space map view model → Demo data: loads sample tree (evidence: `src/Roomy/ViewModels/SpaceMapVM.cs`)
- Cleanup executor → File safety operations: delegates file ops (evidence: `src/Roomy/Core/Cleaner.cs`)
- File safety operations → Safe filesystem: checks paths (evidence: `src/Roomy/Core/FileOps.cs`)
- File safety operations → Windows shell APIs: uses shell APIs (evidence: `src/Roomy/Core/FileOps.cs`)
- Cleanup scanner → Windows shell APIs: queries recycle bin (evidence: `src/Roomy/Core/Scanner.cs`)
- App startup → Preferences store: loads settings (evidence: `src/Roomy/App.xaml.cs`)
- Desktop controller → Preferences store: saves settings (evidence: `src/Roomy/Services/DesktopController.cs`)
- Desktop controller → Background monitor: refreshes checks (evidence: `src/Roomy/Services/DesktopController.cs`)
- Desktop controller → Toast notifications: manages alerts (evidence: `src/Roomy/Services/DesktopController.cs`)
- Background monitor → Cleanup scanner: checks candidates (evidence: `src/Roomy/Services/BackgroundMonitor.cs`)
- Desktop controller → Settings window: opens settings (evidence: `src/Roomy/Services/DesktopController.cs`)
- Settings window → Desktop controller: applies preferences (evidence: `src/Roomy/Views/SettingsWindow.xaml.cs`)
- Settings window → Startup registration: configures startup (evidence: `src/Roomy/Views/SettingsWindow.xaml.cs`)
- App startup → Startup registration: handles uninstall (evidence: `src/Roomy/App.xaml.cs`)
- Toast notifications → Windows environment: shows Windows toasts (evidence: `src/Roomy/Services/NotificationService.cs`)
- Cleanup scanner → Localization: labels candidates (evidence: `src/Roomy/Core/Scanner.cs`)
- Custom controls → Windows environment: renders desktop UI
- Demo data → Steam library reader: uses library types (evidence: `src/Roomy/Core/DemoData.cs`)
