# sourik-work/certi_chain architecture

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

- Interactive diagram: https://gitdiagram.com/sourik-work/certi_chain
- Repository: https://github.com/sourik-work/certi_chain

## Overview

CertiChain Ledger lets institutions create and issue credentials, stores metadata and rendered assets on IPFS, anchors deterministic SHA-256 proof hashes in an EVM registry, and supports recipient and public verification. The graph follows the documented issuer, custom-template, storage, on-chain, and verification branches. Some feature links come from README claims because their implementation files were not sampled; those edges are cited to the README rather than inferred from module names.

Main entry points: [`frontend/src/pages/IssuerDashboard.tsx`](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/pages/IssuerDashboard.tsx) (Issuer dashboard), [`frontend/src/pages/VerifyCertificate.tsx`](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/pages/VerifyCertificate.tsx) (Verification portal), [`frontend/src/App.tsx`](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/App.tsx) (React application), [`frontend/src/components/template/TemplateStudio.tsx`](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/components/template/TemplateStudio.tsx) (Template studio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Credential application"]
  node_spa["React application<br/>[App.tsx]"]
  node_issuer_dashboard["Issuer dashboard"]
  node_recipient_dashboard["Recipient dashboard"]
  node_wallet["Wallet context<br/>[WalletContext.tsx]"]
end

subgraph group_studio["Template studio"]
  node_studio_ui["Template studio<br/>[TemplateStudio.tsx]"]
  node_template_state["Template state"]
  node_template_analysis["Template analysis"]
  node_ocr["OCR extraction<br/>[ocrService.ts]"]
  node_ai_analysis_api["AI analysis API<br/>[analyzeTemplate.ts]"]
  node_layout_api["AI layout API<br/>[planLayout.ts]"]
end

subgraph group_integrity["Proof and storage"]
  node_certificate_render["Certificate rendering"]
  node_proof_hash["Proof hashing<br/>[hash.ts]"]
  node_metadata["Credential metadata"]
  node_pinata["IPFS pinning<br/>[pinata.ts]"]
  node_pin_api["Pinata proxy<br/>[pinJson.ts]"]
  node_ipfs[("IPFS network")]
end

subgraph group_chain["EVM registry"]
  node_registry_hook["Registry access"]
  node_registry_contract["Certificate registry"]
end

subgraph group_verification["Credential access"]
  node_verify_page["Verification portal"]
  node_certificate_preview["Certificate preview"]
  node_custom_preview["Custom certificate preview"]
end

node_issuer(("Institutional issuer"))
node_recipient(("Credential recipient"))
node_verifier(("Public verifier"))

node_issuer -->|"uses"| node_spa
node_recipient -->|"uses"| node_spa
node_verifier -->|"opens portal"| node_verify_page
node_spa -->|"routes to"| node_issuer_dashboard
node_spa -->|"routes to"| node_recipient_dashboard
node_spa -->|"routes to"| node_verify_page
node_spa -->|"provides context"| node_wallet
node_issuer_dashboard -->|"reads wallet"| node_wallet
node_issuer_dashboard -->|"issues credentials"| node_registry_hook
node_issuer_dashboard -->|"computes proof"| node_proof_hash
node_issuer_dashboard -->|"pins metadata"| node_pinata
node_issuer_dashboard -->|"renders artifact"| node_certificate_render
node_issuer_dashboard -->|"resolves metadata"| node_metadata
node_issuer_dashboard -->|"hosts studio"| node_studio_ui
node_studio_ui -.->|"edits template"| node_template_state
node_template_state -->|"post-processes fields"| node_template_analysis
node_ocr -->|"snaps boxes"| node_template_analysis
node_studio_ui -.->|"requests analysis"| node_ai_analysis_api
node_studio_ui -.->|"requests layout"| node_layout_api
node_studio_ui -.->|"extracts text"| node_ocr
node_certificate_render -.->|"renders for pinning"| node_ipfs
node_pinata -.->|"uses proxy"| node_pin_api
node_pin_api -->|"pins metadata"| node_ipfs
node_pinata -->|"pins assets"| node_ipfs
node_registry_hook -->|"reads signer"| node_wallet
node_registry_hook -->|"calls registry"| node_registry_contract
node_registry_hook -.->|"resolves stored metadata"| node_ipfs
node_verify_page -.->|"checks proof"| node_registry_hook
node_verify_page -.->|"validates integrity"| node_proof_hash
node_verify_page -->|"reads payload"| node_ipfs
node_verify_page -.->|"shows certificate"| node_certificate_preview
node_verify_page -->|"shows rendered asset"| node_custom_preview
node_custom_preview -->|"resolves custom data"| node_metadata

click node_spa "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/App.tsx"
click node_issuer_dashboard "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/pages/IssuerDashboard.tsx"
click node_recipient_dashboard "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/pages/RecipientDashboard.tsx"
click node_wallet "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/context/WalletContext.tsx"
click node_studio_ui "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/components/template/TemplateStudio.tsx"
click node_template_state "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/hooks/useCustomTemplate.ts"
click node_template_analysis "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/templateAnalysis.ts"
click node_ocr "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/ocrService.ts"
click node_ai_analysis_api "https://github.com/sourik-work/certi_chain/blob/main/frontend/api/analyzeTemplate.ts"
click node_layout_api "https://github.com/sourik-work/certi_chain/blob/main/frontend/api/planLayout.ts"
click node_certificate_render "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/renderCertificate.ts"
click node_proof_hash "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/hash.ts"
click node_metadata "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/customMetadataHelper.ts"
click node_pinata "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/pinata.ts"
click node_pin_api "https://github.com/sourik-work/certi_chain/blob/main/frontend/api/pinJson.ts"
click node_registry_hook "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/hooks/useCertificateRegistry.ts"
click node_registry_contract "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/contracts/src/CertificateRegistry.ts"
click node_verify_page "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/pages/VerifyCertificate.tsx"
click node_certificate_preview "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/components/CertificatePreview.tsx"
click node_custom_preview "https://github.com/sourik-work/certi_chain/blob/main/frontend/src/components/CustomCertificatePreview.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_spa,node_issuer_dashboard,node_recipient_dashboard,node_wallet toneBlue
class node_studio_ui,node_template_state,node_template_analysis,node_ocr,node_ai_analysis_api,node_layout_api toneAmber
class node_certificate_render,node_proof_hash,node_metadata,node_pinata,node_pin_api,node_ipfs toneMint
class node_registry_hook,node_registry_contract toneRose
class node_verify_page,node_certificate_preview,node_custom_preview,node_issuer,node_recipient,node_verifier toneIndigo
```

## Components

### Credential application

- [React application](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Issuer dashboard](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/pages/IssuerDashboard.tsx): `frontend/src/pages/IssuerDashboard.tsx`
- [Recipient dashboard](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/pages/RecipientDashboard.tsx): `frontend/src/pages/RecipientDashboard.tsx`
- [Wallet context](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/context/WalletContext.tsx): `frontend/src/context/WalletContext.tsx`

### Template studio

- [Template studio](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/components/template/TemplateStudio.tsx): `frontend/src/components/template/TemplateStudio.tsx`
- [Template state](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/hooks/useCustomTemplate.ts): `frontend/src/hooks/useCustomTemplate.ts`
- [Template analysis](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/templateAnalysis.ts): `frontend/src/lib/templateAnalysis.ts`
- [OCR extraction](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/ocrService.ts): `frontend/src/lib/ocrService.ts`
- [AI analysis API](https://github.com/sourik-work/certi_chain/blob/main/frontend/api/analyzeTemplate.ts): `frontend/api/analyzeTemplate.ts`
- [AI layout API](https://github.com/sourik-work/certi_chain/blob/main/frontend/api/planLayout.ts): `frontend/api/planLayout.ts`

### Proof and storage

- [Certificate rendering](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/renderCertificate.ts): `frontend/src/lib/renderCertificate.ts`
- [Proof hashing](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/hash.ts): `frontend/src/lib/hash.ts`
- [Credential metadata](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/customMetadataHelper.ts): `frontend/src/lib/customMetadataHelper.ts`
- [IPFS pinning](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/lib/pinata.ts): `frontend/src/lib/pinata.ts`
- [Pinata proxy](https://github.com/sourik-work/certi_chain/blob/main/frontend/api/pinJson.ts): `frontend/api/pinJson.ts`
- **IPFS network**

### EVM registry

- [Registry access](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/hooks/useCertificateRegistry.ts): `frontend/src/hooks/useCertificateRegistry.ts`
- [Certificate registry](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/contracts/src/CertificateRegistry.ts): `frontend/src/contracts/src/CertificateRegistry.ts`

### Credential access

- [Verification portal](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/pages/VerifyCertificate.tsx): `frontend/src/pages/VerifyCertificate.tsx`
- [Certificate preview](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/components/CertificatePreview.tsx): `frontend/src/components/CertificatePreview.tsx`
- [Custom certificate preview](https://github.com/sourik-work/certi_chain/blob/main/frontend/src/components/CustomCertificatePreview.tsx): `frontend/src/components/CustomCertificatePreview.tsx`

### Other components

- **Institutional issuer**
- **Credential recipient**
- **Public verifier**

## Connections

- Institutional issuer → React application: uses (evidence: `README.md`)
- Credential recipient → React application: uses (evidence: `README.md`)
- Public verifier → Verification portal: opens portal (evidence: `README.md`)
- React application → Issuer dashboard: routes to (evidence: `frontend/src/App.tsx`)
- React application → Recipient dashboard: routes to (evidence: `frontend/src/App.tsx`)
- React application → Verification portal: routes to (evidence: `frontend/src/App.tsx`)
- React application → Wallet context: provides context (evidence: `frontend/src/App.tsx`)
- Issuer dashboard → Wallet context: reads wallet (evidence: `frontend/src/pages/IssuerDashboard.tsx`)
- Issuer dashboard → Registry access: issues credentials (evidence: `frontend/src/pages/IssuerDashboard.tsx`)
- Issuer dashboard → Proof hashing: computes proof (evidence: `frontend/src/pages/IssuerDashboard.tsx`)
- Issuer dashboard → IPFS pinning: pins metadata (evidence: `frontend/src/pages/IssuerDashboard.tsx`)
- Issuer dashboard → Certificate rendering: renders artifact (evidence: `frontend/src/pages/IssuerDashboard.tsx`)
- Issuer dashboard → Credential metadata: resolves metadata (evidence: `frontend/src/pages/IssuerDashboard.tsx`)
- Issuer dashboard → Template studio: hosts studio (evidence: `README.md`)
- Template studio → Template state: edits template
- Template state → Template analysis: post-processes fields (evidence: `frontend/src/hooks/useCustomTemplate.ts`)
- OCR extraction → Template analysis: snaps boxes (evidence: `frontend/src/lib/ocrService.ts`)
- Template studio → AI analysis API: requests analysis
- Template studio → AI layout API: requests layout
- Template studio → OCR extraction: extracts text
- Certificate rendering → IPFS network: renders for pinning
- IPFS pinning → Pinata proxy: uses proxy (evidence: `README.md`)
- Pinata proxy → IPFS network: pins metadata (evidence: `README.md`)
- IPFS pinning → IPFS network: pins assets (evidence: `README.md`)
- Registry access → Wallet context: reads signer (evidence: `frontend/src/hooks/useCertificateRegistry.ts`)
- Registry access → Certificate registry: calls registry (evidence: `README.md`)
- Registry access → IPFS network: resolves stored metadata
- Verification portal → Registry access: checks proof (evidence: `README.md`)
- Verification portal → Proof hashing: validates integrity (evidence: `README.md`)
- Verification portal → IPFS network: reads payload (evidence: `README.md`)
- Verification portal → Certificate preview: shows certificate
- Verification portal → Custom certificate preview: shows rendered asset (evidence: `README.md`)
- Custom certificate preview → Credential metadata: resolves custom data (evidence: `frontend/src/components/CustomCertificatePreview.tsx`)
