Overview
Add the generated admin panel, configure its navigation and branding, and extend it with views, components, blocks, actions, auth, and audit trails.
The admin panel is a first-class QUESTPIE module. On the server, adminModule contributes collections, fields, views, components, routes, and a codegen plugin. On the client, the generated admin builder resolves those server-emitted references into React screens.
What the admin module gives you
- Collection and global forms generated from your schema.
- Rich text, blocks, uploads, actions, saved views, locks, setup, and auth screens.
config/admin.tsfor sidebar, dashboard, branding, locale, and shell configuration.- Server/client registries for custom views and components.
- An optional audit module for durable change history.
Basic wiring
import { adminModule } from "@questpie/admin/modules/admin";
import { openApiModule } from "@questpie/openapi/modules/openapi";
export default [adminModule, openApiModule] as const;import { adminClientModule } from "@questpie/admin/client/modules/admin";
export default [adminClientModule] as const;Configuration entrypoints
Admin setup is split across server and client files so codegen can type both sides:
| File | Purpose |
|---|---|
src/questpie/server/modules.ts | Registers adminModule, which contributes server routes, collections, fields, views, components, and codegen extensions. |
src/questpie/admin/modules.ts | Registers adminClientModule, which resolves server-emitted references into React renderers. |
src/questpie/server/config/admin.ts | Configures sidebar, dashboard, branding, locale, and shell options through adminConfig(). |
src/questpie/admin/admin.ts | Exports the generated admin client config consumed by the app's /admin route. |
Extension surfaces
Collections and globals can opt into admin behavior with generated builder methods such as .admin(), .list(), .form(), .preview(), and .actions(). Field-level .admin() config controls editor behavior, placeholders, layout hints, and component props. Blocks, views, and components are registry-driven conventions contributed by the admin plugin, so adding a file and rerunning codegen is enough to make them available to the admin client.
The admin module also owns the setup/login screens and integrates with Better Auth. Optional modules such as audit can add their own admin collections and UI surfaces through the same module + codegen plugin path.
Related
- Collections and globals -
.admin(),.list(),.form(),.preview(),.actions(), and global forms. - Configuration -
config/admin.ts, sidebar, dashboard, branding, locale, shell, and client mounting. - Custom views and components - registry-based view and component extensions on the server and client.
- Authentication - Better Auth setup, admin sessions, setup flow, and invitations.
- Audit -
auditModule,admin_audit_log, per-resource audit settings, and custom audit entries. - Modules - how
adminModulecontributes runtime and codegen features. - Blocks - reusable content blocks that render in the admin.
- Configuration - app config and module-discovered config files.
KV adapter
A typed key-value store on your app context, ctx.kv.get/set/delete/has/clear with TTL and tag-based invalidation. In-memory by default; swap to Redis or Cloudflare KV with one config line and no app-code change.
Collections and Globals
Configure how collections and globals appear in the generated admin panel.