# fateyevstanislav/disk-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/fateyevstanislav/disk-analyzer
- Repository: https://github.com/fateyevstanislav/disk-analyzer

## Overview

Disk Analyzer is a WinForms desktop client backed by a REST API for analyzing files and folders. The user selects a path, depth, filters, and an operation; the API builds the requested strategies, domain services scan the filesystem and return measurement, grouping, or duplicate results. The client also exposes analysis history and filter metadata. The README documents dynamic discovery of filters, groupers, and measurements; the sampled request-info controller explicitly exposes filters, so metadata wiring beyond that is not shown here.

Main entry points: [`DiskAnalyzer/DiskAnalyzer.Api/Controllers`](https://github.com/fateyevstanislav/disk-analyzer/tree/main/DiskAnalyzer/DiskAnalyzer.Api/Controllers) (Analysis controllers), [`DiskAnalyzer/DiskAnalyzer.Domain/Services/DirectoryWalker.cs`](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Domain/Services/DirectoryWalker.cs) (Directory scanner), [`DiskAnalyzer/DiskAnalyzer.UI/Infrastructure/ApiClient.cs`](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.UI/Infrastructure/ApiClient.cs) (API client), [`DiskAnalyzer/DiskAnalyzer.Api/Program.cs`](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Api/Program.cs) (Analysis API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Desktop client"]
  node_ui["Main window"]
  node_httpclient["API client<br/>[ApiClient.cs]"]
end

subgraph group_api["REST API"]
  node_api_server["Analysis API<br/>[Program.cs]"]
  node_analysis_routes["Analysis controllers<br/>[Controllers]"]
  node_filter_factory["Filter factory<br/>[FilterFactory.cs]"]
  node_strategy_factories["Strategy factories<br/>[Factories]"]
  node_request_info["Filter metadata"]
  node_reflection["Type discovery<br/>[ApiReflection.cs]"]
end

subgraph group_domain["Domain analysis"]
  node_scanner["Directory scanner<br/>[DirectoryWalker.cs]"]
  node_filters["File filters<br/>[Filters]"]
  node_measurements["File measurements<br/>[FilesMeasurements]"]
  node_measurer["Measurement service<br/>[FilesMeasurer.cs]"]
  node_groupers["File groupers<br/>[Groupers]"]
  node_group_service["Grouping service<br/>[FilesGrouper.cs]"]
  node_duplicate_service["Duplicate finder"]
end

subgraph group_history["History storage"]
  node_history_controller["History controller"]
  node_repository[("In-memory history")]
end

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

node_user -->|"configures analysis"| node_ui
node_ui -->|"submits requests"| node_httpclient
node_httpclient -->|"sends HTTP"| node_api_server
node_api_server -->|"dispatches routes"| node_analysis_routes
node_analysis_routes -->|"creates filters"| node_filter_factory
node_analysis_routes -->|"creates strategies"| node_strategy_factories
node_filter_factory -->|"instantiates"| node_filters
node_strategy_factories -->|"instantiates"| node_measurements
node_strategy_factories -->|"instantiates"| node_groupers
node_analysis_routes -->|"measures files"| node_measurer
node_analysis_routes -->|"groups files"| node_group_service
node_analysis_routes -->|"finds duplicates"| node_duplicate_service
node_measurer -->|"scans through"| node_scanner
node_group_service -->|"scans through"| node_scanner
node_duplicate_service -->|"scans through"| node_scanner
node_scanner -->|"reads files"| node_filesystem
node_scanner -->|"applies"| node_filters
node_measurer -->|"computes"| node_measurements
node_group_service -->|"groups by"| node_groupers
node_analysis_routes -->|"returns results"| node_ui
node_httpclient -->|"history requests"| node_history_controller
node_history_controller -->|"reads and writes"| node_repository
node_httpclient -->|"requests filters"| node_request_info
node_request_info -->|"gets filter data"| node_reflection
node_api_server -->|"initializes discovery"| node_reflection

click node_ui "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.UI/Forms/MainWindow.Designer.cs"
click node_httpclient "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.UI/Infrastructure/ApiClient.cs"
click node_api_server "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Api/Program.cs"
click node_analysis_routes "https://github.com/fateyevstanislav/disk-analyzer/tree/main/DiskAnalyzer/DiskAnalyzer.Api/Controllers"
click node_filter_factory "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Api/Factories/FilterFactory.cs"
click node_strategy_factories "https://github.com/fateyevstanislav/disk-analyzer/tree/main/DiskAnalyzer/DiskAnalyzer.Api/Factories"
click node_request_info "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Api/Controllers/RequestInfoController.cs"
click node_reflection "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Api/Modules/ApiReflection.cs"
click node_scanner "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Domain/Services/DirectoryWalker.cs"
click node_filters "https://github.com/fateyevstanislav/disk-analyzer/tree/main/DiskAnalyzer/DiskAnalyzer.Domain/Models/Filters"
click node_measurements "https://github.com/fateyevstanislav/disk-analyzer/tree/main/DiskAnalyzer/DiskAnalyzer.Domain/Services/FilesMeasurements"
click node_measurer "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Domain/Services/FilesMeasurer.cs"
click node_groupers "https://github.com/fateyevstanislav/disk-analyzer/tree/main/DiskAnalyzer/DiskAnalyzer.Domain/Models/Groupers"
click node_group_service "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Domain/Services/FilesGrouper.cs"
click node_duplicate_service "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Domain/Services/DuplicatesFinder.cs"
click node_history_controller "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Api/Controllers/HistoryController.cs"
click node_repository "https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Infrastructure/Repositories/InMemoryRepository.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_ui,node_httpclient,node_user toneBlue
class node_api_server,node_analysis_routes,node_filter_factory,node_strategy_factories,node_request_info,node_reflection,node_filesystem toneAmber
class node_scanner,node_filters,node_measurements,node_measurer,node_groupers,node_group_service,node_duplicate_service toneMint
class node_history_controller,node_repository toneRose
```

## Components

### Desktop client

- [Main window](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.UI/Forms/MainWindow.Designer.cs): `DiskAnalyzer/DiskAnalyzer.UI/Forms/MainWindow.Designer.cs`
- [API client](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.UI/Infrastructure/ApiClient.cs): `DiskAnalyzer/DiskAnalyzer.UI/Infrastructure/ApiClient.cs`

### REST API

- [Analysis API](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Api/Program.cs): `DiskAnalyzer/DiskAnalyzer.Api/Program.cs`
- [Analysis controllers](https://github.com/fateyevstanislav/disk-analyzer/tree/main/DiskAnalyzer/DiskAnalyzer.Api/Controllers): `DiskAnalyzer/DiskAnalyzer.Api/Controllers`
- [Filter factory](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Api/Factories/FilterFactory.cs): `DiskAnalyzer/DiskAnalyzer.Api/Factories/FilterFactory.cs`
- [Strategy factories](https://github.com/fateyevstanislav/disk-analyzer/tree/main/DiskAnalyzer/DiskAnalyzer.Api/Factories): `DiskAnalyzer/DiskAnalyzer.Api/Factories`
- [Filter metadata](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Api/Controllers/RequestInfoController.cs): `DiskAnalyzer/DiskAnalyzer.Api/Controllers/RequestInfoController.cs`
- [Type discovery](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Api/Modules/ApiReflection.cs): `DiskAnalyzer/DiskAnalyzer.Api/Modules/ApiReflection.cs`

### Domain analysis

- [Directory scanner](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Domain/Services/DirectoryWalker.cs): `DiskAnalyzer/DiskAnalyzer.Domain/Services/DirectoryWalker.cs`
- [File filters](https://github.com/fateyevstanislav/disk-analyzer/tree/main/DiskAnalyzer/DiskAnalyzer.Domain/Models/Filters): `DiskAnalyzer/DiskAnalyzer.Domain/Models/Filters`
- [File measurements](https://github.com/fateyevstanislav/disk-analyzer/tree/main/DiskAnalyzer/DiskAnalyzer.Domain/Services/FilesMeasurements): `DiskAnalyzer/DiskAnalyzer.Domain/Services/FilesMeasurements`
- [Measurement service](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Domain/Services/FilesMeasurer.cs): `DiskAnalyzer/DiskAnalyzer.Domain/Services/FilesMeasurer.cs`
- [File groupers](https://github.com/fateyevstanislav/disk-analyzer/tree/main/DiskAnalyzer/DiskAnalyzer.Domain/Models/Groupers): `DiskAnalyzer/DiskAnalyzer.Domain/Models/Groupers`
- [Grouping service](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Domain/Services/FilesGrouper.cs): `DiskAnalyzer/DiskAnalyzer.Domain/Services/FilesGrouper.cs`
- [Duplicate finder](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Domain/Services/DuplicatesFinder.cs): `DiskAnalyzer/DiskAnalyzer.Domain/Services/DuplicatesFinder.cs`

### History storage

- [History controller](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Api/Controllers/HistoryController.cs): `DiskAnalyzer/DiskAnalyzer.Api/Controllers/HistoryController.cs`
- [In-memory history](https://github.com/fateyevstanislav/disk-analyzer/blob/main/DiskAnalyzer/DiskAnalyzer.Infrastructure/Repositories/InMemoryRepository.cs): `DiskAnalyzer/DiskAnalyzer.Infrastructure/Repositories/InMemoryRepository.cs`

### Other components

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

## Connections

- User → Main window: configures analysis
- Main window → API client: submits requests
- API client → Analysis API: sends HTTP
- Analysis API → Analysis controllers: dispatches routes
- Analysis controllers → Filter factory: creates filters
- Analysis controllers → Strategy factories: creates strategies
- Filter factory → File filters: instantiates
- Strategy factories → File measurements: instantiates
- Strategy factories → File groupers: instantiates
- Analysis controllers → Measurement service: measures files
- Analysis controllers → Grouping service: groups files
- Analysis controllers → Duplicate finder: finds duplicates
- Measurement service → Directory scanner: scans through
- Grouping service → Directory scanner: scans through
- Duplicate finder → Directory scanner: scans through
- Directory scanner → Local filesystem: reads files
- Directory scanner → File filters: applies
- Measurement service → File measurements: computes
- Grouping service → File groupers: groups by
- Analysis controllers → Main window: returns results
- API client → History controller: history requests
- History controller → In-memory history: reads and writes
- API client → Filter metadata: requests filters
- Filter metadata → Type discovery: gets filter data
- Analysis API → Type discovery: initializes discovery
