# amna-zahid14/all-clear architecture

> Architecture diagram of the GitHub repository amna-zahid14/all-clear, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amna-zahid14/all-clear
- Repository: https://github.com/amna-zahid14/all-clear

## Overview

AllClear is a C++17 file-safety scanner. A user starts a scan through the CLI or Windows Explorer integration; the application processes a file through local and optional reputation checks, classifies accumulated risk, records history, and quarantines malicious files. The graph preserves the README’s major detection, persistence, UI, and integration capabilities. Relationships are cited to the README or shown in the sampled composition-root declarations and source index; unsampled implementation details are not inferred.

Main entry points: [`src/core/FileController.cpp`](https://github.com/amna-zahid14/all-clear/blob/main/src/core/FileController.cpp) (Scan controller), [`src/main.cpp`](https://github.com/amna-zahid14/all-clear/blob/main/src/main.cpp) (CLI entry), [`src/scanners/ConcreteScanners.cpp`](https://github.com/amna-zahid14/all-clear/blob/main/src/scanners/ConcreteScanners.cpp) (Heuristic scanners), [`src/persistence/ScanHistory.cpp`](https://github.com/amna-zahid14/all-clear/blob/main/src/persistence/ScanHistory.cpp) (Scan history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and presentation"]
  node_main["CLI entry<br/>[main.cpp]"]
  node_ui["Terminal dashboard<br/>[ui.cpp]"]
  node_console["Console view<br/>[ConsoleView.cpp]"]
  node_report["Signature reports<br/>[ReportPrinter.cpp]"]
end

subgraph group_detection["Detection and scoring"]
  node_controller["Scan controller<br/>[FileController.cpp]"]
  node_fileentity["File model<br/>[FileEntity.cpp]"]
  node_scannerbase["Scanner interface<br/>[Scanner.cpp]"]
  node_scanners["Heuristic scanners"]
  node_checksum["SHA-256 checksum<br/>[Checksum.cpp]"]
  node_rules["User policy rules"]
  node_risk["Risk classification<br/>[RiskScore.cpp]"]
end

subgraph group_persistence["Persistence and response"]
  node_signatures[("Signature database")]
  node_history[("Scan history<br/>[ScanHistory.cpp]")]
  node_quarantine[("Quarantine vault")]
end

subgraph group_integrations["Platform integrations"]
  node_context["Explorer installer"]
end

node_user(("User"))
node_explorer(("Windows Explorer"))
node_virustotal["VirusTotal API"]

node_user -->|"starts scan"| node_main
node_main -->|"shows dashboard"| node_ui
node_main -->|"requests scan"| node_controller
node_explorer -->|"launches scan"| node_main
node_main -->|"registers shortcut"| node_context
node_controller -->|"models file"| node_fileentity
node_controller -->|"dispatches scanners"| node_scannerbase
node_scanners -->|"implements"| node_scannerbase
node_controller -->|"runs checks"| node_scanners
node_scanners -->|"computes hash"| node_checksum
node_scanners -->|"matches signatures"| node_signatures
node_scanners -->|"checks prior scans"| node_history
node_scanners -->|"evaluates policy"| node_rules
node_controller -->|"folds scores"| node_risk
node_risk -->|"returns verdict"| node_controller
node_controller -->|"records scan"| node_history
node_controller -->|"isolates malicious"| node_quarantine
node_controller -->|"returns verdict"| node_console
node_main -->|"prints signatures"| node_report
node_scanners -.->|"looks up hash"| node_virustotal
node_main -->|"manages records"| node_signatures
node_main -->|"manages records"| node_history

click node_main "https://github.com/amna-zahid14/all-clear/blob/main/src/main.cpp"
click node_ui "https://github.com/amna-zahid14/all-clear/blob/main/src/presentation/ui.cpp"
click node_console "https://github.com/amna-zahid14/all-clear/blob/main/src/presentation/ConsoleView.cpp"
click node_report "https://github.com/amna-zahid14/all-clear/blob/main/src/presentation/ReportPrinter.cpp"
click node_controller "https://github.com/amna-zahid14/all-clear/blob/main/src/core/FileController.cpp"
click node_fileentity "https://github.com/amna-zahid14/all-clear/blob/main/src/core/FileEntity.cpp"
click node_scannerbase "https://github.com/amna-zahid14/all-clear/blob/main/src/scanners/Scanner.cpp"
click node_scanners "https://github.com/amna-zahid14/all-clear/blob/main/src/scanners/ConcreteScanners.cpp"
click node_checksum "https://github.com/amna-zahid14/all-clear/blob/main/src/core/Checksum.cpp"
click node_rules "https://github.com/amna-zahid14/all-clear/blob/main/src/scanners/ConcreteScanners.cpp"
click node_risk "https://github.com/amna-zahid14/all-clear/blob/main/src/core/RiskScore.cpp"
click node_signatures "https://github.com/amna-zahid14/all-clear/blob/main/src/persistence/SignatureDatabase.cpp"
click node_history "https://github.com/amna-zahid14/all-clear/blob/main/src/persistence/ScanHistory.cpp"
click node_quarantine "https://github.com/amna-zahid14/all-clear/blob/main/src/persistence/QuarantineManager.cpp"
click node_context "https://github.com/amna-zahid14/all-clear/blob/main/src/platform/ContextMenuInstaller.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_main,node_ui,node_console,node_report,node_user toneBlue
class node_controller,node_fileentity,node_scannerbase,node_scanners,node_checksum,node_rules,node_risk toneAmber
class node_signatures,node_history,node_quarantine,node_virustotal toneMint
class node_context toneRose
class node_explorer toneIndigo
```

## Components

### Entry and presentation

- [CLI entry](https://github.com/amna-zahid14/all-clear/blob/main/src/main.cpp): `src/main.cpp`
- [Terminal dashboard](https://github.com/amna-zahid14/all-clear/blob/main/src/presentation/ui.cpp): `src/presentation/ui.cpp`
- [Console view](https://github.com/amna-zahid14/all-clear/blob/main/src/presentation/ConsoleView.cpp): `src/presentation/ConsoleView.cpp`
- [Signature reports](https://github.com/amna-zahid14/all-clear/blob/main/src/presentation/ReportPrinter.cpp): `src/presentation/ReportPrinter.cpp`

### Detection and scoring

- [Scan controller](https://github.com/amna-zahid14/all-clear/blob/main/src/core/FileController.cpp): `src/core/FileController.cpp`
- [File model](https://github.com/amna-zahid14/all-clear/blob/main/src/core/FileEntity.cpp): `src/core/FileEntity.cpp`
- [Scanner interface](https://github.com/amna-zahid14/all-clear/blob/main/src/scanners/Scanner.cpp): `src/scanners/Scanner.cpp`
- [Heuristic scanners](https://github.com/amna-zahid14/all-clear/blob/main/src/scanners/ConcreteScanners.cpp): `src/scanners/ConcreteScanners.cpp`
- [SHA-256 checksum](https://github.com/amna-zahid14/all-clear/blob/main/src/core/Checksum.cpp): `src/core/Checksum.cpp`
- [User policy rules](https://github.com/amna-zahid14/all-clear/blob/main/src/scanners/ConcreteScanners.cpp): `src/scanners/ConcreteScanners.cpp`
- [Risk classification](https://github.com/amna-zahid14/all-clear/blob/main/src/core/RiskScore.cpp): `src/core/RiskScore.cpp`

### Persistence and response

- [Signature database](https://github.com/amna-zahid14/all-clear/blob/main/src/persistence/SignatureDatabase.cpp): `src/persistence/SignatureDatabase.cpp`
- [Scan history](https://github.com/amna-zahid14/all-clear/blob/main/src/persistence/ScanHistory.cpp): `src/persistence/ScanHistory.cpp`
- [Quarantine vault](https://github.com/amna-zahid14/all-clear/blob/main/src/persistence/QuarantineManager.cpp): `src/persistence/QuarantineManager.cpp`

### Platform integrations

- [Explorer installer](https://github.com/amna-zahid14/all-clear/blob/main/src/platform/ContextMenuInstaller.cpp): `src/platform/ContextMenuInstaller.cpp`

### Other components

- **User**
- **Windows Explorer**
- **VirusTotal API**

## Connections

- User → CLI entry: starts scan (evidence: `README.md`)
- CLI entry → Terminal dashboard: shows dashboard (evidence: `README.md`)
- CLI entry → Scan controller: requests scan (evidence: `src/main.cpp`)
- Windows Explorer → CLI entry: launches scan (evidence: `README.md`)
- CLI entry → Explorer installer: registers shortcut (evidence: `README.md`)
- Scan controller → File model: models file (evidence: `src/core/FileController.cpp`)
- Scan controller → Scanner interface: dispatches scanners
- Heuristic scanners → Scanner interface: implements
- Scan controller → Heuristic scanners: runs checks (evidence: `src/core/FileController.cpp`)
- Heuristic scanners → SHA-256 checksum: computes hash (evidence: `src/scanners/ConcreteScanners.cpp`)
- Heuristic scanners → Signature database: matches signatures
- Heuristic scanners → Scan history: checks prior scans
- Heuristic scanners → User policy rules: evaluates policy (evidence: `README.md`)
- Scan controller → Risk classification: folds scores
- Risk classification → Scan controller: returns verdict
- Scan controller → Scan history: records scan (evidence: `README.md`)
- Scan controller → Quarantine vault: isolates malicious
- Scan controller → Console view: returns verdict
- CLI entry → Signature reports: prints signatures (evidence: `src/main.cpp`)
- Heuristic scanners → VirusTotal API: looks up hash (evidence: `README.md`)
- CLI entry → Signature database: manages records (evidence: `src/main.cpp`)
- CLI entry → Scan history: manages records (evidence: `src/main.cpp`)
