overview/08-diagrams.md

1.7 KiB

8. Architectural diagrams

SVG files in diagrams/. The same shapes are repeated below in mermaid for Forgejo preview.

8.1 End-to-end (HTTPS vs NATS)

System

flowchart LR
  Z[Zapier cloud apps] -->|HTTPS x-api-key| E[zappier-edge]
  Cust[customer portal] -->|HTTPS statement| E
  CS[customer-service] -->|NATS statement/adjust| N[NATS 3-node cluster]
  SA[sales-pricing] -->|NATS statement| N
  AC[accounting-export] -->|NATS statement| N
  E -->|NATS billing| N
  BAL[account-balance] -->|reply verae.billing.*| N
  E -->|HTTPS metered| M[verae-middleware]
  M -->|HTTPS| C[Verae chain]
  M -->|JetStream| N
  N --> P[job-poller]
  N --> W[webhook-deliver]
  N --> A[archive-aggregator]
  N --> R[WORM x N]
  N --> T[tree-node x N]
  P -->|HTTPS status| C
  W -->|HTTPS REST Hook| Z

8.2 NATS.IO 3-server cluster

Cluster

flowchart TB
  subgraph cluster [Verae NATS.IO JetStream]
    N1[nats-server A :4222 loopback]
    N2[nats-server B]
    N3[nats-server C]
    N1 <--> N2
    N2 <--> N3
    N3 <--> N1
  end
  MW[middleware + workers] -->|cluster URL list| cluster
  F[fleet SSH hosts] -->|workers only| cluster

8.3 Uptime and failure

Uptime

flowchart TD
  H[health /health] -->|fail| R[restart instance]
  P[pause] -->|not available| F[keepFloor spawn]
  S[SSH host down] -->|spawn failed| O[place on next machine]
  Q[archive.query broadcast] -->|bloom miss| SIL[silence]
  Q -->|hit| REP[archive.reply.id]

8.4 New address = new process

Routing

See 09-expansion-template.md.