3 Context and Scope

Business Context

Nebu is a self-hosted, Matrix-compatible enterprise chat server. It replaces Slack/Teams for organizations requiring data sovereignty. The system boundary is a single Nebu instance (one operator deploys it for their organization). No federation means no cross-instance communication at the protocol level.

External actors:

ActorInterfaceProtocol
Matrix clients (Element, FluffyChat, Cinny, …)Matrix Client-Server APIHTTPS / WSS, TLS 1.3
OIDC identity provider (Keycloak, Azure AD, Dex, Google)OIDC Authorization Code + PKCEHTTPS
Operator (admin UI)Admin web UI + Admin APIHTTPS, session cookie
Monitoring systems (Prometheus, Grafana)/metrics endpointHTTP
Compliance officerAdmin UI + Compliance APIHTTPS, JWT + session

System Context Diagram

  ┌──────────────────┐          ┌──────────────────────────────────────────┐
  │  Matrix Clients  │◄────────►│           Nebu Instance                  │
  │  Element, Cinny  │  HTTPS   │                                          │
  │  FluffyChat, …   │  TLS 1.3 │  ┌────────────────┐  ┌────────────────┐ │
  └──────────────────┘          │  │  Go Gateway    │  │  Go Media GW   │ │
                                │  │  (stateless)   │  │  AES-256-GCM   │ │
  ┌──────────────────┐          │  └───────┬────────┘  └────────────────┘ │
  │  OIDC Provider   │◄────────►│          │ gRPC                          │
  │  Keycloak / Dex  │  OIDC    │  ┌───────▼────────────────────────────┐ │
  │  Azure AD        │          │  │  Elixir/OTP Core                   │ │
  └──────────────────┘          │  │  Horde · ETS · pg groups           │ │
                                │  └───────┬────────────────────────────┘ │
  ┌──────────────────┐          │          │ PostgreSQL protocol           │
  │  Admin / Ops     │◄────────►│  ┌───────▼────────────────────────────┐ │
  │  Browser UI      │  HTTPS   │  │  PostgreSQL 16+                    │ │
  │  Prometheus      │  HTTP    │  │  event log · audit · migrations    │ │
  └──────────────────┘          │  └────────────────────────────────────┘ │
                                └──────────────────────────────────────────┘

Technical Context

Internal communication boundaries:

BoundaryProtocolDirection
Go Gateway → Elixir CoregRPC (TLS in prod)Bidirectional; streaming EventBus + unary fallback
Elixir Core → PostgreSQLPostgreSQL wire protocol (TLS)Read/Write for business logic
Go Gateway → PostgreSQLPostgreSQL wire protocol (TLS)Migrations + message_buffer + admin sessions
Go Media → PostgreSQLPostgreSQL wire protocol (TLS)Media keys storage

Not in scope (explicit exclusions):

  • /_matrix/federation/* - no Server-Server API
  • /_matrix/identity/* - no identity server
  • /_matrix/key/* - no key server for federation
  • E2EE key distribution (keys/upload acknowledged as stubs; no real E2EE in MVP)

Source: _bmad-output/planning-artifacts/architecture.md, §Context, §Architektur-Grenzen; README.md, §Architecture