Adminizer modules are backend-first extensions built around AbstractAdminizerApp and AppManager. A module can register routes, frontend assets, form controls, config patches, access rights, existing ORM models, model access scopes, AI assistants, media managers, catalogs with template components, and event listeners. This is the current extension mechanism for features such as the fixture module pages, AI assistant, media manager, module manager, navigation catalog, and React-Quill control.
Older standalone React page modules may still exist as frontend patterns, but a full Adminizer module should be installed through adminizer.appManager.
An app must not accept, store, or depend on an Adminizer instance. The host application owns Adminizer and uses it only to enable the app:
await adminizer.init(adminpanelConfig);
await adminizer.appManager.enable(new MyApp({
route: "/my-app",
}));The app constructor accepts only its own configuration and optional app-level dependencies:
// Correct
new MyApp({ route: "/my-app" });
// Do not do this
new MyApp(adminizer, { route: "/my-app" });This boundary lets AppManager control resource ownership, cleanup, model permissions, and the capabilities exposed to each app.
Use the API supplied for each lifecycle phase:
| App code | Access point |
|---|---|
setup() |
Register resources through AppSetupContext. |
| App controller | Use the app-scoped req.runtime. |
| Catalog factory | Use the runtime factory argument. |
| Event listener | Use the runtime handler argument. |
req.adminizer is a deprecated compatibility API. It will not be available starting with Adminizer v6 and must not be used in app code.
Import module contracts from Adminizer:
import {
AbstractAdminizerApp,
AppSetupContext,
AppRuntime,
} from "adminizer";A module extends AbstractAdminizerApp:
export class MyApp extends AbstractAdminizerApp<MyAppConfig> {
readonly name = "my-app";
readonly version = "1.0.0";
declare readonly config: MyAppConfig;
constructor(config: Partial<MyAppConfig> = {}) {
super();
this.config = {
route: "/my-app",
...config,
};
}
setup(ctx: AppSetupContext): void | Promise<void> {
// Register resources here.
}
}Enable it after adminizer.init(config):
await adminizer.init(adminpanelConfig);
await adminizer.appManager.enable(new MyApp());AppManager.enable(app) registers the app if needed, runs setup(ctx), waits for deferred model, model-access, media-manager, and catalog registrations, and stores disposers for later disable() or unregister(). setup() receives only AppSetupContext; it does not receive Adminizer.
setup(ctx) receives an AppSetupContext with these methods:
| Method | Purpose |
|---|---|
ctx.asset(asset) |
Expose a JS/CSS/static file and return its URL. In ADMINIZER_ENV=dev, devUrl is returned directly. In production, Adminizer creates a static controller for filePath. |
ctx.control(control) |
Register an app-owned form control with its component asset, optional stylesheet asset, type, name, and base config. |
ctx.controller(controller) |
Register an Express route under config.routePrefix; returns the resolved full path. |
ctx.config(patch, id?) |
Merge a config patch into adminizer.config. Arrays of objects with id are merged by id; other arrays are appended. |
ctx.accessRight(token) |
Register an access rights token owned by the app. |
ctx.model(model) |
Attach an existing ORM model to the app. The model must be installed before the app is enabled. |
ctx.modelAccess(access) |
Allow the app runtime to access selected models through runtime.models. |
ctx.aiAssistant(resource) |
Register an app-owned AI assistant handler with model factories. |
ctx.skills.agent(skill) |
Register a server-side AI assistant skill (a tool every compatible agent may call). See Agent Skills. |
ctx.skills.uiMethod(method) |
Register a browser capability an agent may trigger through a ui.method frame. See Admin Links & UI Methods. |
ctx.adminLink(link) |
Register a standalone admin page in the navigation and in agent link search. An optional badge (value or per-user resolver) shows a count next to it. |
ctx.adminLinkTemplate(template) |
Register a parametrized page (e.g. /admin/orders/:id/invoice) the assistant may open. |
ctx.context(context) |
Register a layout context: own URL prefix, navbar and, optionally, a layout — inherited with some parts overridden, or a custom one. Returns its scope; page() adds a route, a menu item and breadcrumbs in one call. See Layout Contexts. |
ctx.mediaManager(resource) |
Register an app-owned media manager through a factory that receives AppRuntime. |
ctx.catalog(catalog) |
Register a catalog factory and its optional React template components. |
ctx.listener(event, handler) |
Subscribe to Adminizer events. The handler receives (payload, runtime). |
Registration order after setup() is intentional: app model bindings first, model access second, AI assistants third, assistant UI methods and agent skills fourth, media managers fifth, and catalogs sixth. This lets factories safely use models owned by the same app.
AppRuntime is the public capability object for app code. App controllers receive it through req.runtime; media manager factories, catalog factories, and event listeners receive the same app-scoped runtime as an argument.
interface AppRuntime {
models: AppModelAccess;
config: {
readonly routePrefix: string;
getModelConfig(modelName: string): ModelConfig | undefined;
};
notifications: {
send(
notification: Omit<INotification, "id" | "createdAt" | "icon">
): Promise<boolean>;
};
apps: {
list(): AppRuntimeApp[];
get(name: string): AppRuntimeApp | undefined;
enable(name: string): Promise<void>;
disable(name: string): Promise<void>;
unregister(name: string): Promise<void>;
};
}Use runtime.models.get<T>(modelName) only for models declared through ctx.modelAccess(). Pass the canonical Adminizer resource name, not a physical ORM host model name. This keeps internal and app model access explicit. Runtime model access returns a trusted repository and does not apply DataAccessor user or field filtering, so user-facing controllers should enforce access through policies and module-level checks.
For example, if the project declares Customer: { model: "User" }, grant and request Customer:
ctx.modelAccess({ models: ["Customer"] });
const customers = runtime.models.get("Customer");ctx.modelAccess({ models: ["Navigation", "Category"] });
ctx.catalog({
id: "navigation",
factory: async (runtime) => {
const navigationModel = runtime.models.get("Navigation");
// Create and return AbstractCatalog.
},
});For controllers, register model access during setup and read the model through req.runtime:
setup(ctx: AppSetupContext): void {
ctx.modelAccess({
id: "users",
models: ["User"],
});
ctx.controller({
id: "users",
method: "get",
route: "/my-app/users",
middleware: async (req, res) => {
const users = await req.runtime.models.get<User>("User").find({});
return res.json({ users });
},
policies: [{ type: "auth", mode: "api" }],
});
}ControllerHandler assigns the runtime for the app that registered the controller before its middleware executes. Do not capture Adminizer in a controller closure and do not use req.adminizer.
ctx.controller() registers routes through ControllerHandler. The route is automatically prefixed with the configured Adminizer route prefix, which is available to the controller as req.runtime.config.routePrefix.
const pageUrl = ctx.controller({
id: "page",
method: "get",
route: "/my-app",
middleware: async (req, res) => {
return req.Inertia.render({
component: "module",
props: {
moduleComponent,
data: { rows: [] },
},
});
},
policies: [{ type: "auth", mode: "ui" }],
});Supported policy types:
| Policy | Meaning |
|---|---|
| `{ type: "auth", mode?: "ui" | "api" }` |
{ type: "auth-enabled" } |
Require auth only when auth is enabled. |
| `{ type: "admin", mode?: "ui" | "api" }` |
| `{ type: "permission", token, mode?: "ui" | "api" }` |
| `{ type: "any-permission", tokens, mode?: "ui" | "api" }` |
Use mode: "ui" for Inertia pages and mode: "api" for JSON endpoints.
context: "<id>" declares the layout context the route belongs to: the page renders in that context, and users who may not enter it get 403 (404 if no such context is registered). See Layout Contexts.
Adminizer renders app pages with the shared Inertia page module. Your controller passes moduleComponent; the page dynamically imports that ES module and renders its default export.
Props of the module page:
| Prop | Type | Meaning |
|---|---|---|
moduleComponent |
string |
URL of the ES module whose default export is rendered. Required. |
moduleComponentCSS |
string |
URL of a stylesheet injected once as a global <link>. See Styling App Modules. |
breadcrumbs |
Array<{title: string; href?: string}> |
Shown in the panel header. Omit href on the last crumb. Titles are rendered as given — translate them in the controller (req.i18n.__). |
moduleLayout |
'default' | 'bare' |
'bare' removes the content margin so the module root becomes a direct child of the scroll container (log viewers, canvases, diff views). Default keeps today's m-2 md:m-5. |
Everything else in props is passed to the module component as-is.
With navbar.breadcrumbs: 'auto' pages that send no breadcrumbs get them from the registry;
register your deep pages with ctx.adminLinkTemplate and they appear in the chain.
With moduleLayout: 'bare' the module root becomes a direct child of
div.flex.min-h-full.w-full.flex-col, so padding is yours to decide; add
className="flex-1 min-h-0" on the root to fill the scroll area's height.
return req.Inertia.render({
component: "module",
props: {
moduleComponent,
breadcrumbs: [
{title: "Agentiz", href: `${req.runtime.config.routePrefix}/agentiz`},
{title: "Projects", href: `${req.runtime.config.routePrefix}/agentiz/projects`},
{title: project.name},
],
moduleLayout: "bare",
data,
},
});// MyAppPage.tsx
export default function MyAppPage({ data }: { data?: { rows: Array<{ id: number; name: string }> } }) {
const { Button, Card, CardContent } = window.UIComponents;
return (
<Card>
<CardContent>
{data?.rows.map((row) => (
<Button key={row.id}>{row.name}</Button>
))}
</CardContent>
</Card>
);
}Register the built asset and route:
const moduleComponent = ctx.asset({
id: "component",
filePath: path.resolve(import.meta.dirname, "MyAppPage.es.js"),
devUrl: "/apps/my-app/MyAppPage.tsx",
});
ctx.controller({
id: "page",
method: "get",
route: "/my-app",
middleware: async (req, res) => req.Inertia.render({
component: "module",
props: {
moduleComponent,
data: { rows: await loadRows() },
},
}),
policies: [{ type: "auth", mode: "ui" }],
});Add a sidebar link through a config layer:
ctx.config({
navbar: {
additionalLinks: [{
id: "my-app",
link: pageUrl,
type: "self",
title: "My App",
icon: "settings",
section: "Platform",
}],
},
});A module declares ownership of an ORM model by name:
ctx.model({
name: "MyAppState",
});
ctx.modelAccess({ models: ["MyAppState"] });AppManager does not define tables, register native ORM models, or synchronize schemas. The host or module installer must complete those operations before appManager.enable().
For Sequelize, models can be installed after adminizer.init() and immediately before enabling the app:
await installMyAppSequelizeModels(sequelize);
await adminizer.appManager.enable(new MyApp());Disabling an app removes its Adminizer model wrapper but does not remove the native Sequelize model or its table.
adapter is optional. If omitted, Adminizer uses config.system.defaultORM or the only registered ORM adapter.
TypeORM support remains experimental. Core logs a warning whenever an app is enabled while system.defaultORM is typeorm. A TypeORM entity required by an app must be included in DataSource.entities before dataSource.initialize(). TypeORM does not support the Sequelize-style dynamic app model installation used by the fixture.
Apps without their own models can still be enabled normally with TypeORM. An app with a model can also be enabled when its entity was registered before initialization. If the entity is missing, AppManager fails during enable() with an error explaining this requirement.
An app can own the active AI assistant handler and model services:
ctx.accessRight({
id: "ai-assistant-my-model",
name: "My assistant model",
description: "Access to My assistant model",
department: "AI Assistant",
});
ctx.aiAssistant({
models: [
(context) => new MyAiModelService(context),
],
});
ctx.config({
aiAssistant: {
enabled: true,
defaultModel: "my-model",
models: ["my-model"],
},
});ctx.aiAssistant() creates an AiAssistantHandler for the app and registers model services returned by its factories. The factory receives an AI context with runtime, routePrefix, model resource lookup helpers, permission checks, createDataAccessor(), and getUiMethods(user). Disabling the app restores the previous handler, removes the app's config layer, and unregisters app-owned access tokens.
Assistant model classes should extend AbstractAiModelService, but they should not register access rights themselves. The app owns tokens through ctx.accessRight(). Register routes with ctx.controller() and the reusable AiAssistantController when the app exposes the standard assistant API. The fixture implementation is in fixture/apps/ai-assistant.
An app can also contribute capabilities to agents it does not own: server-side tools through ctx.skills.agent(), browser capabilities through ctx.skills.uiMethod(), and navigable pages through ctx.adminLink() / ctx.adminLinkTemplate(). All four are removed when the app is disabled. See AI Assistant for the full contracts.
An app can own a media manager implementation:
ctx.mediaManager({
factory: (runtime) => new MyMediaManager(runtime, config),
});The manager is created after the app models and scoped model access are registered. Disabling the app unregisters the manager automatically. The app owns its access right, models, model access, and storage implementation.
In Adminizer v5, the media manager HTTP API, upload adapter, thumbnail endpoint, public-file binding, and file icons remain in core for legacy compatibility. A manager registered through mediaManagerHandler.add() and a manager registered through ctx.mediaManager() use the same core routes. This transport layer is planned to move to the system runtime in v6.
The fixture default implementation is in fixture/apps/media-manager. Its Sequelize installer runs after adminizer.init() and before appManager.enable(). It is intentionally not enabled in the TypeORM fixture: TypeORM remains experimental and app entities must be registered in DataSource.entities before initialize().
AbstractMediaManager still accepts Adminizer in its constructor and registers its access right through _bindAccessRight() for the legacy v5 path. Existing integrations may continue to instantiate a custom manager and call adminizer.mediaManagerHandler.add(manager) until v6. App-owned managers should register their access right with ctx.accessRight() and pass a no-op legacy host to the base constructor; see the fixture implementation and MediaManager.md.
Catalog item types return add/edit templates with a type string:
async getAddTemplate(req: ReqType) {
return {
type: "my-catalog.item-form",
data: { labels: { save: req.i18n.__("Save") } },
};
}A module maps that template type to a React component in the templates array of ctx.catalog():
const catalogTemplates = ctx.asset({
id: "catalog-templates",
filePath: path.resolve(import.meta.dirname, "CatalogTemplates.es.js"),
devUrl: "/apps/my-app/CatalogTemplates.tsx",
});
ctx.catalog({
id: "my-catalog",
templates: [{
id: "item-form",
type: "my-catalog.item-form",
component: catalogTemplates,
exportName: "MyCatalogItemTemplate",
}],
factory: (runtime) => new MyCatalog(runtime),
});Template components are scoped to the catalog returned by the same resource. CatalogTemplateComponentHandler prevents two enabled components from claiming the same template type in that catalog scope.
Template props on the frontend:
interface CatalogTemplateComponentProps {
mode: "create" | "update";
type: string;
template: { type: string; data: any };
parentId: string | number;
itemType: string | null;
selectedItem?: Record<string, any>;
messages: Record<string, string>;
actions: {
close: () => void;
reload: (item?: any) => Promise<void>;
openModelAdd: (model: string) => Promise<void>;
};
}A minimal template:
export function MyCatalogItemTemplate({ template, itemType, parentId, actions }: CatalogTemplateComponentProps) {
const { Button, Input, Label } = window.UIComponents;
const [name, setName] = React.useState("");
const save = async () => {
const res = await window.adminApi.post("", {
_method: "createItem",
data: {
type: itemType,
parentId,
name,
},
});
actions.close();
await actions.reload(res.data.data);
};
return (
<div className="p-8 grid gap-4">
<Label>{template.data.labels?.name ?? "Name"}</Label>
<Input value={name} onChange={(e) => setName(e.target.value)} />
<Button onClick={save}>Save</Button>
</div>
);
}For catalogs, prefer registering through an app instead of calling adminizer.catalogHandler.add() directly. The module can register storage models, access rights, sidebar links, catalog templates, and event listeners in one place.
export class MyCatalogApp extends AbstractAdminizerApp<MyCatalogAppConfig> {
readonly name = "my-catalog";
readonly version = "1.0.0";
declare readonly config: MyCatalogAppConfig;
constructor(config: MyCatalogAppConfig) {
super();
this.config = config;
}
setup(ctx: AppSetupContext): void {
ctx.accessRight({
id: "catalog-my-catalog",
name: "My Catalog",
description: "Access to My Catalog",
department: "Catalog",
});
ctx.model({
name: "MyCatalogStorage",
});
ctx.modelAccess({ models: ["MyCatalogStorage"] });
ctx.config({
navbar: {
additionalLinks: [{
id: "my-catalog-main",
type: "self",
link: `${this.config.routePrefix}/catalog/my-catalog/main`,
title: "My Catalog",
icon: "folder",
accessRightsToken: "catalog-my-catalog",
}],
},
});
ctx.catalog({
id: "my-catalog",
factory: async (runtime) => {
const catalog = new MyCatalog(runtime, this.config);
await catalog.ready?.();
return catalog;
},
});
}
}ctx.listener(event, handler) is useful for synchronizing module data with model changes. Adminizer emits model:updated after edit controller updates a record.
ctx.listener("model:updated", async (event: { modelName: string; record: Record<string, any> }, runtime) => {
if (event.modelName.toLowerCase() !== "category") {
return;
}
const storage = runtime.models.get("MyCatalogStorage");
await storage.update({ where: { label: "main" } }, { touchedAt: Date.now() } as any);
});AppManager also emits lifecycle events such as app:registered, app:enable:start, app:enabled, app:disable:start, app:disabled, app:unregistered, and resource-level registration events.
Build module UI as an ES module and externalize Adminizer globals to avoid bundling another copy of React or UI components.
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
import { viteExternalsPlugin } from "vite-plugin-externals";
export default defineConfig({
plugins: [
react(),
viteExternalsPlugin({
react: "React",
"react-dom": "ReactDOM",
"lucide-react": "LucideReact",
sonner: "sonner",
"@/components/ui/button": "UIComponents",
"@/components/ui/card": "UIComponents",
"@/components/ui/input": "UIComponents",
"@/components/ui/label": "UIComponents",
}),
],
build: {
outDir: path.resolve(import.meta.dirname, ""),
emptyOutDir: false,
lib: {
entry: path.resolve(import.meta.dirname, "MyAppPage"),
formats: ["es"],
fileName: (format) => `MyAppPage.${format}.js`,
},
rollupOptions: {
external: [
"@/components/ui/button",
"@/components/ui/card",
"@/components/ui/input",
"@/components/ui/label",
],
},
},
resolve: {
alias: {
"@": path.resolve(import.meta.dirname, "../../src/assets/js"),
},
},
});For heavy built-in window.JSComponents controls, import Adminizer's lazy proxy modules in development and externalize those imports in production:
import HandsonTable from "@/js-components/handsontable";
import MonacoEditor from "@/js-components/monaco";
import VanillaJSONEditor from "@/js-components/jsoneditor";viteExternalsPlugin({
"@/js-components/handsontable": ["JSComponents", "HandsonTable"],
"@/js-components/monaco": ["JSComponents", "MonacoEditor"],
"@/js-components/jsoneditor": ["JSComponents", "VanillaJSONEditor"],
});Do not import @/components/handsontable, @/components/monaco-editor, or @/components/VanillaJSONEditor directly from app modules when you want lazy loading. Those component imports bypass the control proxy layer that loads the production assets and related styles on demand.
Use project-specific build scripts for modules. The fixture uses:
npm run build:appsbuild:apps also runs build:catalog-modules, which builds the legacy virtual catalog React templates and actions from fixture/virtual-catalog.
Adminizer's stylesheet is compiled from Adminizer's own sources. An app module is not part of
that content scan, so Tailwind never generates a class only your module uses. Standard utilities the
panel already uses (flex, rounded, p-2, text-sm, bg-muted, text-destructive, size-6)
are present and work. Anything else silently does nothing — most often:
- arbitrary values:
text-[11px],min-w-[220px],size-[18px]; - utilities the panel happens not to use:
w-16,max-w-40,border-amber-300.
Nothing errors; the element simply renders unstyled, which is easy to miss in review. Check a class against the shipped stylesheet before relying on it:
grep -c -- "\.w-16" node_modules/adminizer/assets/app-*.css # 0 = not generatedThree ways to style a module, in order of cost:
- Stay inside the panel's utilities. Best default: the module looks native and ships no CSS.
- Inline styles for one-off geometry.
style={{ width: "4rem" }}always applies and needs no build step — the right tool for a handful of sizes. - Ship the module's own stylesheet when it has real styling of its own (a canvas, a chart, a
vendored widget). Adminizer supports this directly: pass
moduleComponentCSSnext tomoduleComponentand the module page injects a<link>for it, once per path.
Author a CSS entry that pulls utilities only. Importing tailwindcss wholesale would also bring
Preflight and reset the panel around your module:
/* MyAppPage.css */
/* Theme namespaces (spacing, typography, radii, shadows, animations…). Without this
import Tailwind v4 has no scales, and every utility that reads one — p-4, text-sm,
rounded-md, gap-2 — is silently not generated. `theme(reference)` makes the namespaces
available to the compiler but emits NO custom properties, so this file cannot
perturb the panel's palette; utilities compile with a fallback baked in, e.g.
`font-size: var(--text-sm, 0.875rem)`. */
@import "tailwindcss/theme.css" layer(theme) theme(reference);
/* Utilities only. Importing `tailwindcss` wholesale would also bring Preflight and
reset the panel around your module. */
@import "tailwindcss/utilities.css" layer(utilities);
/* Tell Tailwind what to scan — the module's own sources, nothing else. */
@source "./**/*.tsx";
/* Map the theme to the panel's CSS variables, so tokens follow light/dark with the panel
instead of resolving to Tailwind's default palette. Adminizer defines these on :root. */
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-warning: var(--warning);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
/* Radii: Tailwind reads --radius-sm|md|lg|xl, never --radius itself. Map them the way
Adminizer's own app.css does. NEVER write `--radius: var(--radius)` here — it compiles
to a self-referencing property on :root and squares every corner of the whole panel. */
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
}Import it from the entry component and let Vite emit it beside the bundle:
// MyAppPage.tsx
import "./MyAppPage.css";// vite.config.ts — alongside the module build shown above
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
plugins: [react(), tailwindcss()],
build: {
cssCodeSplit: true, // emits MyAppPage.css next to MyAppPage.es.js
lib: { entry: "MyAppPage", formats: ["es"], fileName: (f) => `MyAppPage.${f}.js` },
},
});Register the stylesheet as an asset and pass its URL with the page:
const moduleComponentCSS = ctx.asset({
id: "component-css",
filePath: path.resolve(import.meta.dirname, "MyAppPage.css"),
});
req.Inertia.render({
component: "module",
props: { moduleComponent, moduleComponentCSS, data },
});Two limits worth knowing:
moduleComponentCSSapplies to the page module. A component the page imports dynamically at runtime (a nested micro-frontend, a per-record form) is not covered — such a bundle must inject its own stylesheet, or inline it.- Duplicate utility definitions are harmless: your file and the panel's declare the same class with
the same value, and later wins with an identical result. Divergence only appears through theme
tokens, which is exactly what the
@theme inlinemapping above prevents. - A module stylesheet is global. It is injected as a
<link>intodocument.head, after the panel's own stylesheet and for the whole document — not scoped to the module. Anything you write into:root(directly or through@themewithoutinline) lands on every page of the panel and wins, because it loads last. Keep the file to utilities and the@theme inlinemapping above; never redefine a panel variable.
The fixture contains several current app-module examples:
| App | Files | Demonstrates |
|---|---|---|
ai-assistant |
fixture/apps/ai-assistant/* |
App-owned AI assistant handler, model access tokens, standard AI routes, config layer, and runtime enable/disable through AppManager. |
notification-sender |
fixture/apps/notification-sender/* |
Page module, asset registration, scoped model access through req.runtime.models, user message notifications, UI/API routes, sidebar config patch. |
module-manager |
fixture/apps/module-manager/* |
Access right token, permission-protected page/API routes, app lifecycle control through req.runtime.apps. |
navigation |
fixture/apps/navigation/* |
Runtime model, model access, catalog factory, catalog template components, sidebar links, model:updated listener. |
media-manager |
fixture/apps/media-manager/* |
Dynamic Sequelize models, app-owned storage implementation, scoped model access, manager registration, lifecycle cleanup. |
quill-editor |
fixture/apps/quill-editor/* |
App-owned WYSIWYG control, lazy component and stylesheet assets, and a dedicated ES module build. |
context-system, context-support, context-studio |
fixture/apps/contexts/* |
Layout contexts: inherited layout with overridden parts and own navbar, partially inherited layout, fully custom layout. See Layout Contexts. |
Custom form controls are app-owned resources registered through ctx.control(). Their JavaScript and optional stylesheet are loaded only when the field renderer mounts the control. Disabling the app unregisters the control and removes its asset routes. See Controls.md for the complete contract, build configuration, field configuration, and fallback behavior.
- App has stable
nameandversion. - App constructor accepts app config/dependencies, never an
Adminizerinstance. - App controllers use
req.runtime; they do not use the deprecatedreq.adminizer. - All registered resources have deterministic
idvalues. - UI controllers render through
req.Inertia.render({ component: "module", props: { moduleComponent, ... } }). - API controllers use
mode: "api"policies and return JSON. - Frontend assets are registered through
ctx.asset()with bothfilePathanddevUrlwhen local development is needed. - Custom form controls are registered through
ctx.control()with deterministic component and stylesheet asset IDs. - App-specific models are declared with
ctx.model()and allowed withctx.modelAccess()before catalogs use them. - Catalog templates are registered in
ctx.catalog({ templates: [...] })instead of hard-coded paths in catalog data. - Module UI uses
window.UIComponents,window.JSComponents,window.adminApi, and global React/Lucide exports instead of bundling duplicates. - Module markup uses only utilities the panel's stylesheet already contains; anything else is an
inline style or ships in the module's own
moduleComponentCSSfile. See Styling App Modules.