|
| 1 | +--- |
| 2 | +title: App Metadata |
| 3 | +description: Define application containers with navigation, branding, and access control |
| 4 | +--- |
| 5 | + |
| 6 | +# App Metadata |
| 7 | + |
| 8 | +An **App** is a logical container that bundles objects, views, pages, and dashboards into a cohesive application experience. It defines the navigation structure, branding, and access permissions. |
| 9 | + |
| 10 | +## Basic Structure |
| 11 | + |
| 12 | +```typescript |
| 13 | +const crmApp = { |
| 14 | + name: 'crm', |
| 15 | + label: 'CRM', |
| 16 | + version: '1.0.0', |
| 17 | + description: 'Customer Relationship Management', |
| 18 | + icon: 'briefcase', |
| 19 | + active: true, |
| 20 | + |
| 21 | + branding: { |
| 22 | + primaryColor: '#1a73e8', |
| 23 | + logo: '/assets/crm-logo.svg', |
| 24 | + favicon: '/assets/favicon.ico', |
| 25 | + }, |
| 26 | + |
| 27 | + navigation: [ |
| 28 | + { type: 'object', label: 'Accounts', objectName: 'account', icon: 'building' }, |
| 29 | + { type: 'object', label: 'Contacts', objectName: 'contact', icon: 'users' }, |
| 30 | + { type: 'object', label: 'Opportunities', objectName: 'opportunity', icon: 'trending-up' }, |
| 31 | + { type: 'dashboard', label: 'Sales Dashboard', dashboardName: 'sales_overview', icon: 'bar-chart' }, |
| 32 | + ], |
| 33 | + |
| 34 | + requiredPermissions: ['crm_access'], |
| 35 | +}; |
| 36 | +``` |
| 37 | + |
| 38 | +## App Properties |
| 39 | + |
| 40 | +| Property | Type | Required | Description | |
| 41 | +| :--- | :--- | :--- | :--- | |
| 42 | +| `name` | `string` | ✅ | Machine name (`snake_case`) | |
| 43 | +| `label` | `string` | ✅ | Display name | |
| 44 | +| `version` | `string` | optional | App version | |
| 45 | +| `description` | `string` | optional | App description | |
| 46 | +| `icon` | `string` | optional | App icon (Lucide/Material) | |
| 47 | +| `active` | `boolean` | optional | Is app active (default: `true`) | |
| 48 | +| `isDefault` | `boolean` | optional | Is default app | |
| 49 | +| `navigation` | `NavigationItem[]` | ✅ | Navigation tree | |
| 50 | +| `branding` | `AppBranding` | optional | Visual customization | |
| 51 | +| `requiredPermissions` | `string[]` | optional | Required permissions to access | |
| 52 | +| `homePageId` | `string` | optional | Custom home page ID | |
| 53 | +| `objects` | `string[]` | optional | Objects included in this app | |
| 54 | +| `apis` | `string[]` | optional | API endpoints included | |
| 55 | +| `mobileNavigation` | `object` | optional | Mobile-specific navigation | |
| 56 | + |
| 57 | +## Navigation Items |
| 58 | + |
| 59 | +The navigation tree supports five item types, combined to create rich menu structures: |
| 60 | + |
| 61 | +### Object Navigation |
| 62 | + |
| 63 | +Links to an object's list view: |
| 64 | + |
| 65 | +```typescript |
| 66 | +{ type: 'object', label: 'Accounts', objectName: 'account', icon: 'building', viewName: 'all_accounts' } |
| 67 | +``` |
| 68 | + |
| 69 | +### Dashboard Navigation |
| 70 | + |
| 71 | +Links to a dashboard: |
| 72 | + |
| 73 | +```typescript |
| 74 | +{ type: 'dashboard', label: 'Analytics', dashboardName: 'sales_overview', icon: 'bar-chart' } |
| 75 | +``` |
| 76 | + |
| 77 | +### Page Navigation |
| 78 | + |
| 79 | +Links to a custom page: |
| 80 | + |
| 81 | +```typescript |
| 82 | +{ type: 'page', label: 'Settings', pageName: 'app_settings', icon: 'settings', params: { tab: 'general' } } |
| 83 | +``` |
| 84 | + |
| 85 | +### URL Navigation |
| 86 | + |
| 87 | +Links to an external URL: |
| 88 | + |
| 89 | +```typescript |
| 90 | +{ type: 'url', label: 'Help Center', url: 'https://help.example.com', icon: 'help-circle', target: '_blank' } |
| 91 | +``` |
| 92 | + |
| 93 | +### Group Navigation |
| 94 | + |
| 95 | +Groups items into collapsible sections with children: |
| 96 | + |
| 97 | +```typescript |
| 98 | +{ |
| 99 | + type: 'group', |
| 100 | + label: 'Sales', |
| 101 | + icon: 'dollar-sign', |
| 102 | + expanded: true, |
| 103 | + children: [ |
| 104 | + { type: 'object', label: 'Accounts', objectName: 'account', icon: 'building' }, |
| 105 | + { type: 'object', label: 'Contacts', objectName: 'contact', icon: 'users' }, |
| 106 | + { type: 'object', label: 'Opportunities', objectName: 'opportunity', icon: 'trending-up' }, |
| 107 | + ], |
| 108 | +} |
| 109 | +``` |
| 110 | + |
| 111 | +### Common Navigation Properties |
| 112 | + |
| 113 | +All navigation items share these base properties: |
| 114 | + |
| 115 | +| Property | Type | Description | |
| 116 | +| :--- | :--- | :--- | |
| 117 | +| `id` | `string` | Unique identifier | |
| 118 | +| `label` | `string` | Display label | |
| 119 | +| `icon` | `string` | Icon name | |
| 120 | +| `visible` | `boolean \| string` | Visibility (boolean or expression) | |
| 121 | + |
| 122 | +## Branding |
| 123 | + |
| 124 | +Customize the visual appearance of the app: |
| 125 | + |
| 126 | +```typescript |
| 127 | +branding: { |
| 128 | + primaryColor: '#1a73e8', // Hex color code |
| 129 | + logo: '/assets/logo.svg', // Logo URL |
| 130 | + favicon: '/assets/icon.ico', // Favicon URL |
| 131 | +} |
| 132 | +``` |
| 133 | + |
| 134 | +| Property | Type | Description | |
| 135 | +| :--- | :--- | :--- | |
| 136 | +| `primaryColor` | `string` | Primary brand color (hex) | |
| 137 | +| `logo` | `string` | Logo image URL | |
| 138 | +| `favicon` | `string` | Favicon URL | |
| 139 | + |
| 140 | +## Mobile Navigation |
| 141 | + |
| 142 | +Configure mobile-specific navigation behavior: |
| 143 | + |
| 144 | +```typescript |
| 145 | +mobileNavigation: { |
| 146 | + mode: 'bottom', |
| 147 | + bottomNavItems: ['home', 'accounts', 'contacts', 'settings'], |
| 148 | +} |
| 149 | +``` |
| 150 | + |
| 151 | +## Complete Example |
| 152 | + |
| 153 | +```typescript |
| 154 | +const projectApp = { |
| 155 | + name: 'project_management', |
| 156 | + label: 'Project Management', |
| 157 | + version: '2.0.0', |
| 158 | + description: 'Track projects, tasks, and team workload', |
| 159 | + icon: 'folder-kanban', |
| 160 | + active: true, |
| 161 | + |
| 162 | + branding: { |
| 163 | + primaryColor: '#6366f1', |
| 164 | + logo: '/assets/pm-logo.svg', |
| 165 | + }, |
| 166 | + |
| 167 | + navigation: [ |
| 168 | + { |
| 169 | + type: 'page', |
| 170 | + label: 'Home', |
| 171 | + pageName: 'pm_home', |
| 172 | + icon: 'home', |
| 173 | + }, |
| 174 | + { |
| 175 | + type: 'group', |
| 176 | + label: 'Projects', |
| 177 | + icon: 'folder', |
| 178 | + expanded: true, |
| 179 | + children: [ |
| 180 | + { type: 'object', label: 'Projects', objectName: 'project', icon: 'folder' }, |
| 181 | + { type: 'object', label: 'Tasks', objectName: 'project_task', icon: 'check-square', viewName: 'task_board' }, |
| 182 | + { type: 'object', label: 'Milestones', objectName: 'milestone', icon: 'flag' }, |
| 183 | + ], |
| 184 | + }, |
| 185 | + { |
| 186 | + type: 'group', |
| 187 | + label: 'Reports', |
| 188 | + icon: 'bar-chart', |
| 189 | + children: [ |
| 190 | + { type: 'dashboard', label: 'Overview', dashboardName: 'project_overview', icon: 'layout-dashboard' }, |
| 191 | + { type: 'dashboard', label: 'Team Workload', dashboardName: 'team_workload', icon: 'users' }, |
| 192 | + ], |
| 193 | + }, |
| 194 | + { |
| 195 | + type: 'url', |
| 196 | + label: 'Documentation', |
| 197 | + url: 'https://docs.example.com/pm', |
| 198 | + icon: 'book-open', |
| 199 | + target: '_blank', |
| 200 | + }, |
| 201 | + ], |
| 202 | + |
| 203 | + requiredPermissions: ['pm_access'], |
| 204 | + homePageId: 'pm_home', |
| 205 | +}; |
| 206 | +``` |
| 207 | + |
| 208 | +## Related |
| 209 | + |
| 210 | +- [Page Metadata](./page) — Custom pages referenced from navigation |
| 211 | +- [Dashboard Metadata](./dashboard) — Dashboards referenced from navigation |
| 212 | +- [View Metadata](./view) — Views displayed within navigation items |
| 213 | +- [Permission Metadata](./permission) — Access control for apps |
0 commit comments