# suryanshswarn09/mem-map architecture

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

- Interactive diagram: https://gitdiagram.com/suryanshswarn09/mem-map
- Repository: https://github.com/suryanshswarn09/mem-map

## Overview

Mem-Map is a Windows Qt desktop disk-space analyzer. A user chooses a drive or folder and starts an asynchronous scan; the resulting DiskNode tree drives directory and visual views, analytics, duplicate checks, reports, and snapshot comparison. The graph emphasizes those user-facing stages and the scan/model layer. Unsampled modules are included where README or indexed references establish their role; links without direct shown evidence are omitted.

Main entry points: [`src/ui/MainWindow.cpp`](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/MainWindow.cpp) (Main window), [`src/core/SnapshotEngine.cpp`](https://github.com/suryanshswarn09/mem-map/blob/main/src/core/SnapshotEngine.cpp) (Snapshot engine), [`src/core/ScannerEngine.cpp`](https://github.com/suryanshswarn09/mem-map/blob/main/src/core/ScannerEngine.cpp) (Async scanner), [`src/main.cpp`](https://github.com/suryanshswarn09/mem-map/blob/main/src/main.cpp) (Application startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Desktop shell"]
  node_app["Application startup<br/>[main.cpp]"]
  node_window["Main window<br/>[MainWindow.cpp]"]
end

subgraph group_scan["Scan and model"]
  node_scanner["Async scanner<br/>[ScannerEngine.cpp]"]
  node_tree["Disk tree model<br/>[DiskNode.cpp]"]
  node_duplicate_engine["Duplicate finder"]
end

subgraph group_explore["Explore and analyze"]
  node_directory_view["Directory tree view<br/>[DiskTreeModel.cpp]"]
  node_size_delegate["Size bar delegate"]
  node_breadcrumbs["Breadcrumb navigation"]
  node_treemap_layout["Treemap layout<br/>[TreemapLayout.cpp]"]
  node_treemap["Treemap visualizer<br/>[TreemapWidget.cpp]"]
  node_sunburst["Sunburst visualizer<br/>[SunburstWidget.cpp]"]
  node_extension_stats["Extension statistics"]
  node_top_files["Largest files<br/>[TopFilesWidget.cpp]"]
  node_duplicate_widget["Duplicate review"]
end

subgraph group_history["Reports and snapshots"]
  node_report["Report exporter<br/>[ReportExporter.cpp]"]
  node_snapshot["Snapshot engine<br/>[SnapshotEngine.cpp]"]
  node_diff_view["Snapshot diff view"]
end

subgraph group_shared["Shared presentation"]
  node_theme["Theme manager<br/>[ThemeManager.cpp]"]
  node_about["Creator profile dialog<br/>[AboutDialog.cpp]"]
  node_profile["Creator profile data<br/>[CreatorProfile.h]"]
end

node_user(("Desktop user"))
node_filesystem[("Local filesystem")]
node_snapshot_files[("Snapshot files")]
node_browser(("Default browser"))

node_user -->|"launches"| node_app
node_app -->|"opens"| node_window
node_user -->|"chooses scan"| node_window
node_window -->|"starts scan"| node_scanner
node_scanner -->|"reads entries"| node_filesystem
node_scanner -->|"builds tree"| node_tree
node_window -->|"receives scan result"| node_tree
node_window -->|"populates"| node_directory_view
node_window -->|"sets scan root"| node_treemap
node_window -->|"sets scan root"| node_sunburst
node_window -->|"populates"| node_extension_stats
node_window -->|"populates"| node_top_files
node_window -->|"sets scan root"| node_duplicate_widget
node_directory_view -.->|"renders sizes"| node_size_delegate
node_treemap -->|"uses layout"| node_treemap_layout
node_window -->|"sets navigation root"| node_breadcrumbs
node_window -.->|"starts duplicate scan"| node_duplicate_engine
node_duplicate_widget -->|"presents results"| node_duplicate_engine
node_window -->|"exports report"| node_report
node_report -->|"opens HTML report"| node_browser
node_window -->|"saves snapshot"| node_snapshot
node_snapshot -->|"writes snapshot"| node_snapshot_files
node_window -.->|"loads and compares"| node_snapshot
node_snapshot -.->|"provides diff data"| node_diff_view
node_window -->|"applies theme"| node_theme
node_window -->|"opens profile"| node_about
node_about -->|"uses profile data"| node_profile

click node_app "https://github.com/suryanshswarn09/mem-map/blob/main/src/main.cpp"
click node_window "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/MainWindow.cpp"
click node_scanner "https://github.com/suryanshswarn09/mem-map/blob/main/src/core/ScannerEngine.cpp"
click node_tree "https://github.com/suryanshswarn09/mem-map/blob/main/src/core/DiskNode.cpp"
click node_directory_view "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/DiskTreeModel.cpp"
click node_size_delegate "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/SizeBarDelegate.cpp"
click node_breadcrumbs "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/BreadcrumbWidget.cpp"
click node_treemap_layout "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/TreemapLayout.cpp"
click node_treemap "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/TreemapWidget.cpp"
click node_sunburst "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/SunburstWidget.cpp"
click node_extension_stats "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/ExtensionStatsWidget.cpp"
click node_top_files "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/TopFilesWidget.cpp"
click node_duplicate_widget "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/DuplicateFilesWidget.cpp"
click node_duplicate_engine "https://github.com/suryanshswarn09/mem-map/blob/main/src/core/DuplicateFinder.cpp"
click node_report "https://github.com/suryanshswarn09/mem-map/blob/main/src/core/ReportExporter.cpp"
click node_snapshot "https://github.com/suryanshswarn09/mem-map/blob/main/src/core/SnapshotEngine.cpp"
click node_diff_view "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/SnapshotDiffWidget.cpp"
click node_theme "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/ThemeManager.cpp"
click node_about "https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/AboutDialog.cpp"
click node_profile "https://github.com/suryanshswarn09/mem-map/blob/main/src/core/CreatorProfile.h"

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_user,node_browser toneBlue
class node_scanner,node_tree,node_duplicate_engine,node_filesystem,node_snapshot_files toneAmber
class node_directory_view,node_size_delegate,node_breadcrumbs,node_treemap_layout,node_treemap,node_sunburst,node_extension_stats,node_top_files,node_duplicate_widget toneMint
class node_report,node_snapshot,node_diff_view toneRose
class node_theme,node_about,node_profile toneIndigo
```

## Components

### Desktop shell

- [Application startup](https://github.com/suryanshswarn09/mem-map/blob/main/src/main.cpp): `src/main.cpp`
- [Main window](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/MainWindow.cpp): `src/ui/MainWindow.cpp`

### Scan and model

- [Async scanner](https://github.com/suryanshswarn09/mem-map/blob/main/src/core/ScannerEngine.cpp): `src/core/ScannerEngine.cpp`
- [Disk tree model](https://github.com/suryanshswarn09/mem-map/blob/main/src/core/DiskNode.cpp): `src/core/DiskNode.cpp`
- [Duplicate finder](https://github.com/suryanshswarn09/mem-map/blob/main/src/core/DuplicateFinder.cpp): `src/core/DuplicateFinder.cpp`

### Explore and analyze

- [Directory tree view](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/DiskTreeModel.cpp): `src/ui/DiskTreeModel.cpp`
- [Size bar delegate](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/SizeBarDelegate.cpp): `src/ui/SizeBarDelegate.cpp`
- [Breadcrumb navigation](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/BreadcrumbWidget.cpp): `src/ui/BreadcrumbWidget.cpp`
- [Treemap layout](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/TreemapLayout.cpp): `src/ui/TreemapLayout.cpp`
- [Treemap visualizer](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/TreemapWidget.cpp): `src/ui/TreemapWidget.cpp`
- [Sunburst visualizer](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/SunburstWidget.cpp): `src/ui/SunburstWidget.cpp`
- [Extension statistics](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/ExtensionStatsWidget.cpp): `src/ui/ExtensionStatsWidget.cpp`
- [Largest files](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/TopFilesWidget.cpp): `src/ui/TopFilesWidget.cpp`
- [Duplicate review](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/DuplicateFilesWidget.cpp): `src/ui/DuplicateFilesWidget.cpp`

### Reports and snapshots

- [Report exporter](https://github.com/suryanshswarn09/mem-map/blob/main/src/core/ReportExporter.cpp): `src/core/ReportExporter.cpp`
- [Snapshot engine](https://github.com/suryanshswarn09/mem-map/blob/main/src/core/SnapshotEngine.cpp): `src/core/SnapshotEngine.cpp`
- [Snapshot diff view](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/SnapshotDiffWidget.cpp): `src/ui/SnapshotDiffWidget.cpp`

### Shared presentation

- [Theme manager](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/ThemeManager.cpp): `src/ui/ThemeManager.cpp`
- [Creator profile dialog](https://github.com/suryanshswarn09/mem-map/blob/main/src/ui/AboutDialog.cpp): `src/ui/AboutDialog.cpp`
- [Creator profile data](https://github.com/suryanshswarn09/mem-map/blob/main/src/core/CreatorProfile.h): `src/core/CreatorProfile.h`

### Other components

- **Desktop user**
- **Local filesystem**
- **Snapshot files**
- **Default browser**

## Connections

- Desktop user → Application startup: launches (evidence: `README.md`)
- Application startup → Main window: opens (evidence: `src/main.cpp`)
- Desktop user → Main window: chooses scan (evidence: `README.md`)
- Main window → Async scanner: starts scan
- Async scanner → Local filesystem: reads entries (evidence: `src/core/ScannerEngine.cpp`)
- Async scanner → Disk tree model: builds tree (evidence: `src/core/ScannerEngine.cpp`)
- Main window → Disk tree model: receives scan result
- Main window → Directory tree view: populates (evidence: `src/ui/MainWindow.cpp`)
- Main window → Treemap visualizer: sets scan root (evidence: `src/ui/MainWindow.cpp`)
- Main window → Sunburst visualizer: sets scan root (evidence: `src/ui/MainWindow.cpp`)
- Main window → Extension statistics: populates (evidence: `src/ui/MainWindow.cpp`)
- Main window → Largest files: populates (evidence: `src/ui/MainWindow.cpp`)
- Main window → Duplicate review: sets scan root (evidence: `src/ui/MainWindow.cpp`)
- Directory tree view → Size bar delegate: renders sizes
- Treemap visualizer → Treemap layout: uses layout
- Main window → Breadcrumb navigation: sets navigation root (evidence: `src/ui/MainWindow.cpp`)
- Main window → Duplicate finder: starts duplicate scan
- Duplicate review → Duplicate finder: presents results
- Main window → Report exporter: exports report (evidence: `src/ui/MainWindow.cpp`)
- Report exporter → Default browser: opens HTML report (evidence: `README.md`)
- Main window → Snapshot engine: saves snapshot (evidence: `src/ui/MainWindow.cpp`)
- Snapshot engine → Snapshot files: writes snapshot (evidence: `src/core/SnapshotEngine.cpp`)
- Main window → Snapshot engine: loads and compares
- Snapshot engine → Snapshot diff view: provides diff data
- Main window → Theme manager: applies theme (evidence: `src/ui/MainWindow.cpp`)
- Main window → Creator profile dialog: opens profile (evidence: `src/ui/MainWindow.cpp`)
- Creator profile dialog → Creator profile data: uses profile data
