Skip to content

Workflow: Adding a New Page to Navigation

When you add new functionality (a new page/route) to the application, you must also register it in the Route Registry so it appears in the dynamic navigation menu.

Steps

  1. Identify the Route: Determine the path of your new page (e.g., /admin/my-new-feature).
  2. Define Metadata:
    • Subsystem: Which major area does it belong to? (General, Authentication, Communications, User Management, Administration, Property Management, Financial Management, Development).
    • Module: A logical grouping within the subsystem (e.g., "Blog Management").
    • Function: A unique identifier for this capability (e.g., blog_creation). EXISTING functions in roles.seed.json are preferred, or add a new one if distinct permission is needed.
    • Roles: Which roles need access? For prototyping, include sysadmin and god.
  3. Update route-registry.ts:

    • Open apps/platform/src/lib/rbac/route-registry.ts.
    • Locate the initializeDefaultRoutes method.
    • Add a new RouteMetadata object to the defaultRoutes array.
    {
      path: '/your/new/route',
      subsystem: 'Your Subsystem',
      module: 'Your Module',
      function: 'your_function_id',
      order: 100, // Adjust order as needed
      requiredRoles: ['admin', 'sysadmin', 'god', 'owner'], // Add relevant roles
      requiredPermissions: [], // Add specific permissions if needed
      i18n: { enabled: true, supportedLanguages: ['en', 'es'], fallbackLanguage: 'en' }
    },
    
  4. Verify:

    • Save the file.
    • Reload the application.
    • Ensure the new item appears in the sidebar menu under the correct section.