# aryangupta-builds/pc-guardian architecture

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

- Interactive diagram: https://gitdiagram.com/aryangupta-builds/pc-guardian
- Repository: https://github.com/aryangupta-builds/pc-guardian

## Overview

PC Guardian is a Windows-oriented console file manager. Its main workflow is to accept a folder or file path, scan and report on files, let the user inspect or organize them, and record moves for later review or undo. The implementation is a single 160 KB C++ source file, so the distinct responsibilities below share `main.cpp`. README statements support several capabilities whose implementation details were not included in the excerpts; those links are documented rather than inferred from unseen code.

Main entry points: [`main.cpp`](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp) (Menu workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Console workflow"]
  node_cli["Menu workflow<br/>[main.cpp]"]
end

subgraph group_inspection["File inspection"]
  node_scanner["Recursive scanner<br/>[main.cpp]"]
  node_filedata["File details<br/>[main.cpp]"]
  node_analyzer["Storage analysis<br/>[main.cpp]"]
  node_file_report["File report<br/>[main.cpp]"]
  node_filter["File filters<br/>[main.cpp]"]
  node_search["Name search<br/>[main.cpp]"]
  node_sort["File sorting<br/>[main.cpp]"]
end

subgraph group_organization["Organization and recovery"]
  node_category_rules["Category rules<br/>[main.cpp]"]
  node_name_rules["Name rules<br/>[main.cpp]"]
  node_size_rules["Size rules<br/>[main.cpp]"]
  node_preview["Move preview<br/>[main.cpp]"]
  node_move_processor["Move processor<br/>[main.cpp]"]
  node_history["Move history<br/>[main.cpp]"]
  node_undo["Undo changes<br/>[main.cpp]"]
end

node_user(("User"))
node_filesystem[("Local filesystem")]

node_user -->|"chooses actions"| node_cli
node_cli -->|"starts scan"| node_scanner
node_scanner -->|"walks paths"| node_filesystem
node_scanner -->|"collects details"| node_filedata
node_cli -->|"requests analysis"| node_analyzer
node_cli -->|"requests report"| node_file_report
node_cli -->|"filters files"| node_filter
node_cli -->|"searches names"| node_search
node_cli -->|"sorts files"| node_sort
node_cli -->|"selects mode"| node_category_rules
node_cli -->|"selects mode"| node_name_rules
node_cli -->|"selects mode"| node_size_rules
node_category_rules -->|"prepares moves"| node_preview
node_name_rules -->|"prepares moves"| node_preview
node_size_rules -->|"prepares moves"| node_preview
node_preview -->|"confirms moves"| node_move_processor
node_move_processor -->|"moves files"| node_filesystem
node_move_processor -->|"records outcomes"| node_history
node_cli -->|"views history"| node_history
node_history -->|"saves or reads log"| node_filesystem
node_cli -->|"requests undo"| node_undo
node_undo -->|"restores files"| node_filesystem
node_undo -->|"updates batches"| node_history

click node_cli "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_scanner "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_filedata "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_analyzer "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_file_report "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_filter "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_search "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_sort "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_category_rules "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_name_rules "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_size_rules "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_preview "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_move_processor "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_history "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"
click node_undo "https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp"

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_cli,node_user toneBlue
class node_scanner,node_filedata,node_analyzer,node_file_report,node_filter,node_search,node_sort,node_filesystem toneAmber
class node_category_rules,node_name_rules,node_size_rules,node_preview,node_move_processor,node_history,node_undo toneMint
```

## Components

### Console workflow

- [Menu workflow](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`

### File inspection

- [Recursive scanner](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [File details](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [Storage analysis](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [File report](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [File filters](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [Name search](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [File sorting](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`

### Organization and recovery

- [Category rules](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [Name rules](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [Size rules](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [Move preview](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [Move processor](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [Move history](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`
- [Undo changes](https://github.com/aryangupta-builds/pc-guardian/blob/main/main.cpp): `main.cpp`

### Other components

- **User**
- **Local filesystem**

## Connections

- User → Menu workflow: chooses actions (evidence: `README.md`)
- Menu workflow → Recursive scanner: starts scan (evidence: `README.md`)
- Recursive scanner → Local filesystem: walks paths (evidence: `README.md`)
- Recursive scanner → File details: collects details (evidence: `README.md`)
- Menu workflow → Storage analysis: requests analysis (evidence: `README.md`)
- Menu workflow → File report: requests report (evidence: `README.md`)
- Menu workflow → File filters: filters files (evidence: `main.cpp`)
- Menu workflow → Name search: searches names (evidence: `README.md`)
- Menu workflow → File sorting: sorts files (evidence: `main.cpp`)
- Menu workflow → Category rules: selects mode (evidence: `README.md`)
- Menu workflow → Name rules: selects mode (evidence: `README.md`)
- Menu workflow → Size rules: selects mode (evidence: `main.cpp`)
- Category rules → Move preview: prepares moves (evidence: `README.md`)
- Name rules → Move preview: prepares moves (evidence: `README.md`)
- Size rules → Move preview: prepares moves (evidence: `README.md`)
- Move preview → Move processor: confirms moves (evidence: `README.md`)
- Move processor → Local filesystem: moves files (evidence: `README.md`)
- Move processor → Move history: records outcomes (evidence: `main.cpp`)
- Menu workflow → Move history: views history (evidence: `README.md`)
- Move history → Local filesystem: saves or reads log (evidence: `README.md`)
- Menu workflow → Undo changes: requests undo (evidence: `README.md`)
- Undo changes → Local filesystem: restores files (evidence: `main.cpp`)
- Undo changes → Move history: updates batches (evidence: `main.cpp`)
