Contributor guide
Everything a developer needs to change Workspace with confidence, from the system's shape down to the tables and the first pull request.
This section is for developers who want to work on Workspace itself: fix a bug, add a feature, or understand why something is built the way it is. Read it in order the first time; afterwards each page stands on its own.
The system in one paragraph
Workspace is one company per installation. A Next.js 15 web app (the UI and a backend-for-frontend) sits in front of one Node 22 server process that hosts nine modules: gateway, identity, platform, chat, work, home, employee, ai and search. Each module owns a folder, a Postgres schema and login role, its migrations and an HTTP API. Modules never import each other's code: they call each other's API in memory, as the caller, or react to events delivered from a transactional outbox. Caddy, the app container and Postgres are the whole deployment.
Reading order
1. System design
Containers, the nine modules, data and messaging, and the five rules.
2. Request path and security
Sessions, the gateway, principals and scopes, the AI gateway.
3. Code structure
Where everything lives and the anatomy of a module.
4. Database design
Schemas and roles, migrations, ids and codes, the core tables.
5. Events
Outbox, relay, consumer groups, idempotency, dead letters.
6. Agent workflows
Workflows, runs, runners, approvals and questions.
7. Your first change
A feature end to end, the tests to write and the checks CI runs.
The non-negotiables
Every pull request is read against these. They are also in AGENTS.md, which coding agents read first.
- Every feature works without AI. Generative endpoints answer
503 ai_not_configuredand the UI hides them. - No SaaS concepts. No billing, plans, trials, seat limits or platform admin.
- One workspace. No workspace column, row-level security or workspace id anywhere; a second company is a second installation (ADR-0023).
- Fast and light. Route JavaScript budgets are gated in CI; heavy client code loads on demand.
- Chat and tasks are the product. Docs, whiteboards, calendar, time and AI can be left out with
DISABLED_FEATURES, and every screen must still make sense without them (ADR-0026).
Running it from source
You need Node.js 22, pnpm 10 (corepack enable) and Docker with Compose v2.
pnpm install
cp .env.example .env
pnpm infra:up # Postgres, S3 (SeaweedFS), LiveKit
pnpm build:packages # once per clone, and after changing backend/packages
pnpm migrate
pnpm dev:server # every backend module in one process, :4000
pnpm --filter @workspace/web dev # http://localhost:3000, in a second terminalCreate the company at /setup, then fill it with realistic data (people, departments, projects, tasks, documents,
meetings, chat and eight weeks of AI history):
SEED_OWNER_EMAIL=<owner e-mail> SEED_OWNER_PASSWORD=<owner password> pnpm seed:demoWhere the full reference lives
The pages here orient you and show how the parts fit. The repository is the source of truth and goes deeper: system design, database (one page per schema, every table), events and the generated event catalog, and the architecture decision records. When a page here and the code disagree, the code is right and the page has a bug: please open an issue.
Plantilla de política de uso de IA
Una política de uso de IA de una página para pymes: herramientas aprobadas, datos que nunca entran en una IA, responsabilidad sobre el resultado y qué se registra.
System design
Three containers, one server process hosting nine modules, and one Postgres database with a schema per module.