Vai trò
apps/api là API 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.yamllà 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.