Scaffolding apps with AppUI
The Experience Portal hosts apps and supplies authentication, context, themes and runtime integration. DevTools compiles/scaffolds apps. AppUI supplies UI primitives, data-driven domain components, schema forms and experience pages. Use the platform/developer documentation for resource bindings, permissions, authentication and endpoint payloads.
Discover before generating
- Read the public API catalog or query the installed Storybook MCP server started by the DevTools Storybook command.
- Prefer existing components/pages. Read their props, events, slots and examples before generating markup.
- Import the exact named exports from
@gxp-dev/app-ui; do not invent component/type names or private deep imports. - Import compiled styles once. Use ThemeWrapper for local palettes and themed overlays; the host may already supply platform variables.
- Normalize backend records to the component's data shape. Keep endpoint calls/permissions/authentication in the app's service layer.
- Include loading, error, empty and retry states for fetched data and handle emitted actions explicitly.
Start discovery from your app project
Run the installed DevTools command from the GxP app/plugin project containing @gxp-dev/app-ui in its dependencies:
cd /path/to/YOUR_GXP_APP
gxdev storybook
The command resolves that project's installed AppUI, prints its package path, checks its shipped .storybook setup and prompts to install missing optional tooling. While it runs, the Storybook MCP endpoint is http://localhost:6006/mcp; keep the process running during agent discovery. npm run storybook works when your app's package scripts define that DevTools command. A static build uses a separate invocation:
gxdev storybook --build
The build writes storybook-static/library-manifest.json and storybook-static/library-manifest.v2.json under the resolved AppUI package path, not automatically at the app project's root. In a normal install that path is node_modules/@gxp-dev/app-ui; workspaces/package-manager layouts may resolve it elsewhere. In the owning library checkout, use pnpm storybook or pnpm storybook:build after installing its pinned dependencies.
An older AppUI/DevTools release may lack the shipped Storybook setup or typed manifest. Inspect its actual named exports/declarations and any shipped guides, or use a source checkout that matches that release. Upgrade only after verifying the intended version's files/contracts. A missing v2 artifact is not a reason to generate against a newer catalog and assume those imports exist in your installed package.
Typed manifests
A static Storybook build supplies:
library-manifest.json: legacy catalog with additive forms/pages.library-manifest.v2.json: typed public contracts, component parts, experience pages/renderer, schema forms, page action/result defaults, helper options/returns and authored examples. Companion components include their parent composition examples.
Use importPath + exportName for generated imports. api.props contains required flags, defaults and declared types; api.events, api.slots, and api.exposed describe the remaining component contract. sourceDigest identifies the source inputs used to produce the artifact. Match the catalog to the installed package version: a catalog from a newer unpublished checkout is not a promise that the registry release has those exports.
Story examples are statically extracted source, with imports and meta defaults provided separately. Relative imports refer to the example's file; rewrite public component imports for your app. Do not treat Storybook render/setup wrappers as ready-made Vue SFCs. Domain/page APIs are data contracts, not a replacement for platform endpoint schemas.
Choose the right layer
| App requirement | Starting point |
|---|---|
| Custom layout | UI primitives, including their exported child components |
| Shared list/table behavior | AsyncState, EmptyState, CollectionGrid, DataTable |
| Large validated form | FormRenderer and FormSectionDef |
| Multi-stage experience | useExperience, ExperienceFlow and page components |
| Survey/quiz | QuestionCard/QuestionPage, service-owned answer evaluation |
| Registration/check-in | RegistrationPage, ScanPage, AttendeeBadge, app-owned services |
| Media capture | useMedia and capture/review pages |
| Printing | useExperienceApi.createPrintJob and host-managed PrintStatusPage |
| Live messaging/video | Chat/media components and injected API/realtime composables |
Validation before publishing an app
Build with the actual DevTools version and installed AppUI package. Verify named imports/types and CSS entrypoints. Exercise the app's complete flow, including failed actions, retries, hidden steps, reset, and async results arriving late. Check the intended viewport, touch/keyboard navigation and iframe device permissions. Use the Platform/Light Storybook switch to check palette assumptions.
The library checkout maintains runtime tests, source typechecking, manifest tests and static Storybook builds. pnpm docs:generate regenerates the reference without executing component/story modules. The developer site mirrors these maintained docs into developer-tools/uikit/ and copies that source into its gx-appui section during site builds.