rewrite phi.zzstoatzz.io frontend in svelte 5 + sveltekit (adapter-static)
the previous site (~870 lines of python-emit-html with inline JS) showed
phi as an operational service — uptime, mentions, a flat activity feed.
phi has changed enormously since: goals, an active observations pool,
discovery, blog docs, skills, mention consent, durable PDS state. none
of it was visible.
this rewrite surfaces phi's actual mind state.
architecture:
- bot/web/ — sveltekit project (svelte 5 runes, typescript, adapter-static)
- builds to bot/web/build/, copied into the docker runtime stage
- FastAPI mounts the build at / as a SPA fallback
- python keeps the API endpoints (/api/activity, /api/memory/graph,
/api/control/*, /health); the sveltekit app calls them via fetch.
vite dev proxies /api and /health to localhost:8000 for local dev.
routes:
- / home: active observations + goals + collapsed activity
- /feed filterable post/note/bookmark stream (the old home)
- /mind d3 memory graph (ported), with placeholder for browser/archive
- /blog greengale long-form posts with excerpts + tags
- /discovery hub's discovery pool (operator's recent likes)
- /skills registered skill packs with descriptions
- /status runtime health metrics
files:
- bot/web/{package.json,svelte.config.js,vite.config.ts,tsconfig.json}
- bot/web/src/{app.html,app.css,app.d.ts}
- bot/web/src/lib/{api.ts, types.ts, time.ts}
- bot/web/src/lib/components/{Nav, StatusPill, GoalCard, ObservationCard,
PostCard, BlogCard, DiscoveryCard, MemoryGraph}.svelte
- bot/web/src/routes/{+layout, +page, feed/, mind/, blog/, discovery/,
skills/, status/}/+page.svelte
deployment:
- Dockerfile: new web-builder stage (oven/bun:1-slim) runs bun install +
bun run build; runtime stage copies /web/build → /app/web
- bot/src/bot/main.py: removed home_page/status_page/memory_page routes;
mounts settings.web_build_dir (/app/web) as SPA with index.html
fallback for unknown routes
- bot/src/bot/config.py: new web_build_dir setting
- bot/src/bot/ui/__init__.py: removed pages.py exports (the python
template module is deleted entirely); ui/ now only holds the JSON
activity router
- bot/src/bot/ui/pages.py: deleted (replaced by sveltekit)
verified:
- bun run check: 0 errors
- bun run build: 288kb static output
- docker build: passes; /app/web/{index.html, _app/, favicon.svg} present
in the image at runtime
- 102 python tests still pass
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
This is a binary file and will not be displayed.