Version 3 of the kit: - Radix UI replaced with Base UI (using the Shadcn UI patterns) - next-intl replaces react-i18next - enhanceAction deprecated; usage moved to next-safe-action - main layout now wrapped with [locale] path segment - Teams only mode - Layout updates - Zod v4 - Next.js 16.2 - Typescript 6 - All other dependencies updated - Removed deprecated Edge CSRF - Dynamic Github Action runner
36 lines
1.7 KiB
Markdown
36 lines
1.7 KiB
Markdown
# Feature Packages
|
|
|
|
## Packages
|
|
|
|
- `accounts/` — Personal account management
|
|
- `admin/` — Super admin functionality
|
|
- `auth/` — Authentication features
|
|
- `notifications/` — Notification system
|
|
- `team-accounts/` — Team account management
|
|
|
|
## Non-Negotiables
|
|
|
|
1. ALWAYS use `createAccountsApi(client)` / `createTeamAccountsApi(client)` factories — NEVER query tables directly if methods exist
|
|
2. NEVER import `useUserWorkspace` outside `app/home/(user)` routes
|
|
3. NEVER import `useTeamAccountWorkspace` outside `app/home/[account]` routes
|
|
4. NEVER call admin operations without `isSuperAdmin()` check first
|
|
5. ALWAYS wrap admin pages with `AdminGuard`
|
|
6. ALWAYS use `getLogger()` from `@kit/shared/logger` for structured logging — NEVER `console.log` in production code
|
|
7. NEVER bypass permission checks when permissions exist — use `api.hasPermission({ accountId, userId, permission })`
|
|
|
|
## Key Imports
|
|
|
|
| API | Import |
|
|
| ----------------- | ----------------------------------------------------- |
|
|
| Personal accounts | `createAccountsApi` from `@kit/accounts/api` |
|
|
| Team accounts | `createTeamAccountsApi` from `@kit/team-accounts/api` |
|
|
| Admin check | `isSuperAdmin` from `@kit/admin` |
|
|
| Admin guard | `AdminGuard` from `@kit/admin/components/admin-guard` |
|
|
| Logger | `getLogger` from `@kit/shared/logger` |
|
|
|
|
## Exemplars
|
|
|
|
- Server actions: `packages/features/accounts/src/server/personal-accounts-server-actions.ts`
|
|
- Workspace loading: `apps/web/app/[locale]/home/(user)/_lib/server/load-user-workspace.ts`
|
|
- Team policies: `packages/features/team-accounts/src/server/policies/policies.ts`
|