Skip to main content

Backend architecture

apps/api is Hono on Cloudflare Workers. Global middleware establishes request identity, security headers, sanitized logs, CORS, and request-scoped composition. Protected SST routes then apply authentication, synthetic-environment guard, company context, hierarchy filtering, and unit scope where needed.

Handlers parse HTTP input, invoke core use cases, and format responses. Vendor dependencies enter through ports and adapters rather than domain imports.