feat: introduce comprehensive API documentation and RBAC guidelines

- Added a new `api.md` file detailing the TrackGo HTTP API, including agent rules, authentication mechanisms, and global HTTP contracts.
- Established a new RBAC (Role-Based Access Control) framework in `web-rbac.mdc` to ensure all product modules in `apps/web` are gated by permissions from `GET /auth/me`.
- Updated security and web module architecture rules to incorporate RBAC requirements, ensuring consistent application of permissions across modules.

This commit enhances the project's API clarity and security by providing a structured approach to user permissions and interactions.
This commit is contained in:
shancheas
2026-08-25 19:14:39 +07:00
parent a5a42cf87e
commit 44b0ef0168
4 changed files with 1010 additions and 0 deletions
@@ -52,6 +52,7 @@ Copy `example/full-page` — do not invent a third layout style.
3. **Domain factory** — singleton service via `apiClient` from `src/core/lib/api-client` (never raw axios).
4. **i18n** — `useEnterpriseModuleTranslationContext()`; module keys unprefixed; shared via `common:` / `nav:`.
5. **Navigation** — `useEnterpriseModuleNavigationContext()` helpers, not ad-hoc paths.
6. **RBAC** — `moduleKey` must match an `api.md` privilege-keys `code`; the menu leaf uses the same `moduleKey`. See `web-rbac.mdc`.
## Layer rules