Hopp til innhold
PraxisLogg inn
Kunnskapsseksjoner

Architecture overview

How the web worker, API worker, background worker, D1, and Effect capabilities fit together.

architecturecloudflareeffect
På denne siden

The web, API, and background Workers share D1 and the Effect services in packages/capabilities. HTTP contracts live in packages/api; request logging lives in packages/logger.

Forespørselstopologi for B2B SaaS StarternettleserHTTP clientMCP-klientkøjobberwebTanStack StartapiREST + MCPbackgroundqueue consumerpackages/capabilitiesD1QueuesEmail

The web Worker calls capabilities in-process. External clients use the API Worker. Both enforce the shared permission rules in packages/authz.

Capabilities select D1-backed Live adapters when a DB binding exists and in-memory Seed adapters otherwise. Local development uses persisted local D1; Seed adapters let capability tests run without a Worker.

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.