Documentation
¶
Overview ¶
Package backofficeui embeds the generic back-office SPA and serves it from the engine binary under /app (ENG-38, the first-10-minutes path). It is the PRODUCT face of the backoffice-spec pattern: a CRUD admin UI generated ENTIRELY from /openapi.json at runtime — zero resource-specific screens, zero hardcoded domain knowledge — so ONE prebuilt bundle serves every schema this engine will ever boot. APP-VITRINA-S1 rebuilt its skin on the design system atina proved on this engine (ink sidebar, one accent, bundled Inter, positional lifecycle chips, a board derived from the state machine, drawer forms, toasts) — hand-written static CSS + vanilla JS, still no build step, still nothing domain-specific. In the minute-3 of a first contact, /app is the screen that feels like *your* app: your resources, your fields, your RBAC.
The SPA is no-build vanilla JS (ES modules), so unlike /admin and /editor there is no "assets not built" state: the source files ARE the bundle, committed and always embedded. It is the same pattern verified in examples/backoffice-guide/ (the teaching copy consumers adapt into their own SPA — that copy stays deliberately minimal and self-contained; this one may grow product polish). Everything either copy knows comes from the contract: x-appximo-relation/references, x-appximo-file(+policy), x-appximo-initial/transitions, x-appximo-virtual-resources.
Serving model (mirrors pkg/adminui): /app redirects to /app/ so the SPA's RELATIVE asset references resolve under the mount; /app/ serves the shell; /app/<file> serves the module files. All static, JWT-skipped (the shell loads before any token exists — the API calls it makes carry the Bearer), off the CRUD hot path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶ added in v0.1.9
type Options struct {
// ThemeCSS, when non-empty, is served at /app/theme.css INSTEAD of the
// embedded default (which is empty). style.css defines every color, radius
// and font as --app-* tokens on :root and index.html links theme.css after
// it, so a consumer re-skins the whole panel by redefining tokens here —
// no rebuild, no fork. Stock binary: APPXIMO_APP_THEME_CSS=<path>.
ThemeCSS []byte
// DemoRoles lists the RBAC roles for which the SPA runs in DEMO MODE:
// writes are simulated in a per-session in-memory overlay (a reload
// resets) and never sent to the API. The role's server-side policy should
// be read-only — the overlay is coherence for the visitor, the RBAC is
// the security boundary. Published at /app/ui-config.json (role names are
// not secrets; the endpoint lists only these). Stock binary:
// APPXIMO_APP_DEMO_ROLES=<comma-separated>.
DemoRoles []string
// Banner, when set, is a one-line bar the SPA renders above its shell
// (login and panel alike): the consumer's TEXT and ONE link — the way
// back to the storefront/landing from a public demo panel (ENG-46). It
// travels in /app/ui-config.json as {text, href} and the SPA renders it
// as text + an <a> (textContent, never markup), so no HTML is injected;
// Href is validated here (http/https/mailto/tel or a same-site path).
// Stock binary: APPXIMO_APP_BANNER_TEXT + APPXIMO_APP_BANNER_HREF.
Banner *Banner
}
Options customizes the served back-office without touching the embedded bundle (DEMO-SHOWCASE-S1 — "your panel, your colors").