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

Runtime Surfaces

Admin, SaaS, Renderer, API và cách chúng nối với nhau.

Surface chính

SurfaceAppNgười dùng chínhMục tiêu
Platformapps/adminplatform operatorquản trị hệ thống, support, modules
Tenantapps/saastenant operatorquản trị workspace, website, members
Publicapps/renderervisitor websiterender website theo domain
APIapps/apimọi surface còn lạibusiness boundary trung tâm

Dòng chảy chuẩn

  1. UI hoặc renderer gọi apps/api.
  2. API resolve auth + runtime context.
  3. API gọi service/repository theo module ownership.
  4. Response quay về đúng surface.

Điều không nên làm

  • Không dùng frontend để tự xử lý data isolation.
  • Không để apps/admin host tenant surface như một chế độ phụ.
  • Không dùng platform role để thay tenant membership.