Skip to content

Layout

The root and authenticated layouts wire the whole portal together.

Root layout (src/routes/+layout.svelte)

The bootstrap layout:

  • Sets up dayjs plugins.
  • Installs the 30 s Keycloak token refresh interval.
  • Calls GraphQL tenantInfo (realm, name, logo) and — unless the URL is /rapidConnect or /rc — initializes Keycloak via authService.init(...) with env.PUBLIC_KEYCLOAK_URL, the tenant realm, and client id hippo.
  • Mounts a global Toaster (@rkosafo/cai.components).

The root +page.svelte shows a splash spinner and redirects to appStore.homePage (default /secure/dashboard) once the user session resolves.

Secure layout (src/routes/secure/+layout.svelte)

The authenticated application shell:

  • If not logged in → spinner.
  • If appStore.domainError → dashboard error / "No Connection" panels.
  • Otherwise renders:
    • Topbar ($cmps/UI/Topbar.svelte) — logo, nav, QR code, user menu, chat, notices.
    • NotificationBanner (when the user has a notice) → markNotificationAsSeen.
    • Chat drawer (Drawer from cai.components, placement="right") hosting $features/chat/index.svelte when appStore.showChat.
    • ChatNotification and Notification (incoming-call toasts).
  • Guards: if TOS not accepted → /secure/terms; if exactly at /secure → redirect to the home page.
  • Sign-out confirmed via AlertDialog.

Other routes

  • private/[...catchAll] — legacy deep-link redirect: rewrites /private/secure.
  • secure/events/[eventId] uses a layout reset (+layout@.svelte) so the call screen is full-viewport (no topbar/chat chrome).
  • secure/terms uses a layout reset with its own blue terms topbar.
  • rapidConnect/[eventId] / rc/[eventId] — anonymous Rapid Connect pages.
  • unknown — "There's been a glitch" (invalid tenant).

Released under the MIT License.