# psabarish484-debug/certichain-ai architecture

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

- Interactive diagram: https://gitdiagram.com/psabarish484-debug/certichain-ai
- Repository: https://github.com/psabarish484-debug/certichain-ai

## Overview

CertiChain AI is a certificate issuance, verification, and fraud-analysis web application. Its main workflow lets an institution prepare a certificate, compute its fingerprint, anchor it in the app’s ledger, and present an exportable credential; a verifier recomputes the fingerprint and compares it with the ledger. Separate portals provide visual-forensics reports, ledger exploration, and interactive demos. The README describes Algorand anchoring, while the sampled blockchain module shows a browser-side ledger simulator using stored certificate, block, and transaction data—not a demonstrated live Algorand connection. The Python API is documented but its role and integration are unclear from the available evidence.

Main entry points: [`src/lib/types.ts`](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/lib/types.ts) (Domain Data Models), [`src/app/issuer/page.tsx`](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/issuer/page.tsx) (Issuance Portal), [`src/app/verify/page.tsx`](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/verify/page.tsx) (Verification Portal), [`src/lib/blockchain.ts`](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/lib/blockchain.ts) (Local Ledger Simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["Product Portals"]
  node_issuer["Issuance Portal<br/>[page.tsx]"]
  node_verify["Verification Portal<br/>[page.tsx]"]
  node_forensics["Forensics Portal<br/>[page.tsx]"]
  node_explorer["Ledger Explorer<br/>[page.tsx]"]
  node_demo["Viva Demo Lab<br/>[page.tsx]"]
  node_home["Home Overview<br/>[page.tsx]"]
end

subgraph group_services["Domain Services"]
  node_canonical["Certificate Fingerprinting<br/>[certificate.ts]"]
  node_ledger[("Local Ledger Simulator<br/>[blockchain.ts]")]
  node_forensics_engine["Forensics Analysis<br/>[ai-engine.ts]"]
  node_models["Domain Data Models<br/>[types.ts]"]
end

subgraph group_views["Result Views"]
  node_credential["Certificate Card &amp; PDF"]
  node_verification_result["Verification Result"]
  node_forensics_report["Forensics Report"]
end

subgraph group_shell["Application Shell"]
  node_canvas["Blockchain Canvas"]
  node_navbar["Navigation Bar<br/>[Navbar.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_layout["Root Layout<br/>[layout.tsx]"]
end

node_institution(("Certificate Issuer"))
node_verifier(("Certificate Verifier"))

node_institution -->|"issues through"| node_issuer
node_verifier -->|"checks through"| node_verify
node_issuer -->|"computes fingerprint"| node_canonical
node_issuer -->|"registers certificate"| node_ledger
node_issuer -->|"renders credential"| node_credential
node_verify -->|"computes fingerprint"| node_canonical
node_verify -->|"checks ledger"| node_ledger
node_verify -->|"shows verdict"| node_verification_result
node_explorer -->|"reads blocks and transactions"| node_ledger
node_forensics -->|"runs analysis"| node_forensics_engine
node_forensics -->|"renders report"| node_forensics_report
node_canonical -->|"uses certificate model"| node_models
node_ledger -->|"uses ledger models"| node_models
node_forensics_engine -->|"uses report models"| node_models
node_credential -->|"renders certificate data"| node_models
node_verification_result -->|"renders result data"| node_models
node_forensics_report -->|"renders report data"| node_models
node_layout -->|"renders"| node_canvas
node_layout -->|"renders"| node_navbar
node_layout -->|"renders"| node_footer

click node_issuer "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/issuer/page.tsx"
click node_verify "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/verify/page.tsx"
click node_forensics "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/ai-forensics/page.tsx"
click node_explorer "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/explorer/page.tsx"
click node_demo "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/demo/page.tsx"
click node_home "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/page.tsx"
click node_canonical "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/lib/certificate.ts"
click node_ledger "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/lib/blockchain.ts"
click node_forensics_engine "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/lib/ai-engine.ts"
click node_models "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/lib/types.ts"
click node_credential "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/CertificateCard.tsx"
click node_verification_result "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/VerificationResultModal.tsx"
click node_forensics_report "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/AIForensicsReport.tsx"
click node_canvas "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/BlockchainCanvas.tsx"
click node_navbar "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/Navbar.tsx"
click node_footer "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/Footer.tsx"
click node_layout "https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/layout.tsx"

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_issuer,node_verify,node_forensics,node_explorer,node_demo,node_home toneBlue
class node_canonical,node_ledger,node_forensics_engine,node_models toneAmber
class node_credential,node_verification_result,node_forensics_report toneMint
class node_canvas,node_navbar,node_footer,node_layout toneRose
class node_institution,node_verifier toneIndigo
```

## Components

### Product Portals

- [Issuance Portal](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/issuer/page.tsx): `src/app/issuer/page.tsx`
- [Verification Portal](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/verify/page.tsx): `src/app/verify/page.tsx`
- [Forensics Portal](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/ai-forensics/page.tsx): `src/app/ai-forensics/page.tsx`
- [Ledger Explorer](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/explorer/page.tsx): `src/app/explorer/page.tsx`
- [Viva Demo Lab](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/demo/page.tsx): `src/app/demo/page.tsx`
- [Home Overview](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/page.tsx): `src/app/page.tsx`

### Domain Services

- [Certificate Fingerprinting](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/lib/certificate.ts): `src/lib/certificate.ts`
- [Local Ledger Simulator](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/lib/blockchain.ts): `src/lib/blockchain.ts`
- [Forensics Analysis](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/lib/ai-engine.ts): `src/lib/ai-engine.ts`
- [Domain Data Models](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/lib/types.ts): `src/lib/types.ts`

### Result Views

- [Certificate Card & PDF](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/CertificateCard.tsx): `src/components/CertificateCard.tsx`
- [Verification Result](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/VerificationResultModal.tsx): `src/components/VerificationResultModal.tsx`
- [Forensics Report](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/AIForensicsReport.tsx): `src/components/AIForensicsReport.tsx`

### Application Shell

- [Blockchain Canvas](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/BlockchainCanvas.tsx): `src/components/BlockchainCanvas.tsx`
- [Navigation Bar](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Footer](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`
- [Root Layout](https://github.com/psabarish484-debug/certichain-ai/blob/main/src/app/layout.tsx): `src/app/layout.tsx`

### Other components

- **Certificate Issuer**
- **Certificate Verifier**

## Connections

- Certificate Issuer → Issuance Portal: issues through (evidence: `README.md`)
- Certificate Verifier → Verification Portal: checks through (evidence: `README.md`)
- Issuance Portal → Certificate Fingerprinting: computes fingerprint (evidence: `src/app/issuer/page.tsx`)
- Issuance Portal → Local Ledger Simulator: registers certificate (evidence: `src/app/issuer/page.tsx`)
- Issuance Portal → Certificate Card & PDF: renders credential (evidence: `src/app/issuer/page.tsx`)
- Verification Portal → Certificate Fingerprinting: computes fingerprint (evidence: `src/app/verify/page.tsx`)
- Verification Portal → Local Ledger Simulator: checks ledger (evidence: `src/app/verify/page.tsx`)
- Verification Portal → Verification Result: shows verdict (evidence: `src/app/verify/page.tsx`)
- Ledger Explorer → Local Ledger Simulator: reads blocks and transactions (evidence: `src/app/explorer/page.tsx`)
- Forensics Portal → Forensics Analysis: runs analysis (evidence: `src/app/ai-forensics/page.tsx`)
- Forensics Portal → Forensics Report: renders report (evidence: `src/app/ai-forensics/page.tsx`)
- Certificate Fingerprinting → Domain Data Models: uses certificate model (evidence: `src/lib/certificate.ts`)
- Local Ledger Simulator → Domain Data Models: uses ledger models (evidence: `src/lib/blockchain.ts`)
- Forensics Analysis → Domain Data Models: uses report models (evidence: `src/lib/ai-engine.ts`)
- Certificate Card & PDF → Domain Data Models: renders certificate data (evidence: `src/components/CertificateCard.tsx`)
- Verification Result → Domain Data Models: renders result data (evidence: `src/components/VerificationResultModal.tsx`)
- Forensics Report → Domain Data Models: renders report data (evidence: `src/components/AIForensicsReport.tsx`)
- Root Layout → Blockchain Canvas: renders (evidence: `src/app/layout.tsx`)
- Root Layout → Navigation Bar: renders (evidence: `src/app/layout.tsx`)
- Root Layout → Footer: renders (evidence: `src/app/layout.tsx`)
