Register an app
Goal
Put an app in the public.apps registry so it appears in navigation, mounts at a route, and renders — either by the generic renderer (schema-driven) or by your own code (custom/apps/<slug>/).
Two decisions up front:
- Renderer —
generic(platform draws list/detail pages from each type'sdesign_schema.views) orcustom(yourindex.tsxdraws everything).noneregisters data/types with no UI. Mount point (
route_prefix) — where the app lives in the URL space:/my-app(default),/(site root), or a nested prefix. See Mounting for the full rules — the short version:Mount Effect /my-app(default)App owns /my-app/*. Safe default./App owns /*; renders at/for non-admins. One app only — must render its own not-found for unknown paths./crm/salesNested; longest-prefix-first. Works, rarely needed.
Steps
Option A — scaffold a custom app
npx spine-framework create-app <slug>Creates custom/apps/<slug>/ (manifest.json + index.tsx + components/) and inserts the apps row with renderer: 'custom' and route_prefix: /<slug> (.framework/cli/commands/create-app.ts).
Then edit custom/apps/<slug>/manifest.json — set route_prefix, required_roles, nav_items, and routes. Sync to the DB:
npx spine-framework update-db-app <slug>Option B — register a generic app
Generic apps are registry rows plus nav items — no app directory is needed (the shell renders from type schemas):
- Ensure every type the app will serve has complete
design_schema—fields,views.default_list,views.default_detail(see Design schema). Create the
appsrow — via the admin UI (Admin → Apps → New) or the API:await apiFetch('/api/apps?action=create', { method: 'POST', body: JSON.stringify({ slug: 'taskboard', name: 'Taskboard', renderer: 'generic', route_prefix: '/taskboard', min_role: 'member', is_active: true, nav_items: [ { title: 'Tasks', path: '/taskboard/tasks', type_slug: 'task', order: 1 } ] }) })nav_itemsentries carryingtype_slug(and optionalview) get generated list/detail/new routes. Omitviewto usedefault_list+default_detail— a nav item cannot pick list and detail views independently (manifest reference).- Log out/in (or refresh) so the registry reloads.
Option C — install a packaged app
npx spine-framework install-app <package>The package's manifest.json declares route_prefix and everything else — see Package and install an app.
Verify
GET /api/apps?action=get&slug=<slug>returns the row with yourroute_prefix,renderer,nav_items.- Navigating to
<route_prefix>renders the app (generic: list page; custom: yourindex.tsx). For/, members land on it directly;system_adminstill lands on/spine-framework/admin. useAppPath-built links inside the app resolve correctly at the chosen mount point.
Common mistakes
- Two apps mounted at
/— both compile to/*; ordering silently decides which renders. The registry won't stop you; don't do it. - Root app with no internal not-found — a
/-mounted/*shadows the global*route; unmatched paths inside the app show blank/error instead of your 404. Add<Route path="*" element={...}>in the app's routes. - Hardcoded paths —
navigate('/tasks')orto="/tasks"escapes a directory-mounted app. UseuseAppPath()from@core/hooks/useAppPathor relative routes. nav_itemsabsolute paths missing the prefix —/tasksnavigates outside the app and 404s. Use either/taskboard/tasks(absolute incl. prefix) ortasks(relative — the shell prefixes it).- Expecting public access —
is_public/auth_requiredexist on the manifest but are not wired into the unauthenticated router; every app is behind login. - Generic app, thin schema —
renderer: 'generic'with types lackingviews.default_list/default_detailrenders "No schema available."
Reference
- Apps and renderers — mounting model, role gating, renderer semantics
- Apps — the registry entity page
- App manifest reference — every manifest field incl.
route_prefix,nav_items,registration - Build a custom page · Frontend SDK —
useAppPath,apiFetch