Applications
Docs/Applications
Tài liệu sống được đồng bộ theo codebase hiện tại.

API App

API boundary chính của toàn hệ thống.

Vai trò

apps/apiAPI boundary chính cho Admin, SaaS dashboard và public renderer.

Stack

  • Hono
  • Bun runtime
  • Drizzle ORM
  • PostgreSQL

URL local

http://localhost:3001/api

Điểm quan trọng

  • Route mount phẳng dưới /api.
  • Swagger UI expose ở /api/docs.
  • docs/openapi.yaml là nguồn spec được API nạp để dựng Swagger UI.
  • Business logic nên nằm trong module sở hữu hoặc service/repository gần module, API app chỉ compose runtime và middleware.

Khi nào nên sửa ở API

  • Thêm route composition hoặc middleware chung.
  • Đổi response contract chung.
  • Thêm runtime guard, auth guard hoặc tenant scoping.
  • Mount route mới từ module manifest.