# 12hrformat/dragonrepo architecture

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

- Interactive diagram: https://gitdiagram.com/12hrformat/dragonrepo
- Repository: https://github.com/12hrformat/dragonrepo

## Overview

DRAGON is an engagement activity tracker and security-assessment report generator. An operator starts a project, enables a shell hook, runs assessment commands, and uses the CLI to inspect activity or generate reports. Tracking parses and categorizes commands, redacts sensitive data, and persists engagement records; report generation imports evidence, reconstructs a timeline, and renders HTML, Markdown, and JSON. The README also documents dashboard/statistics and optional PDF export. Unsampled CLI sections are represented only where README capabilities support them.

Main entry points: [`dragonrepo/modules/reporter.py`](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/reporter.py) (Report Builder), [`dragonrepo/modules/tracker.py`](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/tracker.py) (Session Tracker), [`dragonrepo/cli.py`](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/cli.py) (CLI Commands), [`dragonrepo/modules/evidence.py`](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/evidence.py) (Evidence Import)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["CLI Workflow"]
  node_shell["Shell Hook<br/>[cli.py]"]
  node_cli["CLI Commands<br/>[cli.py]"]
  node_dashboard["Dashboard &amp; Stats<br/>[cli.py]"]
end

subgraph group_capture["Activity Capture"]
  node_parser["Command Parser<br/>[parser.py]"]
  node_tracker["Session Tracker<br/>[tracker.py]"]
  node_redactor["Secret Redaction<br/>[redactor.py]"]
end

subgraph group_reporting["Report Generation"]
  node_evidence["Evidence Import<br/>[evidence.py]"]
  node_timeline["Timeline Builder<br/>[timeline.py]"]
  node_reporter["Report Builder<br/>[reporter.py]"]
  node_html_template["HTML Template<br/>[report.html.j2]"]
  node_markdown_template["Markdown Template<br/>[report.md.j2]"]
end

subgraph group_storage["Engagement Storage"]
  node_project_store[("Project Data")]
end

node_operator(("Operator"))
node_pdf_engine["PDF Engine"]

node_operator -->|"runs commands"| node_cli
node_operator -->|"enables hook"| node_shell
node_shell -->|"records commands"| node_tracker
node_cli -->|"manages sessions"| node_tracker
node_cli -->|"lists tools"| node_parser
node_cli -->|"requests reports"| node_reporter
node_cli -->|"shows activity"| node_dashboard
node_parser -->|"parses commands"| node_tracker
node_tracker -->|"redacts stored text"| node_redactor
node_tracker -->|"reads and writes"| node_project_store
node_reporter -->|"collects evidence"| node_evidence
node_evidence -->|"redacts excerpts"| node_redactor
node_evidence -->|"stores evidence"| node_tracker
node_reporter -->|"loads engagement data"| node_tracker
node_reporter -->|"redacts report data"| node_redactor
node_reporter -->|"builds timeline"| node_timeline
node_reporter -->|"renders HTML"| node_html_template
node_reporter -->|"renders Markdown"| node_markdown_template
node_cli -.->|"exports PDF"| node_pdf_engine

click node_shell "https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/cli.py"
click node_cli "https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/cli.py"
click node_dashboard "https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/cli.py"
click node_parser "https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/parser.py"
click node_tracker "https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/tracker.py"
click node_redactor "https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/redactor.py"
click node_evidence "https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/evidence.py"
click node_timeline "https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/timeline.py"
click node_reporter "https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/reporter.py"
click node_html_template "https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/templates/report.html.j2"
click node_markdown_template "https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/templates/report.md.j2"

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_shell,node_cli,node_dashboard toneBlue
class node_parser,node_tracker,node_redactor toneAmber
class node_evidence,node_timeline,node_reporter,node_html_template,node_markdown_template toneMint
class node_project_store toneRose
class node_operator,node_pdf_engine toneIndigo
```

## Components

### CLI Workflow

- [Shell Hook](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/cli.py): `dragonrepo/cli.py`
- [CLI Commands](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/cli.py): `dragonrepo/cli.py`
- [Dashboard & Stats](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/cli.py): `dragonrepo/cli.py`

### Activity Capture

- [Command Parser](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/parser.py): `dragonrepo/modules/parser.py`
- [Session Tracker](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/tracker.py): `dragonrepo/modules/tracker.py`
- [Secret Redaction](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/redactor.py): `dragonrepo/modules/redactor.py`

### Report Generation

- [Evidence Import](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/evidence.py): `dragonrepo/modules/evidence.py`
- [Timeline Builder](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/timeline.py): `dragonrepo/modules/timeline.py`
- [Report Builder](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/modules/reporter.py): `dragonrepo/modules/reporter.py`
- [HTML Template](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/templates/report.html.j2): `dragonrepo/templates/report.html.j2`
- [Markdown Template](https://github.com/12hrformat/dragonrepo/blob/main/dragonrepo/templates/report.md.j2): `dragonrepo/templates/report.md.j2`

### Engagement Storage

- **Project Data**

### Other components

- **Operator**
- **PDF Engine**

## Connections

- Operator → CLI Commands: runs commands (evidence: `README.md`)
- Operator → Shell Hook: enables hook (evidence: `README.md`)
- Shell Hook → Session Tracker: records commands (evidence: `README.md`)
- CLI Commands → Session Tracker: manages sessions (evidence: `dragonrepo/cli.py`)
- CLI Commands → Command Parser: lists tools (evidence: `dragonrepo/cli.py`)
- CLI Commands → Report Builder: requests reports (evidence: `dragonrepo/cli.py`)
- CLI Commands → Dashboard & Stats: shows activity (evidence: `README.md`)
- Command Parser → Session Tracker: parses commands (evidence: `dragonrepo/modules/tracker.py`)
- Session Tracker → Secret Redaction: redacts stored text (evidence: `dragonrepo/modules/tracker.py`)
- Session Tracker → Project Data: reads and writes (evidence: `dragonrepo/modules/tracker.py`)
- Report Builder → Evidence Import: collects evidence (evidence: `dragonrepo/modules/reporter.py`)
- Evidence Import → Secret Redaction: redacts excerpts (evidence: `dragonrepo/modules/evidence.py`)
- Evidence Import → Session Tracker: stores evidence (evidence: `dragonrepo/modules/evidence.py`)
- Report Builder → Session Tracker: loads engagement data (evidence: `dragonrepo/modules/reporter.py`)
- Report Builder → Secret Redaction: redacts report data (evidence: `dragonrepo/modules/reporter.py`)
- Report Builder → Timeline Builder: builds timeline (evidence: `dragonrepo/modules/reporter.py`)
- Report Builder → HTML Template: renders HTML (evidence: `dragonrepo/modules/reporter.py`)
- Report Builder → Markdown Template: renders Markdown (evidence: `dragonrepo/modules/reporter.py`)
- CLI Commands → PDF Engine: exports PDF (evidence: `README.md`)
