# ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights architecture

> Architecture diagram of the GitHub repository ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights
- Repository: https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights

## Overview

VeriCert is a cross-chain academic credential issuance and verification prototype. University staff issue or revoke credentials; employers submit a credential file, details, or hash and receive a rule-based verdict, checks, history, and optionally an AI explanation. The Streamlit frontend calls the Express API, which coordinates credential processing, database records, verification, and either a mock or CCIP chain implementation. The README documents the Solidity relay path. Some backend and frontend modules are indexed but not excerpted, so uncertain internal calls are omitted.

Main entry points: [`backend/server.js`](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/server.js) (Express API), [`frontend/app.py`](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/frontend/app.py) (Streamlit app), [`backend/ai/evidence.js`](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/ai/evidence.js) (Verification evidence), [`backend/chain/index.js`](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/chain/index.js) (Chain mode selector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_app["Streamlit app<br/>[app.py]"]
  node_issue_view["Issue and revoke<br/>[issue.py]"]
  node_verify_view["Credential verification<br/>[verify.py]"]
  node_activity_view["Activity log<br/>[activity.py]"]
  node_api_client["Backend API client<br/>[api.py]"]
end

subgraph group_backend["API and verification"]
  node_server["Express API<br/>[server.js]"]
  node_credential["Credential hashing<br/>[credential.js]"]
  node_verification["Chain and record verification<br/>[verification.js]"]
  node_database[("Credential and event store<br/>[db.js]")]
end

subgraph group_ai["Evidence and explanations"]
  node_evidence["Verification evidence<br/>[evidence.js]"]
  node_checks["Verdict and checks<br/>[checks.js]"]
  node_prompt["AI prompt construction<br/>[prompt.js]"]
  node_explainer["AI explanation service<br/>[explainer.js]"]
end

subgraph group_chain["Chain integrations"]
  node_chain_selector["Chain mode selector<br/>[index.js]"]
  node_mock_chain["Mock chain<br/>[mock.js]"]
  node_ccip_chain["CCIP chain adapter<br/>[ccip.js]"]
end

subgraph group_contracts["On-chain records"]
  node_vericert_contract["VeriCert issuer contract<br/>[VeriCert.sol]"]
  node_receiver_contract["Fuji receiver contract<br/>[Receiver.sol]"]
end

node_registrar(("University staff"))
node_employer(("Employer"))
node_openai["OpenAI API"]
node_ccip["Chainlink CCIP"]
node_fuji[("Avalanche Fuji")]

node_registrar -->|"uses"| node_app
node_employer -->|"uses"| node_app
node_app -->|"routes to"| node_issue_view
node_app -->|"routes to"| node_verify_view
node_app -->|"routes to"| node_activity_view
node_issue_view -->|"requests issuance"| node_api_client
node_verify_view -->|"requests verification"| node_api_client
node_api_client -->|"sends REST requests"| node_server
node_server -->|"parses and hashes"| node_credential
node_server -->|"requests verification"| node_verification
node_server -->|"records credentials"| node_database
node_server -->|"issues and revokes"| node_chain_selector
node_server -->|"runs explanations"| node_evidence
node_verification -->|"reads chain record"| node_chain_selector
node_verification -->|"reads and updates records"| node_database
node_chain_selector -->|"selects mock mode"| node_mock_chain
node_chain_selector -->|"selects CCIP mode"| node_ccip_chain
node_evidence -->|"gathers chain evidence"| node_chain_selector
node_evidence -->|"gathers records"| node_database
node_evidence -->|"checks credential"| node_verification
node_checks -->|"uses credential fields"| node_credential
node_prompt -->|"formats evidence"| node_evidence
node_explainer -->|"requests explanation"| node_openai
node_explainer -->|"caches explanations"| node_database
node_server -->|"issues and revokes"| node_vericert_contract
node_vericert_contract -->|"sends hash messages"| node_ccip
node_ccip -->|"delivers messages"| node_receiver_contract
node_receiver_contract -->|"records credentials"| node_fuji
node_ccip_chain -->|"calls contract"| node_vericert_contract
node_ccip_chain -->|"reads verification record"| node_receiver_contract

click node_app "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/frontend/app.py"
click node_issue_view "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/frontend/views/issue.py"
click node_verify_view "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/frontend/views/verify.py"
click node_activity_view "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/frontend/views/activity.py"
click node_api_client "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/frontend/api.py"
click node_server "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/server.js"
click node_credential "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/credential.js"
click node_verification "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/verification.js"
click node_database "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/db.js"
click node_chain_selector "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/chain/index.js"
click node_mock_chain "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/chain/mock.js"
click node_ccip_chain "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/chain/ccip.js"
click node_evidence "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/ai/evidence.js"
click node_checks "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/ai/checks.js"
click node_prompt "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/ai/prompt.js"
click node_explainer "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/ai/explainer.js"
click node_vericert_contract "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/contracts/contracts/VeriCert.sol"
click node_receiver_contract "https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/contracts/contracts/Receiver.sol"

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_issue_view,node_verify_view,node_activity_view,node_api_client toneBlue
class node_server,node_credential,node_verification,node_database,node_fuji toneAmber
class node_evidence,node_checks,node_prompt,node_explainer,node_openai toneMint
class node_chain_selector,node_mock_chain,node_ccip_chain toneRose
class node_vericert_contract,node_receiver_contract,node_registrar,node_employer,node_ccip toneIndigo
```

## Components

### User interface

- [Streamlit app](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/frontend/app.py): `frontend/app.py`
- [Issue and revoke](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/frontend/views/issue.py): `frontend/views/issue.py`
- [Credential verification](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/frontend/views/verify.py): `frontend/views/verify.py`
- [Activity log](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/frontend/views/activity.py): `frontend/views/activity.py`
- [Backend API client](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/frontend/api.py): `frontend/api.py`

### API and verification

- [Express API](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/server.js): `backend/server.js`
- [Credential hashing](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/credential.js): `backend/credential.js`
- [Chain and record verification](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/verification.js): `backend/verification.js`
- [Credential and event store](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/db.js): `backend/db.js`

### Evidence and explanations

- [Verification evidence](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/ai/evidence.js): `backend/ai/evidence.js`
- [Verdict and checks](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/ai/checks.js): `backend/ai/checks.js`
- [AI prompt construction](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/ai/prompt.js): `backend/ai/prompt.js`
- [AI explanation service](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/ai/explainer.js): `backend/ai/explainer.js`

### Chain integrations

- [Chain mode selector](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/chain/index.js): `backend/chain/index.js`
- [Mock chain](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/chain/mock.js): `backend/chain/mock.js`
- [CCIP chain adapter](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/backend/chain/ccip.js): `backend/chain/ccip.js`

### On-chain records

- [VeriCert issuer contract](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/contracts/contracts/VeriCert.sol): `contracts/contracts/VeriCert.sol`
- [Fuji receiver contract](https://github.com/ashutoshsati/vericert---blockchain-enabled-cross-chain-academic-credential-verification-with-ai-insights/blob/main/contracts/contracts/Receiver.sol): `contracts/contracts/Receiver.sol`

### Other components

- **University staff**
- **Employer**
- **OpenAI API**
- **Chainlink CCIP**
- **Avalanche Fuji**

## Connections

- University staff → Streamlit app: uses (evidence: `frontend/app.py`)
- Employer → Streamlit app: uses (evidence: `frontend/app.py`)
- Streamlit app → Issue and revoke: routes to (evidence: `frontend/app.py`)
- Streamlit app → Credential verification: routes to (evidence: `frontend/app.py`)
- Streamlit app → Activity log: routes to (evidence: `frontend/app.py`)
- Issue and revoke → Backend API client: requests issuance (evidence: `frontend/views/issue.py`)
- Credential verification → Backend API client: requests verification (evidence: `frontend/views/verify.py`)
- Backend API client → Express API: sends REST requests (evidence: `frontend/api.py`)
- Express API → Credential hashing: parses and hashes (evidence: `backend/server.js`)
- Express API → Chain and record verification: requests verification (evidence: `backend/server.js`)
- Express API → Credential and event store: records credentials (evidence: `backend/server.js`)
- Express API → Chain mode selector: issues and revokes (evidence: `README.md`)
- Express API → Verification evidence: runs explanations (evidence: `backend/server.js`)
- Chain and record verification → Chain mode selector: reads chain record (evidence: `backend/verification.js`)
- Chain and record verification → Credential and event store: reads and updates records (evidence: `backend/verification.js`)
- Chain mode selector → Mock chain: selects mock mode (evidence: `README.md`)
- Chain mode selector → CCIP chain adapter: selects CCIP mode (evidence: `README.md`)
- Verification evidence → Chain mode selector: gathers chain evidence (evidence: `backend/ai/evidence.js`)
- Verification evidence → Credential and event store: gathers records (evidence: `backend/ai/evidence.js`)
- Verification evidence → Chain and record verification: checks credential (evidence: `backend/ai/evidence.js`)
- Verdict and checks → Credential hashing: uses credential fields (evidence: `backend/ai/checks.js`)
- AI prompt construction → Verification evidence: formats evidence (evidence: `backend/ai/prompt.js`)
- AI explanation service → OpenAI API: requests explanation (evidence: `backend/ai/explainer.js`)
- AI explanation service → Credential and event store: caches explanations (evidence: `backend/ai/explainer.js`)
- Express API → VeriCert issuer contract: issues and revokes (evidence: `README.md`)
- VeriCert issuer contract → Chainlink CCIP: sends hash messages (evidence: `README.md`)
- Chainlink CCIP → Fuji receiver contract: delivers messages (evidence: `README.md`)
- Fuji receiver contract → Avalanche Fuji: records credentials (evidence: `README.md`)
- CCIP chain adapter → VeriCert issuer contract: calls contract (evidence: `README.md`)
- CCIP chain adapter → Fuji receiver contract: reads verification record (evidence: `README.md`)
