Skip to content

Architecture

The gateway is an edge proxy, not a service. There are no state machines (no domain entities) — the runtime scenarios below describe request-routing paths instead.

1. System Context (C4 L1)

2. Container View (C4 L2)

Two distinct proxy topologies share the same routing intent: Traefik for Docker/prod, local Nginx for native dev.

TopologyProxyDiscoveryTLSUsed when
Production / DockerTraefik v3.6Docker labels (auto)Edge NginxContainerized deploy
Native developmentlocal NginxStatic nginx.conf route tableNoneServices run on host 127.0.0.1:31xx

3. Component View (C4 L3) — Routing Decision

LayerTraefik sourceLocal Nginx source
Entrypointtraefik.yml entryPoints.web/.traefiklisten 80 default_server
RoutersDocker labels (auto-discovered)location /v1/api/<svc>/ blocks
Middlewaresmiddlewares.yml (file provider)shared proxy_set_header block
UpstreamsDocker network IPupstream <svc>_upstream { 127.0.0.1:31xx }
Catch-allportal router priority 1location /404 JSON

4. State Machines Index

N/A — the gateway manages no stateful entities. The only stateful runtime construct is the Traefik circuit breaker, whose state machine is documented in Resilience.

5. Runtime Scenarios

5.1 Standard REST request (production, Traefik)

5.2 Native-dev request (local Nginx)

5.3 Signal WebSocket upgrade

5.4 Portal health discovery

6. Crosscutting Concerns

ConcernHow the gateway handles it
AuthN/AuthZNone at gateway — JWT verified by each service (identity is issuer). Gateway only basic-auths the Traefik dashboard + portal.
TLSTerminated at edge Nginx, not Traefik (no HTTPS entrypoint in traefik.yml).
Rate limitingTraefik rate-limit (200/s) / rate-limit-auth (30/min), per-IP via ipStrategy.depth=1.
ResilienceTraefik circuit-breaker + active health checks. See Resilience.
LoggingTraefik JSON access logs; Authorization/Cookie dropped.
MetricsPrometheus on :8080. See Observability.
IDs / Soft-delete / i18nN/A — no datastore.

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.