Architecture
UBO is built around one gateway (deployed as several identical instances) carrying all the business domains, one PostgreSQL database as the source of truth, and specialised infrastructure services: identity, event queue, cache, vault, file server, monitoring. Two views complement each other:
- the components: who calls whom, over which protocol;
- the functions: how information flows between the business functions, and by which medium (in-memory call, SQL transaction, file, event journal, network).
Components and their calls
Section titled “Components and their calls”Technical flow matrix
Section titled “Technical flow matrix”| No. | Caller → called | Medium | Mode | What for | Security |
|---|---|---|---|---|---|
| 1 | Users → Traefik | HTTPS | synchronous | The portal (React app) and its API calls | TLS, session token |
| 2 | Users → Keycloak | OpenID Connect (authorization code) | synchronous | Single sign-on to the portal | Password, Keycloak policy |
| 3 | Bank systems → Traefik | HTTPS, JSON REST API | synchronous | Issuing, authorizations, disputes, files… | OAuth 2.0 token (JWT) carrying the bank |
| 4 | Traefik → gateways | HTTP | synchronous | Round-robin; a gateway no longer answering /health is taken out |
Internal network |
| 5 | Gateway → Keycloak | HTTPS | periodic (10 min) | Public keys (JWKS) to verify the tokens | — |
| 6 | Gateway → bank systems | HTTPS (webhooks) | asynchronous | Each business event, a few seconds later | HMAC-SHA256 signature, 6 attempts |
| 7 | Gateway ↔ networks | ISO 8583 over TCP | real time | Authorizations (0100/0110), reversals (0400), advices, session management (0800); UBO’s station opens the session | Zone keys, encrypted PIN, cryptograms |
| 8 | Networks → SFTPGo | SFTP | per file | Daily clearing files | SSH key, PGP-encrypted file |
| 9 | Partners → SFTPGo | SFTP | per file | Dropping and collecting files (hosted exchange points) | SSH key, isolated space, PGP |
| 10 | SFTPGo → gateway | HTTP (hook) | on each drop | Reports each upload, rename, download | Hook token |
| 11 | Gateway → SFTPGo | HTTP (admin API) | on demand | Partners’ accounts, keys, quotas | Admin account, vault |
| 12 | Gateway → partners | SFTP or HTTPS | per batch | Push to a remote partner (manufacturing, files) | SSH key or token, PGP |
| 13 | Gateway → external services | HTTPS | synchronous, bounded | The rules’ calls (KYC, fraud score, reference data) | API keys from the vault; never the card number |
| 14 | Gateway → PostgreSQL | SQL (+ LISTEN/NOTIFY) | synchronous | All writes and up-to-date reads; change signals | Role subject to bank isolation |
| 15 | Gateway → replica | SQL | synchronous | Consultation, reporting, audit, while less than 5 s behind | Same role, same isolation |
| 16 | PostgreSQL → replica | Streaming replication (WAL) | continuous | Keep the replica up to date | Dedicated replication role |
| 17 | Gateway → Redis | RESP | synchronous, bounded (100 ms) | Shared quotas, cards’ recent activity | Internal network |
| 18 | Gateway → Kafka | Produce | asynchronous | Event publication (one topic per object) | Internal network |
| 19 | Consumers → Kafka | Consume | asynchronous | The bank’s systems read the event stream | ACLs per bank (production) |
| 20 | Gateway → OpenBao | HTTP (KV v2) | on demand, 30 s cache | Secrets: API keys, passwords, PGP keys | Limited-rights token, unsealed by the HSM |
| 21 | Gateway → Jaeger | OTLP | asynchronous | Traces of each operation | Internal network |
| 22 | Prometheus → gateways | HTTP (/metrics) |
every 5 s | Metrics, each gateway found by its name | Internal network |
| 23 | Containers → Loki | Logs (Promtail) | continuous | Logs of all the containers | Internal network |
| 24-26 | Grafana → Prometheus, Loki, Jaeger | PromQL, LogQL, API | on demand | Dashboards, linked logs and traces | Grafana account |
Functions and their flows
Section titled “Functions and their flows”Functional flow matrix
Section titled “Functional flow matrix”| No. | From → to | Medium | What travels |
|---|---|---|---|
| F1 | Networks → stations | ISO 8583 / TCP | The authorization request, in the network’s dialect |
| F2 | Stations → authorization path | In-memory call | The request translated into the platform’s neutral model (the same as for the API) |
| F3 | Path → rule engine | In-memory call | The operation’s context (request, card, cardholder, history); 800 ms budget |
| F4 | Rules → external services | HTTPS | The useful data (never the card number); answer, timeout or error |
| F5 | Path → limits and balances | SQL transaction | Reserving the amount on the balance and all the limits concerned, in one call |
| F6 | Path → decision | Same transaction | The operation, its explained decision, its fingerprint and its first event, recorded together |
| F7 | Path → HSM | In-memory call | PIN, CVV and chip cryptogram verification; response computation |
| F8 | Networks, bank → transfers | SFTP + PGP | Incoming files (clearing, blocks…) |
| F9 | Transfers → files | Stored, encrypted file | The received file, checked against its format and totals |
| F10 | Files → clearing | Lines integrated by a job (5 s) | Each cleared transaction, matched with its authorization |
| F11 | Clearing → operation lifecycle | Network message, in memory | Presentment, credit, withdrawal, reversal: the same processing as through the API |
| F12 | Lifecycle → accounting | Same transaction | The financial event of the account movement |
| F13 | Accounting, files → bank | Produced, signed file, through transfers | The day’s accounting report, the authorization journal |
| F14 | Decision → operation lifecycle | Same transaction | The authorization opens its lifecycle: hold, deadline, follow-ups |
| F15 | Disputes → operation lifecycle | Network message, in memory | The case’s actions (chargeback, pre-arbitration…) and financial decisions |
| F16 | Manufacturing → files | File in the personaliser’s format | The batch of cards to make, signed and encrypted |
| F17 | Transfers → personalisers | SFTP or HTTPS | The batch, then acknowledgements and tracking |
| F18 | Lifecycle → event journal | Same transaction (outbox) | Each change of an operation, card, file, dispute |
| F19 | Journal → webhooks, Kafka | Relays every second | The events, signed for the webhooks, per object on Kafka |
| F20 | Scheduler → functions | Jobs under lease | File integration, expiries, dispute deadlines, accounting close, publication, partitions |
Technologies
Section titled “Technologies”| Component | Role | Technology |
|---|---|---|
| Gateway (×2) | The API, the network stations, the scheduler, all the business domains | Rust, Axum, SQLx |
| Traefik | Balances the API between the gateways, serves the portal and the documentation | Traefik 3 |
| PostgreSQL | Source of truth: all the data, isolated per bank | PostgreSQL 17 |
| Read replica | Consultation, reporting, audit | PostgreSQL 17, streaming replication |
| Redis | Quotas shared between gateways, cards’ recent activity | Redis 7 |
| Kafka | Publication of the business events | Kafka (KRaft) |
| OpenBao | Secrets vault | OpenBao |
| Keycloak | Identity: users’ sign-in, API tokens | Keycloak |
| SFTPGo | Partners’ SFTP server | SFTPGo |
| Portal | The banks’ interface | React, TypeScript, Tailwind |
| Simulator | Networks, merchants, personalisers, external services | Rust |
| Monitoring | Metrics, dashboards, traces, logs | Prometheus, Grafana, Jaeger, Loki |
The code
Section titled “The code”The gateway is a set of Rust modules in a hexagonal architecture: the domain (model and rules) depends on no technology; the adapters (database, Kafka, network, files) and the API plug into it. Each module is described in the business components.
| Module | Domain |
|---|---|
ubo-common |
Core: configuration, errors, isolation, HSM, vault, quotas, cache, replica, events |
ubo-entity, ubo-user |
Organisations; users and roles |
ubo-card |
Cardholders, accounts, cards and their lifecycle, products, designs, limits, PIN |
ubo-auth-engine |
Authorization path, decisions, 3-D Secure, network stations, reporting |
ubo-rule-engine |
Rule engine and external calls |
ubo-network, ubo-visa |
ISO 8583 codec and networks’ dialects; issuer state machine |
ubo-disputes |
Dispute cases |
ubo-files, ubo-transfers |
Format engine and file lifecycle; SFTP transfers |
ubo-accounting |
Financial events, entries, days, accounting report |
ubo-personalization |
Card manufacturing |
ubo-gateway |
Assembly: API, authentication, scheduler, security, monitoring |
ubo-simulator |
Simulator |
| Layer | Content |
|---|---|
domain/model.rs |
The objects and their rules (statuses, transitions, computations), with no technical dependency |
domain/ports.rs |
What the domain needs (repositories, clock, network), described as interfaces |
adapters/ |
The implementations: PostgreSQL, Kafka, Redis, files, network |
api/ |
The HTTP routes, their DTOs (described in the OpenAPI specification) |
In the portal
Section titled “In the portal”The screen Exploitation → Architecture shows the same platform in six views (business, functional, software, system, data, integration), with each component’s real state.


