# carlosdanyell/auditanalyzer architecture

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

- Interactive diagram: https://gitdiagram.com/carlosdanyell/auditanalyzer
- Repository: https://github.com/carlosdanyell/auditanalyzer

## Overview

AuditAnalyzer is a browser-only accounting audit platform. Users choose a tool, upload Protheus XLSX extractions, review reconciliation and analysis results, and export an Excel workpaper. The UI delegates processing to a Web Worker, which streams and validates files before tool-specific analysis; the worker returns aggregates and row pages to the UI. The README documents both CFGR700 and CT2 integrity capabilities. Some subsystem links below reflect README-level workflow descriptions because their implementation files were not sampled.

Main entry points: [`src/worker/handler.ts`](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/handler.ts) (Worker dispatcher), [`src/app/App.tsx`](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/App.tsx) (Application shell), [`src/worker/ingest/pipeline.ts`](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/ingest/pipeline.ts) (Streaming XLSX ingest), [`src/app/workerClient.ts`](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/workerClient.ts) (Worker client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_app["Application shell<br/>[App.tsx]"]
  node_module_registry["Tool registry<br/>[registry.ts]"]
  node_config["Tool configuration<br/>[schema.ts]"]
  node_platform_config["Platform settings<br/>[platform.ts]"]
  node_worker_client["Worker client<br/>[workerClient.ts]"]
  node_persistence[("Local preferences<br/>[db.ts]")]
end

subgraph group_ingestion["Ingestion and storage"]
  node_worker["Worker dispatcher<br/>[handler.ts]"]
  node_probe["File probe<br/>[probe.ts]"]
  node_xlsx_ingest["Streaming XLSX ingest<br/>[pipeline.ts]"]
  node_column_store[("Columnar store<br/>[columns.ts]")]
end

subgraph group_analysis["Audit analysis"]
  node_cfgr_engine["CFGR700 analysis<br/>[analysis.ts]"]
  node_cfgr_checks["Audit checks<br/>[checks.ts]"]
  node_ct2_ingest["CT2 extraction<br/>[ingest.ts]"]
  node_ct2_analysis["CT2 integrity tests<br/>[analysis.ts]"]
  node_ct2_profile["CT2 profile<br/>[profile.ts]"]
end

subgraph group_results["Review and export"]
  node_reconciliation_ui["Reconciliation views"]
  node_panel_ui["Analysis panels<br/>[PanelView.tsx]"]
  node_tables_ui["Tables and justifications<br/>[TablesView.tsx]"]
  node_export_ui["Export view<br/>[ExportView.tsx]"]
  node_workpaper["Excel workpaper<br/>[paperwork.ts]"]
  node_download["Download handling<br/>[download.ts]"]
end

node_auditor(("Auditor"))

node_auditor -->|"chooses tool"| node_app
node_app -->|"selects module"| node_module_registry
node_app -->|"configures analysis"| node_config
node_app -->|"sets holidays"| node_platform_config
node_app -->|"sends commands"| node_worker_client
node_worker_client -->|"posts messages"| node_worker
node_app -->|"saves preferences"| node_persistence
node_worker -->|"probes files"| node_probe
node_worker -->|"dispatches ingest"| node_xlsx_ingest
node_xlsx_ingest -->|"streams rows"| node_column_store
node_xlsx_ingest -->|"analyzes report"| node_cfgr_engine
node_xlsx_ingest -->|"reads CT2"| node_ct2_ingest
node_cfgr_engine -->|"runs checks"| node_cfgr_checks
node_ct2_ingest -->|"runs integrity tests"| node_ct2_analysis
node_ct2_analysis -->|"builds profile"| node_ct2_profile
node_worker -->|"returns reconciliation"| node_reconciliation_ui
node_worker -->|"returns aggregates"| node_panel_ui
node_worker -->|"returns row pages"| node_tables_ui
node_export_ui -->|"requests export"| node_worker_client
node_worker -->|"generates workbook"| node_workpaper
node_workpaper -->|"returns workbook"| node_download
node_auditor -->|"reviews results"| node_reconciliation_ui
node_auditor -->|"requests workbook"| node_export_ui

click node_app "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/App.tsx"
click node_module_registry "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/modules/registry.ts"
click node_config "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/config/schema.ts"
click node_platform_config "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/config/platform.ts"
click node_worker_client "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/workerClient.ts"
click node_reconciliation_ui "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/components/ReconciliationView.tsx"
click node_panel_ui "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/views/PanelView.tsx"
click node_tables_ui "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/views/TablesView.tsx"
click node_export_ui "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/views/ExportView.tsx"
click node_persistence "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/db.ts"
click node_worker "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/handler.ts"
click node_probe "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/ingest/probe.ts"
click node_xlsx_ingest "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/ingest/pipeline.ts"
click node_column_store "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/store/columns.ts"
click node_cfgr_engine "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/engine/analysis.ts"
click node_cfgr_checks "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/engine/checks.ts"
click node_ct2_ingest "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/modules/ct2Integrity/ingest.ts"
click node_ct2_analysis "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/modules/ct2Integrity/analysis.ts"
click node_ct2_profile "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/modules/ct2Integrity/profile.ts"
click node_workpaper "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/export/paperwork.ts"
click node_download "https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/download.ts"

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_module_registry,node_config,node_platform_config,node_worker_client,node_persistence toneBlue
class node_worker,node_probe,node_xlsx_ingest,node_column_store toneAmber
class node_cfgr_engine,node_cfgr_checks,node_ct2_ingest,node_ct2_analysis,node_ct2_profile toneMint
class node_reconciliation_ui,node_panel_ui,node_tables_ui,node_export_ui,node_workpaper,node_download toneRose
class node_auditor toneIndigo
```

## Components

### User experience

- [Application shell](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Tool registry](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/modules/registry.ts): `src/modules/registry.ts`
- [Tool configuration](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/config/schema.ts): `src/config/schema.ts`
- [Platform settings](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/config/platform.ts): `src/config/platform.ts`
- [Worker client](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/workerClient.ts): `src/app/workerClient.ts`
- [Local preferences](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/db.ts): `src/app/db.ts`

### Ingestion and storage

- [Worker dispatcher](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/handler.ts): `src/worker/handler.ts`
- [File probe](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/ingest/probe.ts): `src/worker/ingest/probe.ts`
- [Streaming XLSX ingest](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/ingest/pipeline.ts): `src/worker/ingest/pipeline.ts`
- [Columnar store](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/store/columns.ts): `src/worker/store/columns.ts`

### Audit analysis

- [CFGR700 analysis](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/engine/analysis.ts): `src/worker/engine/analysis.ts`
- [Audit checks](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/engine/checks.ts): `src/worker/engine/checks.ts`
- [CT2 extraction](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/modules/ct2Integrity/ingest.ts): `src/worker/modules/ct2Integrity/ingest.ts`
- [CT2 integrity tests](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/modules/ct2Integrity/analysis.ts): `src/worker/modules/ct2Integrity/analysis.ts`
- [CT2 profile](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/modules/ct2Integrity/profile.ts): `src/worker/modules/ct2Integrity/profile.ts`

### Review and export

- [Reconciliation views](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/components/ReconciliationView.tsx): `src/components/ReconciliationView.tsx`
- [Analysis panels](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/views/PanelView.tsx): `src/app/views/PanelView.tsx`
- [Tables and justifications](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/views/TablesView.tsx): `src/app/views/TablesView.tsx`
- [Export view](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/views/ExportView.tsx): `src/app/views/ExportView.tsx`
- [Excel workpaper](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/worker/export/paperwork.ts): `src/worker/export/paperwork.ts`
- [Download handling](https://github.com/carlosdanyell/auditanalyzer/blob/main/src/app/download.ts): `src/app/download.ts`

### Other components

- **Auditor**

## Connections

- Auditor → Application shell: chooses tool (evidence: `README.md`)
- Application shell → Tool registry: selects module (evidence: `src/app/App.tsx`)
- Application shell → Tool configuration: configures analysis (evidence: `src/app/App.tsx`)
- Application shell → Platform settings: sets holidays (evidence: `src/app/App.tsx`)
- Application shell → Worker client: sends commands (evidence: `src/app/App.tsx`)
- Worker client → Worker dispatcher: posts messages (evidence: `src/app/workerClient.ts`)
- Application shell → Local preferences: saves preferences (evidence: `src/app/App.tsx`)
- Worker dispatcher → File probe: probes files (evidence: `src/worker/handler.ts`)
- Worker dispatcher → Streaming XLSX ingest: dispatches ingest (evidence: `src/worker/handler.ts`)
- Streaming XLSX ingest → Columnar store: streams rows (evidence: `src/worker/ingest/pipeline.ts`)
- Streaming XLSX ingest → CFGR700 analysis: analyzes report (evidence: `README.md`)
- Streaming XLSX ingest → CT2 extraction: reads CT2 (evidence: `README.md`)
- CFGR700 analysis → Audit checks: runs checks (evidence: `README.md`)
- CT2 extraction → CT2 integrity tests: runs integrity tests (evidence: `README.md`)
- CT2 integrity tests → CT2 profile: builds profile (evidence: `README.md`)
- Worker dispatcher → Reconciliation views: returns reconciliation (evidence: `README.md`)
- Worker dispatcher → Analysis panels: returns aggregates (evidence: `README.md`)
- Worker dispatcher → Tables and justifications: returns row pages (evidence: `README.md`)
- Export view → Worker client: requests export (evidence: `README.md`)
- Worker dispatcher → Excel workpaper: generates workbook (evidence: `README.md`)
- Excel workpaper → Download handling: returns workbook (evidence: `README.md`)
- Auditor → Reconciliation views: reviews results (evidence: `README.md`)
- Auditor → Export view: requests workbook (evidence: `README.md`)
