Operating Svelte Chat is one systemd unit, one loopback port, one symlink swap, and one nginx site file; this wiki is a separate static root built by the shared Quartz grid.

Runtime topology

LayerLive configurationOperational meaning
Unitchat.service, system scope, User=loca, hardened like the other loca.zone Node unitssystemctl status chat is the health check
Listener127.0.0.1:51919inside the loca.zone 51000–53000 backend convention; never exposed directly
Entry/usr/bin/node build/index.js in ~/dev/svelte-chatbuild is a symlink to a timestamped build-<UTC ts> directory
DataDATA_DIR=~/chatrooms/<slug>/events.jsonl and room.json; back up by copying
Assistant env/etc/chat/chat.env (EnvironmentFile, root-owned 0640)absent by default; see [[setup#Assistant environment
Edgenginx site chat.loca.zone with one Let’s Encrypt certificate covering chat.loca.zone and wiki.chat.loca.zoneproxy for the app, static root for this wiki

Deploy and roll back

scripts/deploy.sh in the project runs npm ci && npm run build into build-tmp, renames it to build-<UTC ts>, repoints the build symlink and restarts the unit. Previous builds stay on disk with their timestamps, so rolling back never rebuilds:

ln -sfn build-<older-ts> build && sudo systemctl restart chat

Status checks

CheckCommand or URLExpect
Unitsystemctl is-active chatactive
App shellhttps://chat.loca.zone/HTTP 200, title Chat · loca.zone
Factshttps://chat.loca.zone/api/status{ assistant: { configured, model }, rooms }
Wikihttps://wiki.chat.loca.zone/HTTP 200, title Svelte Chat

Assistant status

The deployed instance runs with the assistant unconfigured: no key-free OpenAI-compatible model exists on this host and credentials are never copied between services. Enabling it means creating /etc/chat/chat.env with the variables from Assistant environment and restarting the unit; nothing else changes.

Wiki build

Content lives in ~/dev/wikis/chat/content, configuration in ~/dev/wikis/chat/quartz.config.yaml. Build with the shared grid script, which swaps the current symlink atomically and keeps the last five builds:

~/dev/wikis/build.sh chat

nginx serves ~/dev/wikis/chat/current for wiki.chat.loca.zone. Never edit the shared Quartz engine for a per-wiki change; the script copies this wiki’s config in and restores the engine state afterwards.