| title | Dashboard Hosting |
|---|---|
| nav_order | 9 |
| permalink | /dashboard-hosting/ |
gems/karya-dashboard is an optional addon for framework hosts. When a
framework includes it, the host mounts one shared dashboard distribution instead
of maintaining a framework-specific UI fork.
That keeps the operator experience consistent across frameworks while still letting each host own its own routing, auth/session behavior, and integration details.
The authoritative dashboard package contract is:
dist/index.htmldist/assets/*dist/asset-manifest.json
The asset manifest is the source of truth for the scripts, stylesheets, and mount metadata required by the dashboard renderer.
When included by a framework host, karya-dashboard ships:
- the packaged operator UI
- the dashboard-owned internal API surface used by that UI
- Kaal-facing operator workflows for recurring jobs and schedules
- Ruby helpers for manifest loading and host-page rendering
From gems/karya-dashboard:
bin/build
bin/prepackage-buildprepackage-build verifies the packaged distribution and writes the manifest
used by the host-side rendering helpers.
These examples make the hosting shape clear without turning this page into a framework-by-framework contract reference.
# config/routes.rb
mount Karya::Rails::Engine => "/karya"get "/karya" do
content_type "text/html"
Karya::Sinatra.render_dashboard_page(scope: "ops")
endr.is "karya" do
response["content-type"] = "text/html; charset=utf-8"
Karya::Roda.render_dashboard_page(scope: "internal")
endslice :dashboard, at: Karya::Hanami.mount_pathEvery host that includes the addon is responsible for:
- serving the packaged asset files under a stable asset path
- rendering the dashboard document with the manifest-driven asset tags
- setting the dashboard mount path that the frontend uses for operator routing
- aligning auth and session behavior with the framework’s operator access model
- exposing the internal dashboard APIs that the UI depends on
The dashboard renderer supports:
mount_path: the URL base that the dashboard treats as its mounted homeasset_prefix: the prefix used when assets are served behind a subpath or CDN-backed location
The asset-prefix contract normalizes host-provided prefixes so the resulting asset URLs remain stable across local paths, subpaths, and fully qualified CDN prefixes.
Hosts use asset_prefix when the packaged assets are served from a subpath or a
separate asset origin:
Karya::Dashboard.render_document(
mount_path: "/karya",
asset_prefix: "/dashboard-assets"
)CDN-backed paths follow the same model:
Karya::Dashboard.render_document(
mount_path: "/karya",
asset_prefix: "https://cdn.example.com/karya"
)Use these examples to understand the hosting model. The framework pages remain the place to describe host-specific mounting and auth/session behavior.
karya-dashboard is positioned as:
- coupled to the shared Karya runtime model
- added optionally by framework packages
- paired with
karya-activerecordorkarya-sequelthrough the framework that includes it
Rails uses the Active Record path. Hanami, Roda, and Sinatra use the Sequel path.
- Rails mounts the dashboard through the Rails engine path, typically under
/karya - Sinatra and Roda expose the dashboard from framework routes that return the rendered HTML document
- Hanami uses the Hanami mount path contract and shared rendering model
Common hosting failures include:
- missing
dist/asset-manifest.json - stale packaged assets after frontend changes
- incorrect asset prefix leading to broken stylesheet or module loading
- mismatch between the configured mount path and the served route
See Troubleshooting for recovery steps.