Skip to main content

Module bootstrap

Module bootstrap 

Source
Expand description

Application bootstrap: one call to load config, connect, migrate, build the admin router, and serve it.

Bootstrap keeps an application’s main small and stable: framework internals (config fields, the migration runner, router assembly) change here, not in every app. An app registers its own modules; each module supplies its migrations and admin surfaces (resources, permissions, settings) from its register, and the app adds extra routes via Bootstrap::extend.

Structs§

AppConfig
The configuration Bootstrap loads. An app needing more loads its own with laterite_core::config::load.
Bootstrap
Builds and serves a Laterite application.
BootstrapCtx
Passed to Bootstrap::extend so an app’s own routes can share the database and the detected database capabilities.
PluginsConfig
Deployment control over which plugins load. A disabled plugin’s migrations do not run and it contributes nothing; any plugin that requires a disabled one is skipped in turn. Built-in modules cannot be disabled.

Constants§

DEFAULT_ENV_PREFIX
Default env-var prefix for config overrides (LAT__SECTION__KEY). An app declares its own as app.env_prefix in its config, which Bootstrap and the lat command both read; Bootstrap::env_prefix overrides even that.

Functions§

crypt_from_config
The application’s crypt: app.key and app.previous_keys when set, else a key derived from backend.secret or the key stored at the first boot (id 0), so a deployment that configured nothing keeps a stable key. A key that does not parse aborts the boot; a production deployment without app.key is warned to run lat key generate.
legacy_key_material
The signing key: backend.secret when set, else the one generated at the first boot and kept in the settings table, so tokens survive a restart.