Guidance for AI assistants working on Foyer.
Foyer is a pure static SvelteKit 5 SPA (ssr = false, prerender = true, 200.html fallback) styled with Tailwind CSS 4 and @kleinbem/web-config.
src/lib/config.ts: Runtime/config.jsonparser and loader (parsePortalConfig,loadPortalConfig, URL scheme sanitization, duplicate-ID filtering). Upstream ships a neutral default instatic/config.json; fleet deployments inject site inventory via/config.json.src/lib/portal.ts: Pure domain logic for bookmark validation/creation, multi-token⌘Kpalette search (#host,@category,!network,>), category grouping, health metrics, and Open-Meteo parsing.src/lib/data/gatus.ts: Optional client-side Gatus/api/v1/endpoints/statuseshealth polling and endpoint resolution (fetchGatusSnapshot: status plus response time, check history and failure reason per endpoint).src/lib/poll.ts:startPolling, the visibility-aware poller behind the Gatus and attention-feed refresh; each call owns and aborts its own requests.src/lib/data/attention.ts: The "Needs attention" list: services that are down plus the optionalattentionUrlJSON feed (parseAttentionFeedvalidates it).src/lib/components/: Svelte 5 runes UI components (Header,WeatherWidget,HostBar,LayoutToggle,BookmarksSection,AttentionPanel,CategorySection,ServiceCard,CommandPalette). Modals use native<dialog>(showModal()).test/: Hermetic Nodenode:test+ Svelte 5 SSR test suite (test/setup.tscompiles.svelteand.svelte.js/.svelte.tson the fly with zero extra npm dependencies).nix/package.nix:nixpkgs-compliantbuildNpmPackagederivation (fetchNpmDeps,strictDeps = true,__structuredAttrs = true,checkPhase,installCheckPhase, and offline Caddypassthru.tests.smoke).
just dev # Run Vite dev server
just test # Run unit and SSR component tests
just check # Run svelte-check and TypeScript checks (--fail-on-warnings)
just build # Build static production assets
nix flake check # Run sandboxed package build, checks, installCheck, and Caddy smoke testWhen editing .svelte files, verify with npx --offline @sveltejs/mcp svelte-autofixer <file>.
typescript is aliased to @typescript/typescript6 and TypeScript 7 sits beside it as
@typescript/native: svelte-check and the Svelte tooling need the TS 6 JavaScript API, which the
native TS 7 compiler does not ship. Same setup in every fleet Svelte repo.