Loading…
Architecture overview
How the web worker, API worker, background worker, Postgres via Hyperdrive, conversation Durable Objects, and Effect capabilities fit together.
How the web worker, API worker, background worker, Postgres via Hyperdrive, conversation Durable Objects, and Effect capabilities fit together.
Loading…
The web, API, and background Workers share Postgres and the Effect services in
packages/capabilities. HTTP contracts live in packages/api; request logging
lives in packages/logger.
The web Worker calls capabilities in-process. External clients use the API
Worker. Both enforce the shared permission rules in packages/authz.
Capabilities select Postgres-backed Live adapters when a HYPERDRIVE binding exists and
in-memory Seed adapters otherwise. Local development uses persisted local Postgres;
Seed adapters let capability tests run without a Worker.
Private Assistant Conversations use one SQLite Durable Object in the web Worker for saved history and replay. Postgres owns directory identity, content permissions, deletion fences and shared Member admission; Effect owns model execution. The API and background Workers bind to the same host within their stage.
The background Worker consumes queues, handles Stripe webhooks, and runs scheduled reconciliation, email digests, and cleanup. Keeping this work outside page requests lets it retry independently. See Workers for the entry points.
Follow First business feature to add a workspace-owned resource through Postgres, Effect adapters, permissions, UI, and REST.