# n-romanovich/usb-test architecture

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

- Interactive diagram: https://gitdiagram.com/n-romanovich/usb-test
- Repository: https://github.com/n-romanovich/usb-test

## Overview

USB Test is a Windows utility for checking removable drives. Its principal workflow is to launch the app, choose a drive and test mode, run sector checks, and review results. The README also describes history, comparison, import/export, and feedback capabilities. The sampled entry point calls language setup and the main menu and initializes the drive list; most feature implementations were not sampled, so their internal wiring is left unverified.

Main entry points: [`USB Test/src/menu.cpp`](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/menu.cpp) (Menus), [`USB Test/src/main.cpp`](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/main.cpp) (Application entry), [`USB Test/src/json_utils.cpp`](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/json_utils.cpp) (Test data), [`USB Test/src/drivetest.cpp`](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/drivetest.cpp) (Sector tests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_app["Application entry<br/>[main.cpp]"]
  node_menus["Menus<br/>[menu.cpp]"]
  node_messages["Prompts and results<br/>[messages.cpp]"]
end

subgraph group_testing["Drive testing"]
  node_drives["Drive information<br/>[driveinfo.cpp]"]
  node_drive_test["Sector tests<br/>[drivetest.cpp]"]
end

subgraph group_records["Test records"]
  node_json["JSON support<br/>[json.hpp]"]
  node_data["Test data<br/>[json_utils.cpp]"]
  node_history["Test history<br/>[history.cpp]"]
end

subgraph group_support["App support"]
  node_language["Language setup<br/>[lang.cpp]"]
  node_feedback["Feedback<br/>[feedback.cpp]"]
  node_version["Update check<br/>[version.cpp]"]
end

node_user(("User"))
node_update_service["Version server"]

node_user -->|"launches"| node_app
node_app -->|"sets language"| node_language
node_app -->|"opens menu"| node_menus
node_app -->|"loads drives"| node_drives
node_menus -.->|"starts test"| node_drive_test
node_menus -.->|"opens history"| node_history
node_menus -.->|"offers comparison"| node_data
node_drive_test -.->|"records results"| node_data
node_data -.->|"uses JSON"| node_json
node_menus -.->|"offers feedback"| node_feedback
node_menus -.->|"checks updates"| node_version
node_version -->|"checks version"| node_update_service

click node_app "https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/main.cpp"
click node_menus "https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/menu.cpp"
click node_messages "https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/messages.cpp"
click node_language "https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/lang.cpp"
click node_drives "https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/driveinfo.cpp"
click node_drive_test "https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/drivetest.cpp"
click node_json "https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/include/json.hpp"
click node_data "https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/json_utils.cpp"
click node_history "https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/history.cpp"
click node_feedback "https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/feedback.cpp"
click node_version "https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/version.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_app,node_menus,node_messages,node_user toneBlue
class node_drives,node_drive_test toneAmber
class node_json,node_data,node_history,node_update_service toneMint
class node_language,node_feedback,node_version toneRose
```

## Components

### User interface

- [Application entry](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/main.cpp): `USB Test/src/main.cpp`
- [Menus](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/menu.cpp): `USB Test/src/menu.cpp`
- [Prompts and results](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/messages.cpp): `USB Test/src/messages.cpp`

### Drive testing

- [Drive information](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/driveinfo.cpp): `USB Test/src/driveinfo.cpp`
- [Sector tests](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/drivetest.cpp): `USB Test/src/drivetest.cpp`

### Test records

- [JSON support](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/include/json.hpp): `USB Test/src/include/json.hpp`
- [Test data](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/json_utils.cpp): `USB Test/src/json_utils.cpp`
- [Test history](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/history.cpp): `USB Test/src/history.cpp`

### App support

- [Language setup](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/lang.cpp): `USB Test/src/lang.cpp`
- [Feedback](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/feedback.cpp): `USB Test/src/feedback.cpp`
- [Update check](https://github.com/n-romanovich/usb-test/blob/main/USB%20Test/src/version.cpp): `USB Test/src/version.cpp`

### Other components

- **User**
- **Version server**

## Connections

- User → Application entry: launches (evidence: `README.md`)
- Application entry → Language setup: sets language (evidence: `USB Test/src/main.cpp`)
- Application entry → Menus: opens menu (evidence: `USB Test/src/main.cpp`)
- Application entry → Drive information: loads drives (evidence: `USB Test/src/main.cpp`)
- Menus → Sector tests: starts test
- Menus → Test history: opens history
- Menus → Test data: offers comparison
- Sector tests → Test data: records results
- Test data → JSON support: uses JSON
- Menus → Feedback: offers feedback
- Menus → Update check: checks updates
- Update check → Version server: checks version (evidence: `USB Test/src/version.cpp`)
