Expand description
Laterite admin: the operator-facing web surface.
An Axum router mounted under a configurable path (default /admin, set by
AdminConfig::path): a login screen and session cookie verified against
laterite-auth, and descriptor-driven screens.
Screens are resources: a module declares a Resource (a
list::ListConfig, optionally a form::FormConfig, a base path, and a
menu label), and the framework mounts the list, create, and edit routes and
adds it to the menu. This is the extension point that lets an application
contribute its own admin screens. The framework’s own screens (users, roles)
are just built-in resources.
An application usually boots through Bootstrap, which loads config,
connects, migrates, and serves this router in one call.
Re-exports§
pub use bootstrap::AppConfig;pub use bootstrap::Bootstrap;pub use bootstrap::BootstrapCtx;pub use bootstrap::DEFAULT_ENV_PREFIX;pub use axum;
Modules§
- bootstrap
- Application bootstrap: one call to load config, connect, migrate, build the admin router, and serve it.
- checklist
- The checklist: checkboxes in groups, one component for every screen.
- descriptor
- Reading a resource from a YAML file.
- field
- The open field-type registry: the framework and plugins add form field types.
- form
- Descriptor-driven create and edit forms.
- html
- Trusted HTML markup.
- http_
cache - Conditional responses and cache policy for admin and plugin routes.
- list
- Descriptor-driven list views.
- persist
- The persister seam: a form’s write is a handler, resolved at boot from a string key on the descriptor.
- picker
- The reference-picker seam: a generic field picks a value from a data source (another table, a hierarchy) without the framework knowing the source.
- plugins
- The
laterite.pluginsbuilt-in module: a registry table recording each plugin’s operator enable/disable state, read at boot to decide which plugins load.record_rosterrecords the compiled plugins here at boot,set_enabledis the enable/disable service (applied on the next boot), andlist_pluginsfeeds the admin screen. Thequarantined_*columns hold the system’s verdict (written by a later slice). - routes
- Routes a module mounts itself: admin screens, and public endpoints.
- settings
- Descriptor-driven settings screens, and the settings store behind them.
Macros§
- resource
- Reads a descriptor file at compile time, relative to the crate’s manifest.
Structs§
- Admin
Config - Deployment-level admin settings passed to
router. Per-install brand and per-operator preferences are settings/preferences, not deployment config. - Contributions
- Builds the admin router.
app_resourcesare the application’s own list/form screens;app_settingsare its settings models;app_permissionsare the permissions it defines, offered in the role editor alongside the framework’s. All are mounted alongside the framework’s built-in equivalents. Everything the modules and the application contribute to the admin, in one value. - Permission
- A permission an operator can be granted: a dotted
code, a humanlabel, and agroupheading it sorts under in the role editor. The framework registers its own (see the built-in grants), and an application registers its permissions throughrouterso they appear in the editor alongside. - Resource
- An admin resource: a list screen, optionally with a create/edit form, mounted
under
base_pathand shown in the menu asnav_label. - Session
Handle - A cheap-to-clone handle to the current session’s typed state, shared between the auth middleware and the handler through request extensions. Mutations set a dirty flag; the middleware persists the blob after the handler runs only when it is dirty.
- Verified
Upload - An upload whose request token has been verified.
Enums§
- Admin
Error - A typed error an admin handler can return.
- Flash
Level - The severity of a [
Flash], mapped to a style class by the template.
Constants§
- ROLE_
ADMIN - The built-in role every administrative permission belongs to. Held by the first operator, and by anyone who should administer the panel itself.
- ROLE_
EDITOR - The built-in role for working with content rather than the panel. Empty on a bare framework: a permission joins it by naming it.
Traits§
- Admin
Registry - Typed contribution channels for the framework’s admin surfaces, as an
extension trait over the generic
laterite_core::Registry. A module contributes its admin screens, permissions, and settings from itsregister; a wrong-type contribution is a compile error, not one silently ignored. The genericadd/itemsunderneath remains for open, plugin-defined points.
Functions§
- builtin_
migrations - The migration sets for every module the admin mounts: the auth schema
(users, roles, sessions, access log) and the settings store. Run these
before serving
routerso its built-in screens have their tables, so an application never has to know which framework modules the admin pulls in. - builtin_
modules - The framework’s built-in modules, in registration order.
Bootstrapregisters these before an app’s own modules, so the admin’s tables migrate first. - descriptor_
sources - Every source string in the framework’s built-in admin descriptors: resource nav
labels and their list titles and column headers, settings items and their fields,
and permission labels and groups.
lat i18n extractfolds these into the admin catalog. Collected through the serde source walk, so it never drifts as new label fields are added. - normalize_
path - Normalises a configured admin path: a single leading slash, no trailing
slash, falling back to
/adminwhen empty.manage,/manage, and/manage/all become/manage. Shared byrouterand any caller building the panel’s URL (for example a startup banner), so the two never drift. - permission_
renames - Every rename the registry declares, as
(old, new)pairs. - router
- system_
roles - The framework’s roles, with the permissions the registry says they hold.