@ortha/admin-platform-bootstrap
v0.0.4
Published
Thin orchestrator that wires the plugin-registry services together and mounts the React application. This is the entry point for bootstrapping the entire Ortha admin CMS.
Readme
@ortha/admin-platform-bootstrap
Thin orchestrator that wires the plugin-registry services together and mounts the React application. This is the entry point for bootstrapping the entire Ortha admin CMS.
Installation
Internal monorepo dependency — import directly:
import { bootstrap } from '@ortha/admin-platform-bootstrap';Usage
import { bootstrap } from '@ortha/admin-platform-bootstrap';
import { identityPlugin } from '@ortha/admin-identity';
import { homePlugin } from '@ortha/admin-home';
import { projectsPlugin } from '@ortha/admin-projects';
import { usersPlugin } from '@ortha/admin-users';
bootstrap(document.getElementById('root')!, [
identityPlugin(),
homePlugin(),
projectsPlugin(),
usersPlugin()
]);Note:
CorePluginis auto-prepended — never include it manually.
Bootstrap Lifecycle
bootstrap(mountElement, plugins, config?)- Prepend CorePlugin — always first; consumers must never include it.
- Validate — checks required fields, duplicate IDs, and resolvable dependencies.
- Topological sort — resolves
setup()call order via Kahn's algorithm. - Instantiate services — creates fresh
routerService(),slotService(). - Register plugins — populates
pluginRegistry()in sorted order. - Call
setup()— iterates sequentially,awaiting each plugin. - Mount React — renders
<CoreApp>wrapped inRouterServiceContextandSlotServiceContextproviders.
API Reference
| Export | Kind | Description |
| ------------- | -------- | ------------------------------------------- |
| bootstrap() | function | Initialises and mounts the entire admin CMS |
Parameters
| Parameter | Type | Description |
| -------------- | --------------- | ---------------------------------------- |
| mountElement | HTMLElement | DOM element to mount React into |
| plugins | AdminPlugin[] | Array of plugin factory results |
| config | AdminConfig? | Optional configuration (basePath, debug) |
Internal Structure
src/lib/
└── bootstrap/index.ts # The entire bootstrap functionDependencies
@ortha/admin-platform-core—CorePlugin,CoreApp, context providers@ortha/admin-platform-plugin-registry— plugin types, services, validation, sort
Key Patterns
- Keep this package as a pure wiring layer — do not add business logic here.
- The bootstrap function is
asyncto support asynchronous pluginsetup()calls. - Services are created fresh on every bootstrap call — no singletons.
Building
nx build admin-platform-bootstrap