GebSecure Docs v0.1.0

Architecture · All ADRs

ADR 0001 — TypeScript monorepo with shared packages

Architecture decision record — status: Accepted.

Status: Accepted

Context#

GebSecure has several deployables (control-plane API, data-plane gateway, worker, console, CLI, SDKs) that must apply one security pipeline consistently. Divergent implementations of authentication, authorization or sanitization across services would be a security defect.

Decision#

  • One npm-workspaces monorepo. Node.js 22+, TypeScript (strict), ESM.
  • Domain logic lives in packages, never in apps: common, config, logger, crypto, db, net, policy, authz, risk, connector-sdk, connectors, core (services), http (server factory).
  • Apps are thin HTTP/worker shells over @gebsecure/core.
  • Packages are consumed as TypeScript source in development (tsx, vitest); apps are bundled with esbuild for production.
  • zod schemas are the single source of truth for validation and OpenAPI (npm run openapi).

Consequences#

  • (+) The gateway, API and worker share byte-identical security code.
  • (+) A single typecheck covers the whole platform.
  • (−) A breaking change in core affects every app at once (mitigated by the full test suite in CI).