ADR-004: One process per node, dashboard as a static export
- Status: Accepted for the MVP
- Date: 2026-10-30
Decision
Section titled “Decision”Each node runs as a single Fastify process with clear internal modules: auth, agents, permissions, connections, messaging, tasks, approvals, actions, audit, events, and the outbox and receive workers.
The Next.js dashboard is built as a static export and served by the same process on the same origin as /v1.
The spec’s compose skeleton (§9) shows separate web and api services. They are merged here because:
- Spec §2 asks for a modular monolith, not microservices.
- A single origin keeps the session cookie
SameSite=Strict, makes the CSRF andOriginchecks exact, and lets the WebSocket share the session without CORS. - There is no Next.js server runtime to secure or patch.
The relay is a separate process because it is meant to be shared by many nodes and must stay ignorant of plaintext.
Consequences
Section titled “Consequences”- Dashboard pages are client components that call
/v1from the browser. There are no dynamic route segments; detail pages use query parameters. - In development,
next devproxies/v1to a running node (AGENTLINK_DEV_API). - The backend runs TypeScript through
tsxinstead of a bundle, which keeps the Docker build simple. Bundling is an optimisation for later.
Stelloz's source code is not public yet. An open source GitHub link may come later.