Implementation
Server and provider boundaries
Treat backend foundations as separate integration work rather than inferred behavior from the frontend prototype.
On this page
Boundary
| Area | Source foundation | Frontend evidence |
|---|---|---|
| Authentication/tenancy | TenantContext and transaction-scoped RLS | No tenant-facing auth persistence connected to captured UI. |
| Outbound email | queueReply writes message/recipients/job atomically | sendReply only adds a local message and Waiting state. |
| Inbound email | Bearer-authenticated Brevo webhooks and worker routing | Sample messages imported from mock-data. |
| Attachments | Private B2 and quarantine/availability pipeline | Fixed filename metadata, no transfer. |
| Delivery | Provider event reconciliation | Fixture statuses and local retry. |
| Domains | Server-only domain setup/provider foundation | Sample wizard and static readiness. |
| Billing | Stripe Checkout/portal and webhook projection | Static annual plan/history and toast actions. |
| Kit | UI mapping and sample contact context | OAuth/live sync not demonstrated. |
Implementation guidance
Future authenticated routes must establish trusted workspaceId/userId and enforce inbox access before calling server-only modules. Do not copy browser scope into trusted tenancy. Keep internal thread recipients separate from external provider delivery. Provider acceptance and actual delivery are distinct states.
The infrastructure architecture and runbook are useful source context, but this documentation does not certify the deployment, database roles, provider configuration or worker reliability. No network account checks or provider writes are part of the capture workflow.
Source references
| File | Responsibility |
|---|---|
| helpdesk-notes/Infrastructure Architecture.md | Architecture and explicit deferred auth |
| lib/server/email/outbound.ts | Trusted outbox producer |
| lib/server/billing/summary.ts | Future owner-only summary |
| helpdesk-notes/Email Domain Infrastructure.md | Domain design |
| helpdesk-notes/Billing Infrastructure.md | Billing status authority |
Reference downloads
Related topics
Source audit: 2026-10-08 · Revision 10f45d1377b5 · Documentation v1.0.0