# codedriverepeat/centralbank architecture

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

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

## Overview

CentralBank is a pre-MVP reference platform for governing and operating digital-token payments. The visible runtime workflow is an API request routed to domain endpoints, with a blockchain service initialized by the gateway; institutional operators also have a separate authenticated CSP workflow and dashboard. The repository additionally includes payment-format and merchant integrations, an SDK, and reconciliation tooling. The README describes broader ledger, escrow, migration, and policy capabilities, but their contract sources are absent from this tree; connections to unsampled implementations are therefore not asserted.

Main entry points: [`api/src/index.ts`](https://github.com/codedriverepeat/centralbank/blob/main/api/src/index.ts) (API gateway), [`api/src/csp/routes/ecb.routes.ts`](https://github.com/codedriverepeat/centralbank/blob/main/api/src/csp/routes/ecb.routes.ts) (CSP routes), [`dashboard/src/App.tsx`](https://github.com/codedriverepeat/centralbank/blob/main/dashboard/src/App.tsx) (Operations dashboard), [`api/src/services/blockchain.ts`](https://github.com/codedriverepeat/centralbank/blob/main/api/src/services/blockchain.ts) (Blockchain service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["API gateway"]
  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_fraud["Fraud routes<br/>[fraud.ts]"]
  node_audit["Audit routes<br/>[audit.ts]"]
  node_governance["Governance routes<br/>[governance.ts]"]
  node_blockchain["Blockchain service<br/>[blockchain.ts]"]
  node_fee["Fee engine<br/>[fee-engine.ts]"]
end

subgraph group_operations["Institutional operations"]
  node_csp["CSP routes<br/>[ecb.routes.ts]"]
  node_cspauth["CSP access controls<br/>[auth.ts]"]
  node_cspcontroller["Sovereign actions<br/>[ecb.controller.ts]"]
  node_cspaudit["CSP audit and idempotency<br/>[csp.services.ts]"]
end

subgraph group_clients["Operator and client tools"]
  node_dashboard["Operations dashboard<br/>[App.tsx]"]
  node_dashboardauth["Dashboard identity<br/>[useAuth.ts]"]
  node_sdk["Client SDK<br/>[client.ts]"]
end

subgraph group_integration["Payment integrations"]
  node_iso["ISO 20022 adapter<br/>[index.ts]"]
  node_statusreport["Status report handler"]
  node_sumup["SumUp integration"]
  node_android["Android tender app"]
end

subgraph group_reconciliation["Reconciliation"]
  node_recon["Reconciliation runner<br/>[index.js]"]
  node_reconstorage[("Reconciliation storage<br/>[storage.js]")]
end

node_bank(("Institutional client"))
node_operator(("Operator"))
node_ledger[("Blockchain network")]
node_centralapi["CentralBank API"]

node_api -->|"routes to"| node_wallets
node_api -->|"routes to"| node_transfers
node_api -->|"routes to"| node_payments
node_api -->|"routes to"| node_admin
node_api -->|"routes to"| node_fraud
node_api -->|"routes to"| node_audit
node_api -->|"routes to"| node_merchants
node_api -->|"routes to"| node_governance
node_api -->|"initializes"| node_blockchain
node_bank -.->|"sends requests"| node_api
node_api -.->|"uses for pricing"| node_fee
node_operator -->|"uses"| node_dashboard
node_dashboard -->|"uses identity"| node_dashboardauth
node_dashboard -.->|"submits operations"| node_csp
node_csp -->|"applies access checks"| node_cspauth
node_csp -->|"dispatches actions"| node_cspcontroller
node_cspcontroller -->|"emits audit events"| node_cspaudit
node_csp -.->|"serves alongside"| node_api
node_iso -->|"dispatches handler"| node_statusreport
node_statusreport -->|"fetches transfer"| node_centralapi
node_bank -.->|"submits messages"| node_iso
node_sdk -.->|"calls API"| node_centralapi
node_sumup -.->|"integrates with"| node_centralapi
node_android -.->|"integrates with"| node_centralapi
node_recon -.->|"uses storage"| node_reconstorage
node_blockchain -.->|"connects to"| node_ledger

click node_api "https://github.com/codedriverepeat/centralbank/blob/main/api/src/index.ts"
click node_wallets "https://github.com/codedriverepeat/centralbank/blob/main/api/src/routes/wallets.ts"
click node_transfers "https://github.com/codedriverepeat/centralbank/blob/main/api/src/routes/transfers.ts"
click node_payments "https://github.com/codedriverepeat/centralbank/blob/main/api/src/routes/payments.ts"
click node_merchants "https://github.com/codedriverepeat/centralbank/blob/main/api/src/routes/merchants.ts"
click node_admin "https://github.com/codedriverepeat/centralbank/blob/main/api/src/routes/admin.ts"
click node_fraud "https://github.com/codedriverepeat/centralbank/blob/main/api/src/routes/fraud.ts"
click node_audit "https://github.com/codedriverepeat/centralbank/blob/main/api/src/routes/audit.ts"
click node_governance "https://github.com/codedriverepeat/centralbank/blob/main/api/src/routes/governance.ts"
click node_blockchain "https://github.com/codedriverepeat/centralbank/blob/main/api/src/services/blockchain.ts"
click node_fee "https://github.com/codedriverepeat/centralbank/blob/main/api/src/services/fee-engine.ts"
click node_csp "https://github.com/codedriverepeat/centralbank/blob/main/api/src/csp/routes/ecb.routes.ts"
click node_cspauth "https://github.com/codedriverepeat/centralbank/blob/main/api/src/csp/middleware/auth.ts"
click node_cspcontroller "https://github.com/codedriverepeat/centralbank/blob/main/api/src/csp/controllers/ecb.controller.ts"
click node_cspaudit "https://github.com/codedriverepeat/centralbank/blob/main/api/src/csp/services/csp.services.ts"
click node_dashboard "https://github.com/codedriverepeat/centralbank/blob/main/dashboard/src/App.tsx"
click node_dashboardauth "https://github.com/codedriverepeat/centralbank/blob/main/dashboard/src/hooks/useAuth.ts"
click node_sdk "https://github.com/codedriverepeat/centralbank/blob/main/sdk/src/client.ts"
click node_iso "https://github.com/codedriverepeat/centralbank/blob/main/iso20022-adapter/src/index.ts"
click node_statusreport "https://github.com/codedriverepeat/centralbank/blob/main/iso20022-adapter/src/handlers/payment-status-report.ts"
click node_sumup "https://github.com/codedriverepeat/centralbank/blob/main/sumup-integration/SumUpCentralBankIntegration.java"
click node_android "https://github.com/codedriverepeat/centralbank/blob/main/clover-android-app/app/src/main/java/com/centralbank/clover/CentralBankTender.java"
click node_recon "https://github.com/codedriverepeat/centralbank/blob/main/tools/reconciliation-ref/index.js"
click node_reconstorage "https://github.com/codedriverepeat/centralbank/blob/main/tools/reconciliation-ref/storage.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_fraud,node_audit,node_governance,node_blockchain,node_fee,node_bank toneBlue
class node_csp,node_cspauth,node_cspcontroller,node_cspaudit,node_ledger toneAmber
class node_dashboard,node_dashboardauth,node_sdk,node_centralapi toneMint
class node_iso,node_statusreport,node_sumup,node_android toneRose
class node_recon,node_reconstorage,node_operator toneIndigo
```

## Components

### API gateway

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

### Institutional operations

- [CSP routes](https://github.com/codedriverepeat/centralbank/blob/main/api/src/csp/routes/ecb.routes.ts): `api/src/csp/routes/ecb.routes.ts`
- [CSP access controls](https://github.com/codedriverepeat/centralbank/blob/main/api/src/csp/middleware/auth.ts): `api/src/csp/middleware/auth.ts`
- [Sovereign actions](https://github.com/codedriverepeat/centralbank/blob/main/api/src/csp/controllers/ecb.controller.ts): `api/src/csp/controllers/ecb.controller.ts`
- [CSP audit and idempotency](https://github.com/codedriverepeat/centralbank/blob/main/api/src/csp/services/csp.services.ts): `api/src/csp/services/csp.services.ts`

### Operator and client tools

- [Operations dashboard](https://github.com/codedriverepeat/centralbank/blob/main/dashboard/src/App.tsx): `dashboard/src/App.tsx`
- [Dashboard identity](https://github.com/codedriverepeat/centralbank/blob/main/dashboard/src/hooks/useAuth.ts): `dashboard/src/hooks/useAuth.ts`
- [Client SDK](https://github.com/codedriverepeat/centralbank/blob/main/sdk/src/client.ts): `sdk/src/client.ts`

### Payment integrations

- [ISO 20022 adapter](https://github.com/codedriverepeat/centralbank/blob/main/iso20022-adapter/src/index.ts): `iso20022-adapter/src/index.ts`
- [Status report handler](https://github.com/codedriverepeat/centralbank/blob/main/iso20022-adapter/src/handlers/payment-status-report.ts): `iso20022-adapter/src/handlers/payment-status-report.ts`
- [SumUp integration](https://github.com/codedriverepeat/centralbank/blob/main/sumup-integration/SumUpCentralBankIntegration.java): `sumup-integration/SumUpCentralBankIntegration.java`
- [Android tender app](https://github.com/codedriverepeat/centralbank/blob/main/clover-android-app/app/src/main/java/com/centralbank/clover/CentralBankTender.java): `clover-android-app/app/src/main/java/com/centralbank/clover/CentralBankTender.java`

### Reconciliation

- [Reconciliation runner](https://github.com/codedriverepeat/centralbank/blob/main/tools/reconciliation-ref/index.js): `tools/reconciliation-ref/index.js`
- [Reconciliation storage](https://github.com/codedriverepeat/centralbank/blob/main/tools/reconciliation-ref/storage.js): `tools/reconciliation-ref/storage.js`

### Other components

- **Institutional client**
- **Operator**
- **Blockchain network**
- **CentralBank API**

## Connections

- API gateway → Wallet routes: routes to (evidence: `api/src/index.ts`)
- API gateway → Transfer routes: routes to (evidence: `api/src/index.ts`)
- API gateway → Payment routes: routes to (evidence: `api/src/index.ts`)
- API gateway → Admin routes: routes to (evidence: `api/src/index.ts`)
- API gateway → Fraud routes: routes to (evidence: `api/src/index.ts`)
- API gateway → Audit routes: routes to (evidence: `api/src/index.ts`)
- API gateway → Merchant routes: routes to (evidence: `api/src/index.ts`)
- API gateway → Governance routes: routes to (evidence: `api/src/index.ts`)
- API gateway → Blockchain service: initializes (evidence: `api/src/index.ts`)
- Institutional client → API gateway: sends requests
- API gateway → Fee engine: uses for pricing
- Operator → Operations dashboard: uses (evidence: `dashboard/src/App.tsx`)
- Operations dashboard → Dashboard identity: uses identity
- Operations dashboard → CSP routes: submits operations
- CSP routes → CSP access controls: applies access checks (evidence: `api/src/csp/routes/ecb.routes.ts`)
- CSP routes → Sovereign actions: dispatches actions (evidence: `api/src/csp/routes/ecb.routes.ts`)
- Sovereign actions → CSP audit and idempotency: emits audit events (evidence: `api/src/csp/controllers/ecb.controller.ts`)
- CSP routes → API gateway: serves alongside
- ISO 20022 adapter → Status report handler: dispatches handler (evidence: `iso20022-adapter/src/index.ts`)
- Status report handler → CentralBank API: fetches transfer (evidence: `iso20022-adapter/src/handlers/payment-status-report.ts`)
- Institutional client → ISO 20022 adapter: submits messages
- Client SDK → CentralBank API: calls API
- SumUp integration → CentralBank API: integrates with
- Android tender app → CentralBank API: integrates with
- Reconciliation runner → Reconciliation storage: uses storage (evidence: `tools/reconciliation-ref/index.js`)
- Blockchain service → Blockchain network: connects to
