# paulinotech1/dmarc-aggregate-reader architecture

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

- Interactive diagram: https://gitdiagram.com/paulinotech1/dmarc-aggregate-reader
- Repository: https://github.com/paulinotech1/dmarc-aggregate-reader

## Overview

DMARC Desk is a private desktop viewer for local aggregate reports. The user chooses a folder; the app discovers supported files, parses them off the UI thread, then presents report summaries and filterable records. Users can sort and inspect records or export filtered results. The parser handles plain XML, ZIP and Gzip inputs and validates XML safety. The graph follows relationships visible in the excerpts and README; some UI wiring and export details are not fully shown.

Main entry points: [`dmarc_parser.py`](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/dmarc_parser.py) (File discovery), [`app.py`](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py) (Search and table)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop app"]
  node_folder_ui["Folder selection<br/>[app.py]"]
  node_worker["Parse worker<br/>[app.py]"]
  node_result_queue["Result queue<br/>[app.py]"]
end

subgraph group_processing["Report processing"]
  node_discovery["File discovery<br/>[dmarc_parser.py]"]
  node_payloads["Archive reading<br/>[dmarc_parser.py]"]
  node_xml_parser["XML parsing<br/>[dmarc_parser.py]"]
  node_parse_result["Parsed records<br/>[dmarc_parser.py]"]
  node_record_model["DMARC record<br/>[dmarc_parser.py]"]
end

subgraph group_inspection["Report inspection"]
  node_summary["Summary cards<br/>[app.py]"]
  node_record_view["Search and table<br/>[app.py]"]
  node_record_detail["Record details<br/>[app.py]"]
  node_csv_export["Filtered CSV<br/>[app.py]"]
end

node_user(("User"))
node_local_reports["Local reports"]

node_user -->|"chooses folder"| node_folder_ui
node_local_reports -->|"scanned from folder"| node_discovery
node_folder_ui -->|"discovers files"| node_discovery
node_folder_ui -->|"starts worker"| node_worker
node_worker -->|"parses discovered files"| node_discovery
node_worker -->|"enqueues result"| node_result_queue
node_discovery -->|"reads supported formats"| node_payloads
node_payloads -->|"yields XML"| node_xml_parser
node_discovery -->|"parses payloads"| node_xml_parser
node_xml_parser -->|"creates records"| node_record_model
node_discovery -->|"collects rows and issues"| node_parse_result
node_result_queue -->|"provides parse result"| node_summary
node_result_queue -->|"provides parsed rows"| node_record_view
node_record_view -->|"opens selected record"| node_record_detail
node_record_view -->|"exports filtered rows"| node_csv_export
node_record_model -->|"supplies metrics"| node_summary
node_record_model -->|"supplies displayed fields"| node_record_view

click node_folder_ui "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py"
click node_worker "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py"
click node_result_queue "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py"
click node_discovery "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/dmarc_parser.py"
click node_payloads "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/dmarc_parser.py"
click node_xml_parser "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/dmarc_parser.py"
click node_parse_result "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/dmarc_parser.py"
click node_record_model "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/dmarc_parser.py"
click node_summary "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py"
click node_record_view "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py"
click node_record_detail "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py"
click node_csv_export "https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py"

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_folder_ui,node_worker,node_result_queue,node_user toneBlue
class node_discovery,node_payloads,node_xml_parser,node_parse_result,node_record_model toneAmber
class node_summary,node_record_view,node_record_detail,node_csv_export toneMint
class node_local_reports toneIndigo
```

## Components

### Desktop app

- [Folder selection](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py): `app.py`
- [Parse worker](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py): `app.py`
- [Result queue](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py): `app.py`

### Report processing

- [File discovery](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/dmarc_parser.py): `dmarc_parser.py`
- [Archive reading](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/dmarc_parser.py): `dmarc_parser.py`
- [XML parsing](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/dmarc_parser.py): `dmarc_parser.py`
- [Parsed records](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/dmarc_parser.py): `dmarc_parser.py`
- [DMARC record](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/dmarc_parser.py): `dmarc_parser.py`

### Report inspection

- [Summary cards](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py): `app.py`
- [Search and table](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py): `app.py`
- [Record details](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py): `app.py`
- [Filtered CSV](https://github.com/paulinotech1/dmarc-aggregate-reader/blob/main/app.py): `app.py`

### Other components

- **User**
- **Local reports**

## Connections

- User → Folder selection: chooses folder (evidence: `app.py`)
- Local reports → File discovery: scanned from folder (evidence: `dmarc_parser.py`)
- Folder selection → File discovery: discovers files (evidence: `app.py`)
- Folder selection → Parse worker: starts worker (evidence: `app.py`)
- Parse worker → File discovery: parses discovered files (evidence: `app.py`)
- Parse worker → Result queue: enqueues result (evidence: `app.py`)
- File discovery → Archive reading: reads supported formats (evidence: `dmarc_parser.py`)
- Archive reading → XML parsing: yields XML (evidence: `dmarc_parser.py`)
- File discovery → XML parsing: parses payloads (evidence: `dmarc_parser.py`)
- XML parsing → DMARC record: creates records (evidence: `dmarc_parser.py`)
- File discovery → Parsed records: collects rows and issues (evidence: `dmarc_parser.py`)
- Result queue → Summary cards: provides parse result (evidence: `app.py`)
- Result queue → Search and table: provides parsed rows (evidence: `app.py`)
- Search and table → Record details: opens selected record (evidence: `app.py`)
- Search and table → Filtered CSV: exports filtered rows (evidence: `README.md`)
- DMARC record → Summary cards: supplies metrics (evidence: `app.py`)
- DMARC record → Search and table: supplies displayed fields (evidence: `app.py`)
