Documentation
Admin

Add Admin Section

How to add a new admin section using the compact AI context guide.

AI Skill for admin tasks

Prompt: Type /admin-tasks in your Copilot / Cursor or other chat to use skill with the provided context.
/admin-tasks Create admin section [name] with list/create/edit pages.

Requirements:
- Use DataTable (row select + batch delete).
- Use FormBuilder forms.
- Use shared confirm dialog.
- Wire links, sidebar, and oRPC router.

Required Outputs

When adding a section, ensure these are updated:

  1. src/config/links.ts
  2. src/features/admin/common/config/navigation.ts
  3. src/features/admin/<section>/model/*.schema.ts
  4. src/features/admin/<section>/service/*.service.ts
  5. src/features/admin/<section>/api/*.router.ts
  6. src/lib/orpc/router.ts
  7. src/features/admin/<section>/components/*-table.tsx
  8. src/features/admin/<section>/components/*-editor.tsx
  9. src/app/[locale]/(admin)/admin/<section>/{page,create,[id]/edit}

Validation

Always run:

pnpm typecheck && pnpm lint

Important Notes

  • Use useAdminConfirmDialog for destructive confirmations.
  • Keep URL/query state in tables with useQueryStates.
  • Keep form logic in FormBuilder/useFormBuilder.
  • Keep changes scoped and consistent with existing admin patterns.

On this page