Skip to main content

Architecture Overview

The SeptemCore Platform-Kernel is a polyglot, industry-agnostic modular backbone built for long-horizon B2B2B SaaS products. Its architecture rests on three guarantees:

  • Single entry point — every external request, regardless of source, passes through one API Gateway before touching any domain service.
  • Protocol translation — the public contract is REST/OpenAPI; internal communication is gRPC. Clients are decoupled from service topology.
  • Primitive composition — seven orthogonal primitives (Auth, Data, Events, Notify, Files, Money, Audit) cover 100 % of module needs without placing any business logic in the kernel.

C4 Level 1 — System Context


Service Inventory

The kernel ships 15 Go backend services and 22 TypeScript packages in a single polyglot monorepo (Go workspace + pnpm workspace + Bazel).

LayerTechnologyServices / Packages
Frontend hostVite 8 · React 19 · Module Federation 2.0ui-shell
GatewayEnvoy Gateway · Go net/http · chi routergateway
Core primitivesGo · gRPC · OpenAPI 3.1.0iam, data-layer, event-bus, notify, files, money, audit
Platform servicesGobilling, module-registry, integration-hub, domain-resolver, kernel-cli
Shared libsGoshared/crypto, shared/mtls, shared/flags, vault
SDKTypeScript strictsdk-auth, sdk-data, sdk-events, sdk-notify, sdk-files, sdk-money, sdk-audit, sdk-flags, sdk-core, sdk-ui, sdk-testing, sdk-codegen

Protocol Translation: REST ↔ gRPC

important

All REST endpoints visible at https://api.septemcore.com/v1/... are owned by the API Gateway. No Go service exposes REST directly. The Gateway performs full protocol translation:

Client (REST) → Envoy Gateway (L7 proxy) → Go Gateway Service → gRPC → Domain Service

Client (REST) ← Envoy Gateway ← Go Gateway Service ← gRPC response

This two-layer design gives you:

  • OpenAPI request/response validation before any business logic runs.
  • Circuit breakingsony/gobreaker per-service: 5 errors / 30 s → OPEN 30 s → HALF_OPEN.
  • Retry safety — single GET retry with 100 ms backoff; POST/PATCH/DELETE no-retry (idempotency via Idempotency-Key).
  • Deadline enforcement — gRPC deadline 5 s (GRPC_CALL_TIMEOUT_MS); timeout → 504 Gateway Timeout.

Inter-Service Communication

Protocol key:

ProtocolUse case
gRPC (unary RPCs)Gateway → core domain services. Typed contracts via Protobuf.
KafkaAsync domain events. Eight topics: platform.{domain}.events. Partition key: entityId.
RabbitMQTransactional task queues — notify.outgoing.{tenantId}, Integration Hub retries.
HTTPServices without a gRPC contract (Notify, Files, Money, Audit in current phase).
WebSocketReal-time delivery from Notify Service directly to browser. The only service clients connect to outside the Gateway.
mTLS (Istio)All inter-service traffic is mutually authenticated at the transport layer.

Storage Architecture

StoreTechnologyPrimary consumers
OLTPPostgreSQL 17 + Row-Level SecurityIAM, Data Layer, Money, Billing, Notify, Files, Module Registry, Integration Hub
OLAPClickHouseAudit (hot 90 d), Data Layer analytics
CacheValkeyGateway (permissions, rate limit), Money, Event Bus, Notify (WS replay buffer)
ObjectS3-compatible (SeaweedFS / AWS S3)Files, Audit cold archive (S3 Glacier), Module bundles
SecretsHashiCorp VaultJWT signing keys, TLS certificates, field-level DEKs

CDC Pipeline

PostgreSQL (WAL) → Debezium → Kafka → ClickHouse

Latency: < 5 s. Guarantee: at-least-once. Deduplication: ReplacingMergeTree + FINAL.


Middleware Chain (Gateway)

Every inbound request traverses this ordered chain before reaching any domain service:

Recoverer → RequestID → RealIP → Logging → CORS → JWT Auth
→ Rate Limiting (local token-bucket + Valkey sliding window)
→ OpenAPI Validation → Tenant-Module Check → gRPC Proxy
note

The Tenant-Module Check step rejects requests for modules not installed for the requesting tenant (404 Not Found) before any downstream call is made. The module's existence is not disclosed to unauthorised callers.


Observability

SignalTechnology
MetricsOpenTelemetry → VictoriaMetrics
Logsslog (structured JSON)
TracesOpenTelemetry — Trace ID propagated on every gRPC and HTTP hop
Health/live, /ready, /health exposed by every service

Polyglot Stack — Quick Reference

RuntimeVersionRole
Go1.24All backend services
Node.js24 LTSSDK packages, UI Shell, build tooling
TypeScript5.8SDK, UI Shell, Docusaurus
Rust / Wasm1.87 (stable)Module sandbox isolation layer
Docker Desktop4.70.0 (Engine 28.1)Local development environment
pnpm10.33TypeScript monorepo package manager