# tomblanchard312/centralbank architecture

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

- Interactive diagram: https://gitdiagram.com/tomblanchard312/centralbank
- Repository: https://github.com/tomblanchard312/centralbank

## Overview

CentralBank is a pre-MVP reference platform for governed digital-money operations. Its visible runtime centers on an API gateway for wallet, transfer, payment, merchant, administration, governance, audit, and fraud operations, alongside a separate sovereign-operator API and an operations dashboard. The repository also includes ISO 20022 and payment-terminal integrations, an SDK, and reconciliation tooling. The README describes ledger, policy, escrow, migration, and governance capabilities, but the provided tree has no contracts or profiles directories; implementation details for those capabilities cannot be mapped here.

Main entry points: [`api/src/index.ts`](https://github.com/tomblanchard312/centralbank/blob/main/api/src/index.ts) (API Gateway), [`iso20022-adapter/src/index.ts`](https://github.com/tomblanchard312/centralbank/blob/main/iso20022-adapter/src/index.ts) (ISO 20022 Adapter), [`tools/reconciliation-ref/index.js`](https://github.com/tomblanchard312/centralbank/blob/main/tools/reconciliation-ref/index.js) (Reconciliation Runner), [`iso20022-adapter/src/handlers/payment-status-report.ts`](https://github.com/tomblanchard312/centralbank/blob/main/iso20022-adapter/src/handlers/payment-status-report.ts) (Status Report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["Institutional API"]
  node_api["API Gateway<br/>[index.ts]"]
  node_wallets["Wallet Routes<br/>[wallets.ts]"]
  node_transfers["Transfer Routes<br/>[transfers.ts]"]
  node_payments["Payment Routes<br/>[payments.ts]"]
  node_merchants["Merchant Routes<br/>[merchants.ts]"]
  node_admin["Admin Routes<br/>[admin.ts]"]
  node_governance["Governance Routes<br/>[governance.ts]"]
  node_audit["Audit Routes<br/>[audit.ts]"]
  node_fraud["Fraud Routes<br/>[fraud.ts]"]
  node_chain["Blockchain Service<br/>[blockchain.ts]"]
  node_fees["Fee Engine<br/>[fee-engine.ts]"]
end

subgraph group_operations["Operator Console"]
  node_csp["Operator Routes<br/>[ecb.routes.ts]"]
  node_cspcontroller["Sovereign Actions<br/>[ecb.controller.ts]"]
  node_cspsvc["Audit and Idempotency<br/>[csp.services.ts]"]
  node_dashboard["Operations Dashboard<br/>[App.tsx]"]
end

subgraph group_integrations["Payment Integrations"]
  node_iso["ISO 20022 Adapter<br/>[index.ts]"]
  node_initiation["Payment Initiation"]
  node_status["Payment Status<br/>[payment-status.ts]"]
  node_statusreport["Status Report"]
  node_sdk["Client SDK<br/>[client.ts]"]
  node_terminal["Android Terminal<br/>[TEurTender.java]"]
  node_sumup["SumUp Integration"]
end

subgraph group_reconciliation["Reconciliation"]
  node_recon["Reconciliation Runner<br/>[index.js]"]
  node_storage[("Reconciliation Storage<br/>[storage.js]")]
  node_validation["Reconciliation Validation<br/>[validation.js]"]
  node_reconconfig["Reconciliation Config<br/>[config.js]"]
end

node_institution(("Institutional Client"))
node_operator(("Sovereign Operator"))

node_institution -.->|"sends requests"| node_api
node_api -->|"routes requests"| node_wallets
node_api -->|"routes requests"| node_transfers
node_api -->|"routes requests"| node_payments
node_api -->|"routes requests"| node_admin
node_api -->|"routes requests"| node_fraud
node_api -.->|"routes requests"| node_audit
node_api -.->|"routes requests"| node_merchants
node_api -.->|"routes requests"| node_governance
node_api -->|"initializes"| node_chain
node_operator -->|"requests actions"| node_csp
node_csp -->|"dispatches to"| node_cspcontroller
node_cspcontroller -->|"emits audit"| node_cspsvc
node_dashboard -.->|"calls API"| node_api
node_iso -->|"registers handler"| node_initiation
node_iso -->|"registers handler"| node_status
node_iso -->|"registers handler"| node_statusreport
node_status -->|"delegates to"| node_statusreport
node_statusreport -->|"fetches transfer"| node_api
node_sdk -.->|"calls API"| node_api
node_terminal -.->|"submits payments"| node_api
node_sumup -.->|"submits payments"| node_api
node_recon -->|"uses storage"| node_storage
node_recon -->|"uses validation"| node_validation
node_recon -->|"loads config"| node_reconconfig

click node_api "https://github.com/tomblanchard312/centralbank/blob/main/api/src/index.ts"
click node_wallets "https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/wallets.ts"
click node_transfers "https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/transfers.ts"
click node_payments "https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/payments.ts"
click node_merchants "https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/merchants.ts"
click node_admin "https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/admin.ts"
click node_governance "https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/governance.ts"
click node_audit "https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/audit.ts"
click node_fraud "https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/fraud.ts"
click node_chain "https://github.com/tomblanchard312/centralbank/blob/main/api/src/services/blockchain.ts"
click node_fees "https://github.com/tomblanchard312/centralbank/blob/main/api/src/services/fee-engine.ts"
click node_csp "https://github.com/tomblanchard312/centralbank/blob/main/api/src/csp/routes/ecb.routes.ts"
click node_cspcontroller "https://github.com/tomblanchard312/centralbank/blob/main/api/src/csp/controllers/ecb.controller.ts"
click node_cspsvc "https://github.com/tomblanchard312/centralbank/blob/main/api/src/csp/services/csp.services.ts"
click node_dashboard "https://github.com/tomblanchard312/centralbank/blob/main/dashboard/src/App.tsx"
click node_iso "https://github.com/tomblanchard312/centralbank/blob/main/iso20022-adapter/src/index.ts"
click node_initiation "https://github.com/tomblanchard312/centralbank/blob/main/iso20022-adapter/src/handlers/payment-initiation.ts"
click node_status "https://github.com/tomblanchard312/centralbank/blob/main/iso20022-adapter/src/handlers/payment-status.ts"
click node_statusreport "https://github.com/tomblanchard312/centralbank/blob/main/iso20022-adapter/src/handlers/payment-status-report.ts"
click node_sdk "https://github.com/tomblanchard312/centralbank/blob/main/sdk/src/client.ts"
click node_terminal "https://github.com/tomblanchard312/centralbank/blob/main/clover-android-app/app/src/main/java/com/teur/clover/TEurTender.java"
click node_sumup "https://github.com/tomblanchard312/centralbank/blob/main/sumup-integration/SumUpTEurIntegration.java"
click node_recon "https://github.com/tomblanchard312/centralbank/blob/main/tools/reconciliation-ref/index.js"
click node_storage "https://github.com/tomblanchard312/centralbank/blob/main/tools/reconciliation-ref/storage.js"
click node_validation "https://github.com/tomblanchard312/centralbank/blob/main/tools/reconciliation-ref/validation.js"
click node_reconconfig "https://github.com/tomblanchard312/centralbank/blob/main/tools/reconciliation-ref/config.js"

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_api,node_wallets,node_transfers,node_payments,node_merchants,node_admin,node_governance,node_audit,node_fraud,node_chain,node_fees,node_institution toneBlue
class node_csp,node_cspcontroller,node_cspsvc,node_dashboard toneAmber
class node_iso,node_initiation,node_status,node_statusreport,node_sdk,node_terminal,node_sumup toneMint
class node_recon,node_storage,node_validation,node_reconconfig toneRose
class node_operator toneIndigo
```

## Components

### Institutional API

- [API Gateway](https://github.com/tomblanchard312/centralbank/blob/main/api/src/index.ts): `api/src/index.ts`
- [Wallet Routes](https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/wallets.ts): `api/src/routes/wallets.ts`
- [Transfer Routes](https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/transfers.ts): `api/src/routes/transfers.ts`
- [Payment Routes](https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/payments.ts): `api/src/routes/payments.ts`
- [Merchant Routes](https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/merchants.ts): `api/src/routes/merchants.ts`
- [Admin Routes](https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/admin.ts): `api/src/routes/admin.ts`
- [Governance Routes](https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/governance.ts): `api/src/routes/governance.ts`
- [Audit Routes](https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/audit.ts): `api/src/routes/audit.ts`
- [Fraud Routes](https://github.com/tomblanchard312/centralbank/blob/main/api/src/routes/fraud.ts): `api/src/routes/fraud.ts`
- [Blockchain Service](https://github.com/tomblanchard312/centralbank/blob/main/api/src/services/blockchain.ts): `api/src/services/blockchain.ts`
- [Fee Engine](https://github.com/tomblanchard312/centralbank/blob/main/api/src/services/fee-engine.ts): `api/src/services/fee-engine.ts`

### Operator Console

- [Operator Routes](https://github.com/tomblanchard312/centralbank/blob/main/api/src/csp/routes/ecb.routes.ts): `api/src/csp/routes/ecb.routes.ts`
- [Sovereign Actions](https://github.com/tomblanchard312/centralbank/blob/main/api/src/csp/controllers/ecb.controller.ts): `api/src/csp/controllers/ecb.controller.ts`
- [Audit and Idempotency](https://github.com/tomblanchard312/centralbank/blob/main/api/src/csp/services/csp.services.ts): `api/src/csp/services/csp.services.ts`
- [Operations Dashboard](https://github.com/tomblanchard312/centralbank/blob/main/dashboard/src/App.tsx): `dashboard/src/App.tsx`

### Payment Integrations

- [ISO 20022 Adapter](https://github.com/tomblanchard312/centralbank/blob/main/iso20022-adapter/src/index.ts): `iso20022-adapter/src/index.ts`
- [Payment Initiation](https://github.com/tomblanchard312/centralbank/blob/main/iso20022-adapter/src/handlers/payment-initiation.ts): `iso20022-adapter/src/handlers/payment-initiation.ts`
- [Payment Status](https://github.com/tomblanchard312/centralbank/blob/main/iso20022-adapter/src/handlers/payment-status.ts): `iso20022-adapter/src/handlers/payment-status.ts`
- [Status Report](https://github.com/tomblanchard312/centralbank/blob/main/iso20022-adapter/src/handlers/payment-status-report.ts): `iso20022-adapter/src/handlers/payment-status-report.ts`
- [Client SDK](https://github.com/tomblanchard312/centralbank/blob/main/sdk/src/client.ts): `sdk/src/client.ts`
- [Android Terminal](https://github.com/tomblanchard312/centralbank/blob/main/clover-android-app/app/src/main/java/com/teur/clover/TEurTender.java): `clover-android-app/app/src/main/java/com/teur/clover/TEurTender.java`
- [SumUp Integration](https://github.com/tomblanchard312/centralbank/blob/main/sumup-integration/SumUpTEurIntegration.java): `sumup-integration/SumUpTEurIntegration.java`

### Reconciliation

- [Reconciliation Runner](https://github.com/tomblanchard312/centralbank/blob/main/tools/reconciliation-ref/index.js): `tools/reconciliation-ref/index.js`
- [Reconciliation Storage](https://github.com/tomblanchard312/centralbank/blob/main/tools/reconciliation-ref/storage.js): `tools/reconciliation-ref/storage.js`
- [Reconciliation Validation](https://github.com/tomblanchard312/centralbank/blob/main/tools/reconciliation-ref/validation.js): `tools/reconciliation-ref/validation.js`
- [Reconciliation Config](https://github.com/tomblanchard312/centralbank/blob/main/tools/reconciliation-ref/config.js): `tools/reconciliation-ref/config.js`

### Other components

- **Institutional Client**
- **Sovereign Operator**

## Connections

- Institutional Client → API Gateway: sends requests
- API Gateway → Wallet Routes: routes requests (evidence: `api/src/index.ts`)
- API Gateway → Transfer Routes: routes requests (evidence: `api/src/index.ts`)
- API Gateway → Payment Routes: routes requests (evidence: `api/src/index.ts`)
- API Gateway → Admin Routes: routes requests (evidence: `api/src/index.ts`)
- API Gateway → Fraud Routes: routes requests (evidence: `api/src/index.ts`)
- API Gateway → Audit Routes: routes requests (evidence: `api/src/index.ts`)
- API Gateway → Merchant Routes: routes requests (evidence: `api/src/index.ts`)
- API Gateway → Governance Routes: routes requests (evidence: `api/src/index.ts`)
- API Gateway → Blockchain Service: initializes (evidence: `api/src/index.ts`)
- Sovereign Operator → Operator Routes: requests actions (evidence: `api/src/csp/routes/ecb.routes.ts`)
- Operator Routes → Sovereign Actions: dispatches to (evidence: `api/src/csp/routes/ecb.routes.ts`)
- Sovereign Actions → Audit and Idempotency: emits audit (evidence: `api/src/csp/controllers/ecb.controller.ts`)
- Operations Dashboard → API Gateway: calls API
- ISO 20022 Adapter → Payment Initiation: registers handler (evidence: `iso20022-adapter/src/index.ts`)
- ISO 20022 Adapter → Payment Status: registers handler (evidence: `iso20022-adapter/src/index.ts`)
- ISO 20022 Adapter → Status Report: registers handler (evidence: `iso20022-adapter/src/index.ts`)
- Payment Status → Status Report: delegates to (evidence: `iso20022-adapter/src/handlers/payment-status.ts`)
- Status Report → API Gateway: fetches transfer (evidence: `iso20022-adapter/src/handlers/payment-status-report.ts`)
- Client SDK → API Gateway: calls API
- Android Terminal → API Gateway: submits payments
- SumUp Integration → API Gateway: submits payments
- Reconciliation Runner → Reconciliation Storage: uses storage (evidence: `tools/reconciliation-ref/index.js`)
- Reconciliation Runner → Reconciliation Validation: uses validation (evidence: `tools/reconciliation-ref/index.js`)
- Reconciliation Runner → Reconciliation Config: loads config (evidence: `tools/reconciliation-ref/index.js`)
