# dhaksh-m/credora architecture

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

- Interactive diagram: https://gitdiagram.com/dhaksh-m/credora
- Repository: https://github.com/dhaksh-m/credora

## Overview

Credora is an offline-first Electron desktop platform for creating, issuing, managing, and verifying certificates. The principal workflow is to design a template, import and validate recipient data, generate certificates, then optionally enqueue campaign email; users can also browse, revoke, export, and locally verify certificates. The Electron main process initializes storage and the database, while IPC exposes backend operations to the React app. Edges reflect shown calls and documented behavior; some renderer-to-IPC wiring and unsampled subsystem details are not visible, so those relationships are omitted.

Main entry points: [`electron/ipc/index.ts`](https://github.com/dhaksh-m/credora/blob/main/electron/ipc/index.ts) (IPC handlers), [`packages/certificate-engine/src/index.ts`](https://github.com/dhaksh-m/credora/blob/main/packages/certificate-engine/src/index.ts) (Certificate issue and export), [`electron/services/storage/index.ts`](https://github.com/dhaksh-m/credora/blob/main/electron/services/storage/index.ts) (User file workspace), [`electron/main.ts`](https://github.com/dhaksh-m/credora/blob/main/electron/main.ts) (Electron main)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["React application<br/>[App.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_editor["Template editor<br/>[Editor.tsx]"]
  node_campaigns_ui["Campaigns view<br/>[Campaigns.tsx]"]
  node_certificates_ui["Certificates view<br/>[Certificates.tsx]"]
  node_verify_ui["Verification view<br/>[Verify.tsx]"]
  node_settings_ui["Settings view<br/>[Settings.tsx]"]
end

subgraph group_runtime["Electron runtime"]
  node_main["Electron main<br/>[main.ts]"]
  node_ipc["IPC handlers<br/>[index.ts]"]
  node_jobs["Job recovery<br/>[jobs.ts]"]
end

subgraph group_issuance["Certificate lifecycle"]
  node_campaigns["Campaign orchestration<br/>[campaigns.ts]"]
  node_certificate_engine["Certificate issue and export<br/>[index.ts]"]
  node_verification["Local verification<br/>[index.ts]"]
  node_email["Email delivery<br/>[index.ts]"]
end

subgraph group_data["Local data and files"]
  node_database[("SQLite database<br/>[index.ts]")]
  node_schema["Data schema<br/>[schema.ts]"]
  node_templates["Template persistence<br/>[templates.ts]"]
  node_settings["Settings persistence<br/>[settings.ts]"]
  node_storage["User file workspace<br/>[index.ts]"]
end

subgraph group_engines["Processing engines"]
  node_excel["Spreadsheet import<br/>[index.ts]"]
  node_validation["Recipient validation<br/>[index.ts]"]
  node_shared["Shared certificate types<br/>[index.ts]"]
end

node_user(("Desktop user"))
node_smtp{{"SMTP service"}}

node_user -->|"uses"| node_app
node_main -->|"loads interface"| node_app
node_main -->|"initializes"| node_storage
node_main -->|"initializes"| node_database
node_main -->|"recovers jobs"| node_jobs
node_main -->|"registers handlers"| node_ipc
node_ipc -->|"dispatches campaign"| node_campaigns
node_ipc -->|"dispatches certificates"| node_certificate_engine
node_ipc -->|"dispatches verification"| node_verification
node_ipc -->|"dispatches email"| node_email
node_ipc -->|"dispatches file tasks"| node_storage
node_ipc -->|"dispatches templates"| node_templates
node_ipc -->|"dispatches settings"| node_settings
node_campaigns -->|"records campaign"| node_database
node_campaigns -->|"generates certificates"| node_certificate_engine
node_campaigns -->|"queues delivery"| node_email
node_certificate_engine -->|"reads and writes"| node_database
node_certificate_engine -->|"writes outputs"| node_storage
node_certificate_engine -->|"uses helpers"| node_shared
node_email -->|"reads and records"| node_database
node_email -->|"sends mail"| node_smtp
node_database -->|"initializes from"| node_schema
node_storage -->|"parses spreadsheet"| node_excel
node_storage -->|"validates recipients"| node_validation
node_storage -->|"creates archive"| node_certificate_engine
node_excel -->|"uses types"| node_shared
node_validation -->|"uses types"| node_shared

click node_app "https://github.com/dhaksh-m/credora/blob/main/src/app/App.tsx"
click node_dashboard "https://github.com/dhaksh-m/credora/blob/main/src/pages/dashboard/Dashboard.tsx"
click node_editor "https://github.com/dhaksh-m/credora/blob/main/src/pages/create/Editor.tsx"
click node_campaigns_ui "https://github.com/dhaksh-m/credora/blob/main/src/pages/campaigns/Campaigns.tsx"
click node_certificates_ui "https://github.com/dhaksh-m/credora/blob/main/src/pages/certificates/Certificates.tsx"
click node_verify_ui "https://github.com/dhaksh-m/credora/blob/main/src/pages/verification/Verify.tsx"
click node_settings_ui "https://github.com/dhaksh-m/credora/blob/main/src/pages/settings/Settings.tsx"
click node_main "https://github.com/dhaksh-m/credora/blob/main/electron/main.ts"
click node_ipc "https://github.com/dhaksh-m/credora/blob/main/electron/ipc/index.ts"
click node_jobs "https://github.com/dhaksh-m/credora/blob/main/electron/services/jobs.ts"
click node_campaigns "https://github.com/dhaksh-m/credora/blob/main/electron/services/campaigns.ts"
click node_certificate_engine "https://github.com/dhaksh-m/credora/blob/main/packages/certificate-engine/src/index.ts"
click node_verification "https://github.com/dhaksh-m/credora/blob/main/electron/services/verification/index.ts"
click node_email "https://github.com/dhaksh-m/credora/blob/main/packages/email-engine/src/index.ts"
click node_database "https://github.com/dhaksh-m/credora/blob/main/electron/services/database/index.ts"
click node_schema "https://github.com/dhaksh-m/credora/blob/main/database/schema/schema.ts"
click node_templates "https://github.com/dhaksh-m/credora/blob/main/electron/services/database/templates.ts"
click node_settings "https://github.com/dhaksh-m/credora/blob/main/electron/services/database/settings.ts"
click node_storage "https://github.com/dhaksh-m/credora/blob/main/electron/services/storage/index.ts"
click node_excel "https://github.com/dhaksh-m/credora/blob/main/packages/excel-engine/src/index.ts"
click node_validation "https://github.com/dhaksh-m/credora/blob/main/packages/validation/src/index.ts"
click node_shared "https://github.com/dhaksh-m/credora/blob/main/packages/shared-types/src/index.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_dashboard,node_editor,node_campaigns_ui,node_certificates_ui,node_verify_ui,node_settings_ui,node_user toneBlue
class node_main,node_ipc,node_jobs toneAmber
class node_campaigns,node_certificate_engine,node_verification,node_email toneMint
class node_database,node_schema,node_templates,node_settings,node_storage toneRose
class node_excel,node_validation,node_shared,node_smtp toneIndigo
```

## Components

### Desktop interface

- [React application](https://github.com/dhaksh-m/credora/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Dashboard](https://github.com/dhaksh-m/credora/blob/main/src/pages/dashboard/Dashboard.tsx): `src/pages/dashboard/Dashboard.tsx`
- [Template editor](https://github.com/dhaksh-m/credora/blob/main/src/pages/create/Editor.tsx): `src/pages/create/Editor.tsx`
- [Campaigns view](https://github.com/dhaksh-m/credora/blob/main/src/pages/campaigns/Campaigns.tsx): `src/pages/campaigns/Campaigns.tsx`
- [Certificates view](https://github.com/dhaksh-m/credora/blob/main/src/pages/certificates/Certificates.tsx): `src/pages/certificates/Certificates.tsx`
- [Verification view](https://github.com/dhaksh-m/credora/blob/main/src/pages/verification/Verify.tsx): `src/pages/verification/Verify.tsx`
- [Settings view](https://github.com/dhaksh-m/credora/blob/main/src/pages/settings/Settings.tsx): `src/pages/settings/Settings.tsx`

### Electron runtime

- [Electron main](https://github.com/dhaksh-m/credora/blob/main/electron/main.ts): `electron/main.ts`
- [IPC handlers](https://github.com/dhaksh-m/credora/blob/main/electron/ipc/index.ts): `electron/ipc/index.ts`
- [Job recovery](https://github.com/dhaksh-m/credora/blob/main/electron/services/jobs.ts): `electron/services/jobs.ts`

### Certificate lifecycle

- [Campaign orchestration](https://github.com/dhaksh-m/credora/blob/main/electron/services/campaigns.ts): `electron/services/campaigns.ts`
- [Certificate issue and export](https://github.com/dhaksh-m/credora/blob/main/packages/certificate-engine/src/index.ts): `packages/certificate-engine/src/index.ts`
- [Local verification](https://github.com/dhaksh-m/credora/blob/main/electron/services/verification/index.ts): `electron/services/verification/index.ts`
- [Email delivery](https://github.com/dhaksh-m/credora/blob/main/packages/email-engine/src/index.ts): `packages/email-engine/src/index.ts`

### Local data and files

- [SQLite database](https://github.com/dhaksh-m/credora/blob/main/electron/services/database/index.ts): `electron/services/database/index.ts`
- [Data schema](https://github.com/dhaksh-m/credora/blob/main/database/schema/schema.ts): `database/schema/schema.ts`
- [Template persistence](https://github.com/dhaksh-m/credora/blob/main/electron/services/database/templates.ts): `electron/services/database/templates.ts`
- [Settings persistence](https://github.com/dhaksh-m/credora/blob/main/electron/services/database/settings.ts): `electron/services/database/settings.ts`
- [User file workspace](https://github.com/dhaksh-m/credora/blob/main/electron/services/storage/index.ts): `electron/services/storage/index.ts`

### Processing engines

- [Spreadsheet import](https://github.com/dhaksh-m/credora/blob/main/packages/excel-engine/src/index.ts): `packages/excel-engine/src/index.ts`
- [Recipient validation](https://github.com/dhaksh-m/credora/blob/main/packages/validation/src/index.ts): `packages/validation/src/index.ts`
- [Shared certificate types](https://github.com/dhaksh-m/credora/blob/main/packages/shared-types/src/index.ts): `packages/shared-types/src/index.ts`

### Other components

- **Desktop user**
- **SMTP service**

## Connections

- Desktop user → React application: uses (evidence: `README.md`)
- Electron main → React application: loads interface (evidence: `electron/main.ts`)
- Electron main → User file workspace: initializes (evidence: `electron/main.ts`)
- Electron main → SQLite database: initializes (evidence: `electron/main.ts`)
- Electron main → Job recovery: recovers jobs (evidence: `electron/main.ts`)
- Electron main → IPC handlers: registers handlers (evidence: `electron/main.ts`)
- IPC handlers → Campaign orchestration: dispatches campaign (evidence: `electron/ipc/index.ts`)
- IPC handlers → Certificate issue and export: dispatches certificates (evidence: `electron/ipc/index.ts`)
- IPC handlers → Local verification: dispatches verification (evidence: `electron/ipc/index.ts`)
- IPC handlers → Email delivery: dispatches email (evidence: `electron/ipc/index.ts`)
- IPC handlers → User file workspace: dispatches file tasks (evidence: `electron/ipc/index.ts`)
- IPC handlers → Template persistence: dispatches templates (evidence: `electron/ipc/index.ts`)
- IPC handlers → Settings persistence: dispatches settings (evidence: `electron/ipc/index.ts`)
- Campaign orchestration → SQLite database: records campaign (evidence: `electron/services/campaigns.ts`)
- Campaign orchestration → Certificate issue and export: generates certificates (evidence: `electron/services/campaigns.ts`)
- Campaign orchestration → Email delivery: queues delivery (evidence: `electron/services/campaigns.ts`)
- Certificate issue and export → SQLite database: reads and writes (evidence: `packages/certificate-engine/src/index.ts`)
- Certificate issue and export → User file workspace: writes outputs (evidence: `packages/certificate-engine/src/index.ts`)
- Certificate issue and export → Shared certificate types: uses helpers (evidence: `packages/certificate-engine/src/index.ts`)
- Email delivery → SQLite database: reads and records (evidence: `packages/email-engine/src/index.ts`)
- Email delivery → SMTP service: sends mail (evidence: `packages/email-engine/src/index.ts`)
- SQLite database → Data schema: initializes from (evidence: `electron/services/database/index.ts`)
- User file workspace → Spreadsheet import: parses spreadsheet (evidence: `electron/services/storage/index.ts`)
- User file workspace → Recipient validation: validates recipients (evidence: `electron/services/storage/index.ts`)
- User file workspace → Certificate issue and export: creates archive (evidence: `electron/services/storage/index.ts`)
- Spreadsheet import → Shared certificate types: uses types (evidence: `packages/excel-engine/src/index.ts`)
- Recipient validation → Shared certificate types: uses types (evidence: `packages/validation/src/index.ts`)
