arbiter-servant-ui-0.1.0.0
arbiter-servant-ui
Safe HaskellNone
LanguageGHC2024

Arbiter.Servant.UI

Description

Embedded admin dashboard (Bootstrap 5 + Alpine.js, compiled-in static files).

Security: No built-in authentication. All queue management operations (view, delete, retry) are publicly accessible. Add auth middleware before exposing to untrusted networks.

Quick Start

run port $ arbiterAppWithAdmin @MyRegistry config

Custom Composition

Mount the API and admin UI under a shared prefix:

type MyApp = "arbiter" :> (ArbiterAPI MyRegistry :<|> AdminUI) :<|> MyRoutes
run port $ serve (Proxy @MyApp) ((arbiterServer config :<|> adminUIServer) :<|> myHandler)

The admin UI auto-discovers the API path from its own URL. If it loads at /arbiter/ it finds the API at /arbiter/api/v1/.

Synopsis

Servant integration

Source #type AdminUI = Raw

The admin UI route, a catch-all sitting behind the API routes.

Source #adminUIServer :: Server AdminUI

Serve AdminUI from the embedded files.

Source #adminUIServerHoisted :: (forall x. Handler x -> m x) -> ServerT AdminUI m

Hoisted variant for integration into a route tree using a custom monad.

Source #adminUIServerDevHoisted :: (forall x. Handler x -> m x) -> FilePath -> ServerT AdminUI m

Hoisted dev-mode variant for integration into a route tree using a custom monad.

Standalone WAI app

Source #adminApplication :: Application

The dashboard as a standalone WAI application over the embedded files.

Source #devAdminApplication :: FilePath -> Application

The dashboard served from disk, read per request.

Combined app helper

Source #arbiterAppWithAdmin :: forall (registry :: JobPayloadRegistry). (BuildServer registry registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => ArbiterServerConfig registry -> Application

The API at /api/v1 and the admin UI at the root, in one application.

Source #arbiterAppWithAdminDev :: forall (registry :: JobPayloadRegistry). (BuildServer registry registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => FilePath -> ArbiterServerConfig registry -> Application

arbiterAppWithAdmin serving the UI from disk.