Mô hình hiện tại
Repo dùng module phẳng modules/*. Không phát triển tiếp theo hướng một module lớn core hoặc saas gom nhiều trách nhiệm.
Nhóm nền tảng chính
| Module | Trách nhiệm |
|---|---|
modules/auth | Đăng nhập, session, token, auth services |
modules/users | Admin users, SaaS users, profile, user security |
modules/permissions | Platform RBAC, role, permission, interface type |
modules/organizations | Organization và membership cấp organization |
modules/workspaces | Workspace, workspace membership, bootstrap context |
modules/sites | Website, domain, public runtime resolver |
modules/billing | Plan, subscription, pricing |
modules/enablement | Workspace module enablement, quota, entitlement |
modules/registry | Registry module và installation state |
modules/themes | Theme metadata và website theme mapping |
Quy tắc ownership
- Module sở hữu schema, relations, seed, API route và UI surface liên quan đến nghiệp vụ của nó.
packages/db-kitsở hữu DB runtime/helper chung.packages/module-contractssở hữu contract manifest/module shared.packages/authsở hữu JWT/helper dùng chung.- Không thêm alias hoặc dependency mới trỏ lại
modules/corehoặcmodules/saas.
Khi mở rộng
Tạo hoặc hoàn thiện module theo contract hiện tại: db, api, admin, saas, shared, README.md, rồi chạy bun run packages/cli/src/index.ts module:check.