Skip to content

Overview

  • File: src/pages/private/_layout.svelte

The private layout component serves as the main wrapper for all authenticated pages in the HVC Web application. It provides the base structure, authentication checks, and common UI elements that appear across all private pages.

Component Architecture

Dependencies

Custom Components

Features

  1. Authentication & User Management

  • Maintains user session state
  • Handles forced logout scenarios
  • Redirects unauthenticated users
  • Terms of Service (TOS) acceptance verification
svelte
$: if (user) {
  if (!user.tosAccepted) {
    $goto("/private/terms");
  } else if (window.location.href.endsWith("/private")) {
    $goto($homePage || "/private/dashboard");
  }
}
  1. Layout Structure

text
+------------------------+
|       Top Bar         |
+------------------------+
|   Notification Banner  | (conditional)
+------------------------+
|                      |
|    Content Area      |
|      <slot />        |
|                      |
+------------------------+
  1. State Management

  • Uses Svelte stores for global state:
    • isReady: Application readiness state
    • domainError: Connection/domain error state
    • showChat: Chat visibility toggle
    • userInfo: User information
    • forceLogout: Logout trigger

Released under the MIT License.