# tutyamxx/steam-sweep architecture

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

## Overview

Steam Sweep is a Windows Electron utility that discovers Steam libraries and games, scans for removable leftovers, lets users review and select candidates with reclaimable sizes, then revalidates and moves selected items to the Recycle Bin. The renderer presents scanning and cleanup controls; Electron main-process handlers coordinate discovery, worker-based scanning, cleanup, window actions, and updates. README capabilities are retained, including multi-library discovery and automatic updates. Some renderer-to-main IPC wiring is not shown in the excerpts, so that boundary is marked unverified.

Main entry points: [`electron/main.ts`](https://github.com/tutyamxx/steam-sweep/blob/main/electron/main.ts) (IPC orchestration), [`src/pages/Home.tsx`](https://github.com/tutyamxx/steam-sweep/blob/main/src/pages/Home.tsx) (Home workflow), [`electron/cleanup/scanner.ts`](https://github.com/tutyamxx/steam-sweep/blob/main/electron/cleanup/scanner.ts) (Leftover scanner), [`electron/cleanup/cleanup.ts`](https://github.com/tutyamxx/steam-sweep/blob/main/electron/cleanup/cleanup.ts) (Validated cleanup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_renderer["Desktop interface"]
  node_home["Home workflow<br/>[Home.tsx]"]
  node_scan_ui["Scan controls<br/>[ScanSection.tsx]"]
  node_candidate_ui["Candidate selection<br/>[CleanupList.tsx]"]
  node_title_ui["Window controls<br/>[TitleBar.tsx]"]
  node_branding["Logo display<br/>[SteamSweepLogo.tsx]"]
end

subgraph group_electron["Electron runtime"]
  node_main["IPC orchestration<br/>[main.ts]"]
  node_preload["Renderer bridge<br/>[preload.ts]"]
  node_updater["App updates<br/>[updater.ts]"]
end

subgraph group_discovery["Steam discovery"]
  node_steam_install["Steam installation lookup<br/>[discovery.ts]"]
  node_libraries["Library discovery<br/>[libraryFolders.ts]"]
  node_games["Installed game discovery<br/>[games.ts]"]
  node_manifests["Game manifests<br/>[manifests.ts]"]
end

subgraph group_cleanup["Scan and cleanup"]
  node_worker["Scan worker<br/>[scanner.worker.ts]"]
  node_scanner["Leftover scanner<br/>[scanner.ts]"]
  node_rules["Detection rules<br/>[rules.ts]"]
  node_cleaner["Validated cleanup<br/>[cleanup.ts]"]
end

subgraph group_support["Shared support"]
  node_candidate_types["Candidate data contract<br/>[cleanup.ts]"]
end

node_user(("Steam Sweep user"))
node_filesystem[("Local game files")]
node_recycle_bin[("Windows Recycle Bin")]

node_user -->|"uses"| node_home
node_home -->|"renders"| node_scan_ui
node_home -->|"renders"| node_candidate_ui
node_home -->|"renders"| node_title_ui
node_home -->|"renders"| node_branding
node_home -.->|"requests scan and cleanup"| node_main
node_main -.->|"exposes renderer bridge"| node_preload
node_main -->|"locates Steam"| node_steam_install
node_main -->|"discovers libraries"| node_libraries
node_main -->|"finds installed games"| node_games
node_main -->|"dispatches scans"| node_worker
node_worker -->|"runs scan logic"| node_scanner
node_main -->|"cleans validated candidates"| node_cleaner
node_games -->|"reads manifests"| node_manifests
node_scanner -->|"applies detection rules"| node_rules
node_scanner -->|"inspects files"| node_filesystem
node_cleaner -->|"revalidates candidates"| node_filesystem
node_cleaner -->|"moves selected items"| node_recycle_bin
node_main -->|"sets up updates"| node_updater
node_home -.->|"shows update status"| node_updater
node_candidate_ui -->|"displays candidates"| node_candidate_types

click node_home "https://github.com/tutyamxx/steam-sweep/blob/main/src/pages/Home.tsx"
click node_scan_ui "https://github.com/tutyamxx/steam-sweep/blob/main/src/components/ScanSection.tsx"
click node_candidate_ui "https://github.com/tutyamxx/steam-sweep/blob/main/src/components/CleanupList.tsx"
click node_title_ui "https://github.com/tutyamxx/steam-sweep/blob/main/src/components/TitleBar.tsx"
click node_branding "https://github.com/tutyamxx/steam-sweep/blob/main/src/components/SteamSweepLogo.tsx"
click node_main "https://github.com/tutyamxx/steam-sweep/blob/main/electron/main.ts"
click node_preload "https://github.com/tutyamxx/steam-sweep/blob/main/electron/preload.ts"
click node_updater "https://github.com/tutyamxx/steam-sweep/blob/main/electron/updater.ts"
click node_steam_install "https://github.com/tutyamxx/steam-sweep/blob/main/electron/steam/discovery.ts"
click node_libraries "https://github.com/tutyamxx/steam-sweep/blob/main/electron/steam/libraryFolders.ts"
click node_games "https://github.com/tutyamxx/steam-sweep/blob/main/electron/steam/games.ts"
click node_manifests "https://github.com/tutyamxx/steam-sweep/blob/main/electron/steam/manifests.ts"
click node_worker "https://github.com/tutyamxx/steam-sweep/blob/main/electron/cleanup/scanner.worker.ts"
click node_scanner "https://github.com/tutyamxx/steam-sweep/blob/main/electron/cleanup/scanner.ts"
click node_rules "https://github.com/tutyamxx/steam-sweep/blob/main/electron/cleanup/rules.ts"
click node_cleaner "https://github.com/tutyamxx/steam-sweep/blob/main/electron/cleanup/cleanup.ts"
click node_candidate_types "https://github.com/tutyamxx/steam-sweep/blob/main/types/cleanup.ts"

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_home,node_scan_ui,node_candidate_ui,node_title_ui,node_branding,node_user toneBlue
class node_main,node_preload,node_updater,node_filesystem,node_recycle_bin toneAmber
class node_steam_install,node_libraries,node_games,node_manifests toneMint
class node_worker,node_scanner,node_rules,node_cleaner toneRose
class node_candidate_types toneIndigo
```

## Components

### Desktop interface

- [Home workflow](https://github.com/tutyamxx/steam-sweep/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Scan controls](https://github.com/tutyamxx/steam-sweep/blob/main/src/components/ScanSection.tsx): `src/components/ScanSection.tsx`
- [Candidate selection](https://github.com/tutyamxx/steam-sweep/blob/main/src/components/CleanupList.tsx): `src/components/CleanupList.tsx`
- [Window controls](https://github.com/tutyamxx/steam-sweep/blob/main/src/components/TitleBar.tsx): `src/components/TitleBar.tsx`
- [Logo display](https://github.com/tutyamxx/steam-sweep/blob/main/src/components/SteamSweepLogo.tsx): `src/components/SteamSweepLogo.tsx`

### Electron runtime

- [IPC orchestration](https://github.com/tutyamxx/steam-sweep/blob/main/electron/main.ts): `electron/main.ts`
- [Renderer bridge](https://github.com/tutyamxx/steam-sweep/blob/main/electron/preload.ts): `electron/preload.ts`
- [App updates](https://github.com/tutyamxx/steam-sweep/blob/main/electron/updater.ts): `electron/updater.ts`

### Steam discovery

- [Steam installation lookup](https://github.com/tutyamxx/steam-sweep/blob/main/electron/steam/discovery.ts): `electron/steam/discovery.ts`
- [Library discovery](https://github.com/tutyamxx/steam-sweep/blob/main/electron/steam/libraryFolders.ts): `electron/steam/libraryFolders.ts`
- [Installed game discovery](https://github.com/tutyamxx/steam-sweep/blob/main/electron/steam/games.ts): `electron/steam/games.ts`
- [Game manifests](https://github.com/tutyamxx/steam-sweep/blob/main/electron/steam/manifests.ts): `electron/steam/manifests.ts`

### Scan and cleanup

- [Scan worker](https://github.com/tutyamxx/steam-sweep/blob/main/electron/cleanup/scanner.worker.ts): `electron/cleanup/scanner.worker.ts`
- [Leftover scanner](https://github.com/tutyamxx/steam-sweep/blob/main/electron/cleanup/scanner.ts): `electron/cleanup/scanner.ts`
- [Detection rules](https://github.com/tutyamxx/steam-sweep/blob/main/electron/cleanup/rules.ts): `electron/cleanup/rules.ts`
- [Validated cleanup](https://github.com/tutyamxx/steam-sweep/blob/main/electron/cleanup/cleanup.ts): `electron/cleanup/cleanup.ts`

### Shared support

- [Candidate data contract](https://github.com/tutyamxx/steam-sweep/blob/main/types/cleanup.ts): `types/cleanup.ts`

### Other components

- **Steam Sweep user**
- **Local game files**
- **Windows Recycle Bin**

## Connections

- Steam Sweep user → Home workflow: uses (evidence: `README.md`)
- Home workflow → Scan controls: renders (evidence: `src/pages/Home.tsx`)
- Home workflow → Candidate selection: renders (evidence: `src/pages/Home.tsx`)
- Home workflow → Window controls: renders (evidence: `src/pages/Home.tsx`)
- Home workflow → Logo display: renders (evidence: `src/pages/Home.tsx`)
- Home workflow → IPC orchestration: requests scan and cleanup
- IPC orchestration → Renderer bridge: exposes renderer bridge
- IPC orchestration → Steam installation lookup: locates Steam (evidence: `electron/main.ts`)
- IPC orchestration → Library discovery: discovers libraries (evidence: `electron/main.ts`)
- IPC orchestration → Installed game discovery: finds installed games (evidence: `electron/main.ts`)
- IPC orchestration → Scan worker: dispatches scans (evidence: `electron/main.ts`)
- Scan worker → Leftover scanner: runs scan logic (evidence: `electron/cleanup/scanner.worker.ts`)
- IPC orchestration → Validated cleanup: cleans validated candidates (evidence: `electron/main.ts`)
- Installed game discovery → Game manifests: reads manifests (evidence: `electron/steam/games.ts`)
- Leftover scanner → Detection rules: applies detection rules (evidence: `electron/cleanup/scanner.ts`)
- Leftover scanner → Local game files: inspects files (evidence: `README.md`)
- Validated cleanup → Local game files: revalidates candidates
- Validated cleanup → Windows Recycle Bin: moves selected items (evidence: `README.md`)
- IPC orchestration → App updates: sets up updates (evidence: `electron/main.ts`)
- Home workflow → App updates: shows update status
- Candidate selection → Candidate data contract: displays candidates (evidence: `src/components/CleanupList.tsx`)
