The app is plain SvelteKit with npm; there is no monorepo, no Bun requirement, and no database to provision.

Toolchain

RequirementValueWhy
Node.js22 or newer (the host runs v22.23.1)isomorphic-dompurify, Vite 8 and the Svelte plugin all pin recent engines
Package managernpm with the committed package-lock.jsonkeep one lockfile
Vite^8@sveltejs/vite-plugin-svelte@7.3.0 needs peer vite ^8; vite@7 fails with ERESOLVE
SvelteKit plugin importimport { sveltekit } from '@sveltejs/kit/vite'the export was removed from @sveltejs/vite-plugin-svelte
Sanitizerisomorphic-dompurifybare dompurify throws sanitize is not a function under SSR

Build and run

From the project root (~/dev/svelte-chat on the host):

npm ci
npm run build          # vite build → build/
node build             # adapter-node entry; honours PORT, HOST and DATA_DIR

For development, npx vite --host 127.0.0.1 --port 4319 serves with HMR; npx vite preview serves the last build. Production uses scripts/deploy.sh, described in Deploy and roll back.

Assistant environment

The assistant activates only when an upstream is configured. Without it /api/status reports assistant.configured=false, @ai messages produce a system message saying no model is configured, and the UI shows “Assistant offline”.

VariableMeaning
CHAT_MODEL_URLBase URL of an OpenAI-compatible API (for example a local …/v1)
CHAT_MODELModel identifier sent to that endpoint
CHAT_MODEL_KEYOptional bearer credential; never committed, never copied between hosts

On the host the service reads them from /etc/chat/chat.env (root-owned, mode 0640, EnvironmentFile in the unit). That file is absent in the current deployment; creating it is the only step to enable the assistant. No key is stored in the repository or in this wiki.

Data directory

DATA_DIR (~/chat on the host) holds rooms/<slug>/events.jsonl and rooms/<slug>/room.json per room, both append-only or write-once. Copying the directory is a complete backup; the service needs write access to it and nothing else outside its build.

  • Architecture for the routes this build exposes.
  • Research for the pinned versions and security floor behind the toolchain table.