@@ -78,6 +78,120 @@ graph LR
7878<tr ><td ><b >Observability</b ></td ><td >OpenTelemetry tracing, structured JSON logging, SonarCloud</td ></tr >
7979</table >
8080
81+ ### System Architecture
82+
83+ ``` mermaid
84+ graph TB
85+ subgraph Clients["Clients"]
86+ direction LR
87+ MERCH["Merchant Apps<br/>(Portal / API)"]
88+ AGENT["AI Agents<br/>(LLM / MCP)"]
89+ OPS["Ops Dashboard"]
90+ end
91+
92+ subgraph Platform["StableBridge Platform"]
93+
94+ subgraph Edge["Edge Layer"]
95+ S10["<b>S10</b> API Gateway & IAM<br/><i>OAuth2 · API Keys · mTLS · Rate Limiting</i>"]
96+ end
97+
98+ subgraph Identity["Identity & Merchant (Phase 1)"]
99+ direction LR
100+ S11["<b>S11</b> Merchant<br/>Onboarding<br/><i>KYB · Lifecycle</i>"]
101+ S13["<b>S13</b> Merchant<br/>IAM<br/><i>Roles · Permissions</i>"]
102+ end
103+
104+ subgraph Core["Core Payment Engine (Phase 2)"]
105+ S1["<b>S1</b> Payment Orchestrator<br/><i>Temporal Saga · State Machine</i>"]
106+ S2["<b>S2</b> Compliance &<br/>Travel Rule<br/><i>AML · Sanctions · FATF</i>"]
107+ S6["<b>S6</b> FX & Liquidity<br/>Engine<br/><i>Quotes · Rate Locking</i>"]
108+ end
109+
110+ subgraph Value["Value Movement (Phase 3)"]
111+ S3["<b>S3</b> Fiat<br/>On-Ramp<br/><i>ACH Collection</i>"]
112+ S4["<b>S4</b> Blockchain<br/>& Custody<br/><i>USDC · Base L2</i>"]
113+ S5["<b>S5</b> Fiat<br/>Off-Ramp<br/><i>SEPA Payout</i>"]
114+ S7["<b>S7</b> Ledger &<br/>Accounting<br/><i>Double-Entry · Recon</i>"]
115+ end
116+
117+ subgraph Ops["Operational (Phase 4 — Planned)"]
118+ direction LR
119+ S8["<b>S8</b> Partner<br/>Management"]
120+ S9["<b>S9</b> Notification<br/>& Webhook"]
121+ end
122+ end
123+
124+ subgraph Infra["Infrastructure Layer"]
125+ direction LR
126+ PG[("PostgreSQL<br/>(per-service)")]
127+ KF["Apache Kafka<br/>(Redpanda)"]
128+ TMP["Temporal<br/>(Durable Workflows)"]
129+ RD[("Redis<br/>(Cache)")]
130+ VLT["HashiCorp Vault<br/>(Secrets)"]
131+ ES["Elasticsearch<br/>(Search)"]
132+ end
133+
134+ subgraph External["External Providers"]
135+ direction LR
136+ STRIPE["Stripe<br/>(ACH)"]
137+ MODULR["Modulr<br/>(SEPA)"]
138+ FB["Fireblocks<br/>(MPC Custody)"]
139+ CA["Chainalysis<br/>(AML/KYT)"]
140+ CHAIN["Base L2<br/>(USDC on-chain)"]
141+ ONFIDO["Onfido<br/>(KYC/KYB)"]
142+ end
143+
144+ %% Client to Edge
145+ MERCH --> S10
146+ AGENT --> S10
147+ OPS --> S10
148+
149+ %% Edge to Services
150+ S10 --> S11
151+ S10 --> S13
152+ S10 --> S1
153+
154+ %% Orchestrator to Core
155+ S1 -->|"compliance check"| S2
156+ S1 -->|"lock FX rate"| S6
157+ S1 -->|"collect fiat"| S3
158+ S1 -->|"on-chain transfer"| S4
159+ S1 -->|"payout fiat"| S5
160+ S1 -->|"journal entries"| S7
161+
162+ %% External Integrations
163+ S3 -. "ACH" .-> STRIPE
164+ S5 -. "SEPA" .-> MODULR
165+ S4 -. "MPC signing" .-> FB
166+ S4 -. "RPC / tx" .-> CHAIN
167+ S2 -. "screening" .-> CA
168+ S11 -. "KYB verification" .-> ONFIDO
169+
170+ %% Infrastructure (implicit — all services use these)
171+ S1 -.-> TMP
172+
173+ %% Styling
174+ style S10 fill:#607D8B,color:#fff
175+ style S1 fill:#FF5722,color:#fff
176+ style S2 fill:#9C27B0,color:#fff
177+ style S6 fill:#2196F3,color:#fff
178+ style S3 fill:#00BCD4,color:#fff
179+ style S4 fill:#FF9800,color:#fff
180+ style S5 fill:#00BCD4,color:#fff
181+ style S7 fill:#4CAF50,color:#fff
182+ style S11 fill:#795548,color:#fff
183+ style S13 fill:#795548,color:#fff
184+ style S8 fill:#9E9E9E,color:#fff,stroke-dasharray: 5 5
185+ style S9 fill:#9E9E9E,color:#fff,stroke-dasharray: 5 5
186+ style MERCH fill:#E8EAF6,color:#333
187+ style AGENT fill:#E8EAF6,color:#333
188+ style OPS fill:#E8EAF6,color:#333
189+ ```
190+
191+ > ** Solid lines** = synchronous REST calls (Temporal activities). ** Dashed lines** = external provider integrations.
192+ > All inter-service events flow via ** Kafka** using the transactional outbox pattern (Namastack).
193+ > Each service has its own ** PostgreSQL** database (database-per-service pattern).
194+
81195### Payment Flow
82196
83197``` mermaid
0 commit comments