System context
Sơ đồ này chỉ thể hiện actor và hệ thống ngoài được current source gọi trực tiếp.app/api/resident/portal/route.ts cung cấp API cho Resident Mini App. Handler lấy phiên cư dân từ bearer token trong production và gọi src/modules/resident-miniapp/resident-miniapp.ts để đọc dữ liệu theo liên kết căn hộ đã duyệt. Xem Tình trạng tính năng cho bản sửa nghiệp vụ chưa phát hành.
Runtime containers
Next.js UI và server handlers nằm trong cùng application build. Reminder dispatcher là command riêng; source không xác nhận automatic scheduler gọi command này.Trách nhiệm của từng lớp
Một request đọc dữ liệu đi qua đâu?
Một request ghi dữ liệu đi qua đâu?
/admin/mutatexử lý CRUD thông thường./admin/workflowxử lý bảng kê, phiếu thu, điều chỉnh và tiền thừa.- Membership, vehicle, RBAC, import và reminder có handler riêng.
generic không bảo đảm module được /admin/mutate cho phép. Handler vẫn là nơi enforcement cuối cùng.
RBAC và tenant enforcement
Authentication, authorization và tenant scope là ba bước riêng:src/modules/access/auth.tsđọc lại account, employee, tower assignments và permission groups cho mỗi authenticated request.src/modules/access/rbac.tschỉ quyết định route/action permission; các hàm này không tự thêm tenant filter.- Handler lấy
user.activeTowerIdvà truyền xuống repository hoặc domain service. createAdminRepository()thêm tower filter cho table cótower_id, ghi đè craftedtower_idkhi create và chặn update/delete chéo tower.- Specialized services phải tự giữ
towerIdtrong mọi query, mutation và relation lookup. - Không tìm thấy PostgreSQL Row-Level Security policy trong current source code.
Storage và integration đã quan sát
Deployment runtime
Dockerfile build ứng dụng bằng Node 24 Alpine. Runner cài production dependencies, copy .next, public, Prisma artifacts và chạy yarn start dưới user không phải root.
GitHub workflow hiện build image linux/arm64, push lên GHCR khi main thay đổi ở các path được cấu hình, rồi gọi action deploy CapRover.
Xem Database, Route handlers và Integrations cho từng runtime boundary.
Tìm code theo loại thay đổi
Tài liệu này không công bố hostname, token, secret hoặc giá trị deployment.