Skip to content
Fortspace Docs
Esc
↑↓navigate↵open⌘Jpreview
On this page

Architecture

How the Fortspace company hub is put together: components, tenancy, identity, the control plane, data and infrastructure.

Fortspace is a B2B SaaS “company hub” for European SMBs: chat, calls, mail, storage, and later an office suite, sold on data sovereignty (EU residency, per-tenant isolation, instant erasure). It is assembled from open-source components behind one identity provider and one control plane.

This folder is the architecture baseline. It consolidates the exploration in discussions/ (in the main repo), the go-meet prototype, and the draft deployment/ stacks, and applies four decisions made after those discussions:

# Decision Replaces
D1 The control plane is TypeScript (Node) Go control plane in the discussions
D2 Infisical is shared, tenants separated by project per trust scope + machine identity Infisical per tenant (too heavy)
D3 Zitadel, one multi-tenant instance, one organization per tenant Keycloak
D4 One isolated Coolify project per tenant + a shared fortspace-platform project (confirmed from discussions)

Reading order

Doc Covers Diagram(s)
01 System architecture Components, planes, status, request paths 01-system-overview
02 Tenancy & isolation What is shared vs per tenant, and why 02-tenancy-isolation
03 Identity & access Zitadel model, login flow, claims, authorization 03-identity-flow
04 Control plane TS modules, data model, APIs, jobs, reconciliation 04-control-plane
05 Tenant lifecycle Provisioning saga, offboarding, shards 05-tenant-provisioning
06 Calls (go-meet + LiveKit) Token broker, webhooks, recording pipeline 06-call-flow, 07-recording-pipeline
07 Chat & integration Matrix/Tuwunel, call↔chat coupling 08-chat-meet-integration
08 Data, storage & secrets Postgres sharding, RustFS, Infisical, keys 09-data-secrets-keys
09 Infrastructure Coolify, frp, Traefik, Pulumi, networking 10-infrastructure-topology
10 Security & operations Threat model, GDPR, backup, observability —
11 Decisions & open questions ADRs, corrections to the discussions, unknowns —
12 Runbook: base infrastructure Bring-up procedure, manual steps, operating, troubleshooting —
13 Tenant hosts under one domain ADR-035: slugs, cookies and same-site threats, PSL, certificates and DNS —

Diagrams are Excalidraw sources in diagrams/ (.excalidraw, open at excalidraw.com or in the editor extension) with rendered .png alongside. Edit the source, re-render, commit both.

Design principles

  1. Isolate the data layer hard, share the stateless layer. Chat history, meeting metadata, recordings and caches live in per-tenant resources. Identity, media routing and orchestration are shared and hold no tenant content.
  2. Authorization is enforced by the owner of the data, not inferred from names. LiveKit tokens, S3 credentials and DB roles are minted per tenant and scoped as tightly as each system allows.
  3. Everything is idempotent and reconcilable. Provisioning is a resumable saga; drift is detected by a loop, not by hope.
  4. The orchestrator is replaceable. Coolify specifics stay behind an adapter; the tenant record stores generic references only.
  5. Short-lived credentials over long-lived ones. LiveKit tokens, presigned URLs and machine-identity tokens expire in minutes to hours.
  6. Env vars over hardcoded values; secrets never in git or in Postgres in the clear.
  7. Sovereignty is a feature. Component choices favor EU-hostable, open-source software (Apache-2.0 / AGPL-aware).

Glossary

Term Meaning
Tenant One customer company. Maps to one Zitadel org, one Coolify project, one bucket, one DB, one Infisical project.
Slug Immutable DNS-safe tenant identifier (^[a-z][a-z0-9-]{1,30}$), used in hostnames, room-name prefixes, bucket names.
Shared plane fortspace-platform Coolify project: Zitadel, control plane, Infisical, LiveKit, RustFS, core Postgres/Redis.
Tenant plane Per-tenant Coolify projects (fortspace-tenant-<slug>) plus the fortspace-data-pool of Postgres shards.
Control plane (CP) TypeScript service owning tenant state, provisioning, the LiveKit token broker and the webhook router.
Token broker CP module that signs LiveKit tokens scoped to an exact room for a verified tenant.
Shard A Postgres node (+ PgBouncer) hosting several tenant databases.
Saga The ordered, compensatable provisioning workflow.
Module An optional product in a tenant stack (meet, chat, mail, …).

Component status (2026-11)

The base infrastructure is up on prod (fortspace.eu, Pulumi project base in bastion/); how it was brought up and how to operate it is 12.

Component State Notes
Base stack (bastion/) running on prod Coolify projects fortspace-platform + fortspace-data-pool; single prod stack; runbook 12
Zitadel (+ login v2) running (v4.20.6, issuer id.<domain>) MFA enforced; operator + superadmins; replaces Keycloak
Infisical running (shared, v0.167) projects fortspace-platform / fortspace-broker; mail via Mailpit
Control plane + cockpit running (prototype, image pinned by sha- tag) api api.<domain>, cockpit cockpit.<domain>; no tenant provisioned on prod yet
LiveKit + Egress running (single node, behind frp, public 7885/7886) webhook → CP router; the media path and a real call are not verified on prod
PostgreSQL / Redis running (core; TLS on) the tenant shard pool is empty until shard.add
RustFS running (s3. + OIDC-only console storage.) SSE and per-tenant keys still open (Q-07)
Mailpit running, optional OIDC login in front temporary until the prod EU SMTP relay (ADR-023)
go-meet prototype, source-level complete for most Meet API staging acceptance pending; callbacks/files partly stubbed
Keycloak compose draft deprecated, replaced by Zitadel
Tuwunel (Matrix) planned see 07 and ADR-002
Stalwart, Bulwark, Euro-Office, files future extension points only
Backups, alerting, reconciler not built see 10

Was this page helpful?