# likinio365/zero-persistence-ekyc architecture

> Architecture diagram of the GitHub repository likinio365/zero-persistence-ekyc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/likinio365/zero-persistence-ekyc
- Repository: https://github.com/likinio365/zero-persistence-ekyc

## Overview

Zero-Persistence eKYC is a dual-ledger identity-verification product: applicants submit identity details and documents, verifiers review and decide KYC status, and verified applicants can receive credentials for wallet-based bank checks. The backend coordinates Fabric records, encrypted IPFS document storage, Vault key operations, and Indy/ACA-Py identity credentials; the bank flow uses DIDComm and proof requests without contacting the KYC backend for proof verification. Paths and links reflect the supplied tree, README capabilities, and sampled source; some route behavior is documented but not shown in full source excerpts.

Main entry points: [`backend/src/index.ts`](https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/index.ts) (Express API), [`backend/src/routes/kyc.routes.ts`](https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/routes/kyc.routes.ts) (KYC workflows), [`frontend/src/App.tsx`](https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/App.tsx) (KYC application), [`frontend/src/services/api.ts`](https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/services/api.ts) (KYC API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User applications"]
  node_kyc_app["KYC application<br/>[App.tsx]"]
  node_submit_ui["KYC submission<br/>[Submit.tsx]"]
  node_status_ui["Status view<br/>[Status.tsx]"]
  node_review_ui["Verifier panel<br/>[Verifier.tsx]"]
  node_kyc_api_client["KYC API client<br/>[api.ts]"]
  node_bank_app["Bank portal<br/>[BankPortal.tsx]"]
end

subgraph group_orchestration["Backend workflows"]
  node_server["Express API<br/>[index.ts]"]
  node_kyc_routes["KYC workflows<br/>[kyc.routes.ts]"]
  node_did_routes["DID workflows<br/>[did.routes.ts]"]
  node_bank_routes["Bank proof routes<br/>[bank.routes.ts]"]
  node_document_routes["Document endpoints<br/>[document.routes.ts]"]
end

subgraph group_identity["Identity and credentials"]
  node_indy_service["Indy adapter<br/>[indy.service.ts]"]
end

subgraph group_persistence["KYC records and documents"]
  node_fabric_service["Fabric adapter<br/>[fabric.service.ts]"]
  node_ipfs_service["IPFS adapter<br/>[ipfs.service.ts]"]
  node_vault_service["Vault adapter<br/>[vault.service.ts]"]
  node_chaincode["KYC contract<br/>[kyc.go]"]
  node_state_model["KYC state rules<br/>[model.go]"]
end

node_applicant(("Applicant"))
node_verifier(("KYC verifier"))
node_wallet(("BC Wallet"))
node_bank_user(("Bank customer"))
node_fabric[("Fabric ledger")]
node_ipfs[("IPFS Kubo")]
node_vault["HashiCorp Vault"]
node_acapy["ACA-Py agents"]
node_indy_ledger[("Indy ledger")]

node_applicant -->|"uses"| node_kyc_app
node_verifier -->|"uses"| node_kyc_app
node_kyc_app -->|"routes to"| node_submit_ui
node_kyc_app -->|"routes to"| node_status_ui
node_kyc_app -->|"routes to"| node_review_ui
node_submit_ui -->|"requests"| node_kyc_api_client
node_status_ui -->|"requests"| node_kyc_api_client
node_review_ui -->|"requests"| node_kyc_api_client
node_kyc_api_client -->|"HTTP requests"| node_server
node_bank_user -->|"uses"| node_bank_app
node_bank_app -->|"HTTP requests"| node_server
node_server -->|"dispatches"| node_kyc_routes
node_server -->|"dispatches"| node_did_routes
node_server -->|"dispatches"| node_bank_routes
node_server -->|"dispatches"| node_document_routes
node_kyc_routes -->|"reads and writes"| node_fabric_service
node_kyc_routes -->|"encrypts and decrypts"| node_vault_service
node_kyc_routes -->|"uploads and reads"| node_ipfs_service
node_kyc_routes -->|"issues and revokes"| node_indy_service
node_document_routes -->|"encrypts and decrypts"| node_vault_service
node_document_routes -->|"uploads and reads"| node_ipfs_service
node_did_routes -->|"manages DIDs"| node_indy_service
node_bank_routes -->|"requests invitations and proofs"| node_acapy
node_fabric_service -->|"submits and queries"| node_fabric
node_fabric -->|"executes contract"| node_chaincode
node_chaincode -->|"checks transitions"| node_state_model
node_vault_service -->|"encrypts and manages keys"| node_vault
node_ipfs_service -->|"stores and retrieves blobs"| node_ipfs
node_indy_service -->|"agent API calls"| node_acapy
node_acapy -->|"publishes and verifies"| node_indy_ledger
node_wallet -->|"DIDComm exchange"| node_acapy
node_acapy -->|"credential and proof exchange"| node_wallet
node_bank_app -->|"presents QR invitation"| node_wallet
node_wallet -.->|"proof verified against"| node_indy_ledger

click node_kyc_app "https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/App.tsx"
click node_submit_ui "https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/pages/Submit.tsx"
click node_status_ui "https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/pages/Status.tsx"
click node_review_ui "https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/pages/Verifier.tsx"
click node_kyc_api_client "https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/services/api.ts"
click node_bank_app "https://github.com/likinio365/zero-persistence-ekyc/blob/main/bank-frontend/src/pages/BankPortal.tsx"
click node_server "https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/index.ts"
click node_kyc_routes "https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/routes/kyc.routes.ts"
click node_did_routes "https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/routes/did.routes.ts"
click node_bank_routes "https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/routes/bank.routes.ts"
click node_document_routes "https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/routes/document.routes.ts"
click node_fabric_service "https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/services/fabric.service.ts"
click node_ipfs_service "https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/services/ipfs.service.ts"
click node_vault_service "https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/services/vault.service.ts"
click node_chaincode "https://github.com/likinio365/zero-persistence-ekyc/blob/main/chaincode/kyc.go"
click node_state_model "https://github.com/likinio365/zero-persistence-ekyc/blob/main/chaincode/model.go"
click node_indy_service "https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/services/indy.service.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_kyc_app,node_submit_ui,node_status_ui,node_review_ui,node_kyc_api_client,node_bank_app toneBlue
class node_server,node_kyc_routes,node_did_routes,node_bank_routes,node_document_routes,node_fabric,node_ipfs,node_indy_ledger toneAmber
class node_indy_service toneMint
class node_fabric_service,node_ipfs_service,node_vault_service,node_chaincode,node_state_model toneRose
class node_applicant,node_verifier,node_wallet,node_bank_user,node_vault,node_acapy toneIndigo
```

## Components

### User applications

- [KYC application](https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [KYC submission](https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/pages/Submit.tsx): `frontend/src/pages/Submit.tsx`
- [Status view](https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/pages/Status.tsx): `frontend/src/pages/Status.tsx`
- [Verifier panel](https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/pages/Verifier.tsx): `frontend/src/pages/Verifier.tsx`
- [KYC API client](https://github.com/likinio365/zero-persistence-ekyc/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Bank portal](https://github.com/likinio365/zero-persistence-ekyc/blob/main/bank-frontend/src/pages/BankPortal.tsx): `bank-frontend/src/pages/BankPortal.tsx`

### Backend workflows

- [Express API](https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [KYC workflows](https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/routes/kyc.routes.ts): `backend/src/routes/kyc.routes.ts`
- [DID workflows](https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/routes/did.routes.ts): `backend/src/routes/did.routes.ts`
- [Bank proof routes](https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/routes/bank.routes.ts): `backend/src/routes/bank.routes.ts`
- [Document endpoints](https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/routes/document.routes.ts): `backend/src/routes/document.routes.ts`

### Identity and credentials

- [Indy adapter](https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/services/indy.service.ts): `backend/src/services/indy.service.ts`

### KYC records and documents

- [Fabric adapter](https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/services/fabric.service.ts): `backend/src/services/fabric.service.ts`
- [IPFS adapter](https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/services/ipfs.service.ts): `backend/src/services/ipfs.service.ts`
- [Vault adapter](https://github.com/likinio365/zero-persistence-ekyc/blob/main/backend/src/services/vault.service.ts): `backend/src/services/vault.service.ts`
- [KYC contract](https://github.com/likinio365/zero-persistence-ekyc/blob/main/chaincode/kyc.go): `chaincode/kyc.go`
- [KYC state rules](https://github.com/likinio365/zero-persistence-ekyc/blob/main/chaincode/model.go): `chaincode/model.go`

### Other components

- **Applicant**
- **KYC verifier**
- **BC Wallet**
- **Bank customer**
- **Fabric ledger**
- **IPFS Kubo**
- **HashiCorp Vault**
- **ACA-Py agents**
- **Indy ledger**

## Connections

- Applicant → KYC application: uses
- KYC verifier → KYC application: uses
- KYC application → KYC submission: routes to
- KYC application → Status view: routes to
- KYC application → Verifier panel: routes to
- KYC submission → KYC API client: requests
- Status view → KYC API client: requests
- Verifier panel → KYC API client: requests
- KYC API client → Express API: HTTP requests
- Bank customer → Bank portal: uses
- Bank portal → Express API: HTTP requests
- Express API → KYC workflows: dispatches
- Express API → DID workflows: dispatches
- Express API → Bank proof routes: dispatches
- Express API → Document endpoints: dispatches
- KYC workflows → Fabric adapter: reads and writes
- KYC workflows → Vault adapter: encrypts and decrypts
- KYC workflows → IPFS adapter: uploads and reads
- KYC workflows → Indy adapter: issues and revokes
- Document endpoints → Vault adapter: encrypts and decrypts
- Document endpoints → IPFS adapter: uploads and reads
- DID workflows → Indy adapter: manages DIDs
- Bank proof routes → ACA-Py agents: requests invitations and proofs
- Fabric adapter → Fabric ledger: submits and queries
- Fabric ledger → KYC contract: executes contract
- KYC contract → KYC state rules: checks transitions
- Vault adapter → HashiCorp Vault: encrypts and manages keys
- IPFS adapter → IPFS Kubo: stores and retrieves blobs
- Indy adapter → ACA-Py agents: agent API calls
- ACA-Py agents → Indy ledger: publishes and verifies
- BC Wallet → ACA-Py agents: DIDComm exchange
- ACA-Py agents → BC Wallet: credential and proof exchange
- Bank portal → BC Wallet: presents QR invitation
- BC Wallet → Indy ledger: proof verified against
