# icai-audit/audit-assistant-pro-electron architecture

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

- Interactive diagram: https://gitdiagram.com/icai-audit/audit-assistant-pro-electron
- Repository: https://github.com/icai-audit/audit-assistant-pro-electron

## Overview

ICAI VERA is an Electron desktop audit application. Users enter through the React app, manage engagements and trial balances, complete audit work and compliance, then prepare reports. The README documents the product areas; sampled code confirms React routing, SQLite-over-IPC access, and Financial Statement Generation (FSG) startup. Several feature implementations were not sampled, so their internal links are omitted rather than inferred.

Main entry points: [`src/App.tsx`](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/App.tsx) (React app and routes), [`electron/main.cjs`](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/electron/main.cjs) (Electron main process), [`src/integrations/sqlite/client.ts`](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/integrations/sqlite/client.ts) (SQLite IPC client), [`src/components/clients/ClientFormDialog.tsx`](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/components/clients/ClientFormDialog.tsx) (Client management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_renderer["React app and routes<br/>[App.tsx]"]
  node_electron["Electron main process<br/>[main.cjs]"]
  node_sqlite_api["SQLite IPC client<br/>[client.ts]"]
  node_local_db[("SQLite database")]
end

subgraph group_engagement["Engagement work"]
  node_client_management["Client management"]
  node_engagement_management["Engagements and teams<br/>[Engagements.tsx]"]
  node_trial_balance["Trial balance import<br/>[useTrialBalance.ts]"]
end

subgraph group_audit["Audit and reporting"]
  node_caro["CARO compliance<br/>[CARONavigator.tsx]"]
  node_risk["Risk assessment<br/>[RiskRegister.tsx]"]
  node_materiality["Materiality calculation<br/>[Materiality.tsx]"]
  node_workpapers["Procedure workpapers"]
  node_evidence["Evidence vault<br/>[EvidenceVault.tsx]"]
  node_review_notes["Review notes<br/>[ReviewNotes.tsx]"]
  node_notes_hook["Review note operations<br/>[useReviewNotes.ts]"]
  node_report["Audit report generator<br/>[AuditReport.tsx]"]
end

subgraph group_fsg["Financial statements"]
  node_fsg_ui["FSG workspace<br/>[App.jsx]"]
  node_fsg_financials["Financial statement logic<br/>[useFinancials.js]"]
  node_fsg_api["FSG data API<br/>[api.js]"]
  node_fsg_main["FSG IPC initialization<br/>[index.js]"]
  node_fsg_mapping["Trial balance mapping<br/>[mapping-engine.js]"]
  node_fsg_store[("FSG SQLite access<br/>[client.js]")]
end

node_accountant(("Accountant"))

node_accountant -->|"uses"| node_renderer
node_renderer -->|"routes to"| node_client_management
node_renderer -->|"routes to"| node_engagement_management
node_renderer -->|"routes to"| node_report
node_client_management -->|"reads and writes"| node_sqlite_api
node_sqlite_api -->|"queries by IPC"| node_electron
node_electron -->|"queries"| node_local_db
node_accountant -->|"imports balances"| node_trial_balance
node_accountant -->|"completes clauses"| node_caro
node_accountant -->|"assesses risks"| node_risk
node_accountant -->|"calculates materiality"| node_materiality
node_accountant -->|"documents procedures"| node_workpapers
node_accountant -->|"manages evidence"| node_evidence
node_review_notes -->|"uses"| node_notes_hook
node_notes_hook -->|"reads and writes"| node_sqlite_api
node_accountant -->|"generates reports"| node_report
node_electron -->|"initializes"| node_fsg_main
node_fsg_ui -->|"requests data"| node_fsg_api
node_fsg_financials -->|"requests data"| node_fsg_api
node_fsg_main -.->|"registers handlers"| node_fsg_mapping
node_fsg_mapping -->|"queries and persists"| node_fsg_store

click node_renderer "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/App.tsx"
click node_electron "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/electron/main.cjs"
click node_sqlite_api "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/integrations/sqlite/client.ts"
click node_local_db "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/sqlite/database-manager.ts"
click node_client_management "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/components/clients/ClientFormDialog.tsx"
click node_engagement_management "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/Engagements.tsx"
click node_trial_balance "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/hooks/useTrialBalance.ts"
click node_caro "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/components/audit-report/CARONavigator.tsx"
click node_risk "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/RiskRegister.tsx"
click node_materiality "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/Materiality.tsx"
click node_workpapers "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/ProcedureWorkpaper.tsx"
click node_evidence "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/EvidenceVault.tsx"
click node_review_notes "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/ReviewNotes.tsx"
click node_notes_hook "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/hooks/useReviewNotes.ts"
click node_report "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/AuditReport.tsx"
click node_fsg_ui "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/modules/fsg/App.jsx"
click node_fsg_financials "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/modules/fsg/hooks/useFinancials.js"
click node_fsg_api "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/modules/fsg/api.js"
click node_fsg_main "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/electron/fsg/index.js"
click node_fsg_mapping "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/electron/fsg/services/mapping-engine.js"
click node_fsg_store "https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/electron/fsg/db/client.js"

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_renderer,node_electron,node_sqlite_api,node_local_db toneBlue
class node_client_management,node_engagement_management,node_trial_balance toneAmber
class node_caro,node_risk,node_materiality,node_workpapers,node_evidence,node_review_notes,node_notes_hook,node_report toneMint
class node_fsg_ui,node_fsg_financials,node_fsg_api,node_fsg_main,node_fsg_mapping,node_fsg_store toneRose
class node_accountant toneIndigo
```

## Components

### Desktop app

- [React app and routes](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/App.tsx): `src/App.tsx`
- [Electron main process](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/electron/main.cjs): `electron/main.cjs`
- [SQLite IPC client](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/integrations/sqlite/client.ts): `src/integrations/sqlite/client.ts`
- [SQLite database](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/sqlite/database-manager.ts): `sqlite/database-manager.ts`

### Engagement work

- [Client management](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/components/clients/ClientFormDialog.tsx): `src/components/clients/ClientFormDialog.tsx`
- [Engagements and teams](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/Engagements.tsx): `src/pages/Engagements.tsx`
- [Trial balance import](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/hooks/useTrialBalance.ts): `src/hooks/useTrialBalance.ts`

### Audit and reporting

- [CARO compliance](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/components/audit-report/CARONavigator.tsx): `src/components/audit-report/CARONavigator.tsx`
- [Risk assessment](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/RiskRegister.tsx): `src/pages/RiskRegister.tsx`
- [Materiality calculation](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/Materiality.tsx): `src/pages/Materiality.tsx`
- [Procedure workpapers](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/ProcedureWorkpaper.tsx): `src/pages/ProcedureWorkpaper.tsx`
- [Evidence vault](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/EvidenceVault.tsx): `src/pages/EvidenceVault.tsx`
- [Review notes](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/ReviewNotes.tsx): `src/pages/ReviewNotes.tsx`
- [Review note operations](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/hooks/useReviewNotes.ts): `src/hooks/useReviewNotes.ts`
- [Audit report generator](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/pages/AuditReport.tsx): `src/pages/AuditReport.tsx`

### Financial statements

- [FSG workspace](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/modules/fsg/App.jsx): `src/modules/fsg/App.jsx`
- [Financial statement logic](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/modules/fsg/hooks/useFinancials.js): `src/modules/fsg/hooks/useFinancials.js`
- [FSG data API](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/src/modules/fsg/api.js): `src/modules/fsg/api.js`
- [FSG IPC initialization](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/electron/fsg/index.js): `electron/fsg/index.js`
- [Trial balance mapping](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/electron/fsg/services/mapping-engine.js): `electron/fsg/services/mapping-engine.js`
- [FSG SQLite access](https://github.com/icai-audit/audit-assistant-pro-electron/blob/main/electron/fsg/db/client.js): `electron/fsg/db/client.js`

### Other components

- **Accountant**

## Connections

- Accountant → React app and routes: uses (evidence: `README.md`)
- React app and routes → Client management: routes to (evidence: `src/App.tsx`)
- React app and routes → Engagements and teams: routes to (evidence: `src/App.tsx`)
- React app and routes → Audit report generator: routes to (evidence: `src/App.tsx`)
- Client management → SQLite IPC client: reads and writes (evidence: `src/components/clients/ClientFormDialog.tsx`)
- SQLite IPC client → Electron main process: queries by IPC (evidence: `src/integrations/sqlite/client.ts`)
- Electron main process → SQLite database: queries (evidence: `electron/main.cjs`)
- Accountant → Trial balance import: imports balances (evidence: `README.md`)
- Accountant → CARO compliance: completes clauses (evidence: `README.md`)
- Accountant → Risk assessment: assesses risks (evidence: `README.md`)
- Accountant → Materiality calculation: calculates materiality (evidence: `README.md`)
- Accountant → Procedure workpapers: documents procedures (evidence: `README.md`)
- Accountant → Evidence vault: manages evidence (evidence: `README.md`)
- Review notes → Review note operations: uses (evidence: `src/pages/ReviewNotes.tsx`)
- Review note operations → SQLite IPC client: reads and writes (evidence: `src/hooks/useReviewNotes.ts`)
- Accountant → Audit report generator: generates reports (evidence: `README.md`)
- Electron main process → FSG IPC initialization: initializes (evidence: `electron/main.cjs`)
- FSG workspace → FSG data API: requests data
- Financial statement logic → FSG data API: requests data (evidence: `src/modules/fsg/hooks/useFinancials.js`)
- FSG IPC initialization → Trial balance mapping: registers handlers
- Trial balance mapping → FSG SQLite access: queries and persists (evidence: `electron/fsg/services/mapping-engine.js`)
