Skip to content
Packages

Typed API Gateway Boundary

类型化 API 网关边界

The Hono backend owns request context, security middleware, tenant extraction, idempotency, usage metering, route groups, OpenAPI generation, and async Inngest jobs.

1 backend, 137 source files and 70 test files in backends/gateway. · Source ↗ · Docs ↗

Request-to-contract path

Route code is the visible part; the hard boundary is the ordered policy chain before and around it.

  • requestContexttrace IDs, correlation, dependency injection
  • security + rateLimitheaders, dynamic CORS, token buckets
  • tenant + idempotencytenant extraction, mutation dedupe
  • route groupsadmin, ai, billing, events, legal, webhooks
  • OpenAPI + Inngesttyped clients and background sync jobs

What it owns

  • BFF routing, OpenAPI generation, middleware order, and tenancy extraction
  • Gateway-level rate limiting, idempotency, audit logging, and versioning
  • Typed API contracts consumed by web and generated clients

Where it stops

  • Backend policy lives in middleware, not duplicated in each route.
  • Apps do not bypass the gateway for tenant-sensitive operations.

How we know it works

  • OpenAPI generation, gateway route tests, and release verification scripts
  • api-reference docs and dashboard typed-client integration