Skip to content

Shared vs Role-Based Pages

Decision

Default to shared feature pages and gate by permissions.

Use shared pages when

  • multiple roles use same workflow
  • only action visibility differs

Use role pages when

  • workflow/semantics are genuinely role-specific
  • dashboard or operational flow is unique to one role

Current state

  • Shared: users management, system pages, shared account pages
  • Role-specific: role dashboards (admin/hod/developer/employee)

Shared page structure

  • Use folder-per-page for shared features to keep files bounded and predictable:
    • list/index.tsx
    • detail/index.tsx
    • create/index.tsx
  • Keep each page skeleton local (list/skeleton.tsx, detail/skeleton.tsx, create/skeleton.tsx) so loading states match that page only.