smartmirrordisplay - v1.0.0
    Preparing search index...

    Class default

    Application kernel — owns configuration, module lifecycle, and the HTTP/Socket server.

    Startup order: new Core(rootDir) → start(). Everything else (DB, server, helpers) is initialised inside start().

    Index
    • Parameters

      • rootDir: string

      Returns default

    allClients: ClientModuleMap
    config: ServerConfig
    defaultModuleNames: string[] = []

    Names of modules that live under modules/default/. Populated during start().

    diffModules: string[]
    expressApp: Application
    httpServer: default
    moduleHelpers: LoadedHelper[]
    rootDir: string
    socketio: Server
    • Ensures every client listed in config has a configs/<name>/ folder and an entry JS file. Clients without a folder are removed from config.clientConfigs so the rest of startup doesn't have to handle missing directories.

      Returns void

    • Builds the full module map from the DB — keyed by client name. Each entry contains the unauthenticated default modules and every assigned user's config. Clients missing a DB record are skipped with an error log.

      Returns ClientModuleMap

    • Deduplicates all module names referenced across every client and user config.

      Returns string[]

    • Loads, wires, and starts a helper on demand — called when a mirror requests a module that wasn't active at startup. No-op if the helper is already running.

      Parameters

      • moduleName: string

      Returns Promise<void>

    • Merges a flat module list with any modules embedded in a layout. Layout modules are appended only when not already present in the flat list, so an explicit flat entry always wins over the layout default.

      Parameters

      • modulesJson: string
      • layoutJson: string | null | undefined

      Returns ModuleDefinition[]

    • Resolves each user's module config for a specific mirror. Falls back from client-specific row → global row (clientName "") → empty module list.

      Parameters

      • client: string
      • users: string[]

      Returns ActiveConfig[]

    • Security gate for third-party helpers — reads and validates module.json. Returns null (blocking the helper from loading) if the manifest is missing, malformed, or declares any permission not in the known allowlist.

      Parameters

      • moduleFolder: string
      • moduleName: string

      Returns ModuleManifest | null

    • Parameters

      • moduleName: string

      Returns LoadedHelper | null

    • Loads helpers for all modules referenced in any client config at startup. Does NOT wire Express/Socket.IO yet — that happens in start() after the server is ready.

      Returns void

    • Parameters

      • moduleName: string

      Returns string

    • Returns string[]

    • Returns Promise<void>

    • Parameters

      • __namedParameters: LoadedHelper

      Returns void