mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-27 01:20:31 +03:00
* feat: remove mongo and all of its deps * feat: remove all mongodb logic+thin out some unused deps
tachi-seeds-webui
The seeds workstation. Browse, query, diff over git history - and, in
localdev, edit db/seeds/*.json directly.
Running
# Local dev (editing enabled, spawns a Vite dev server on :3100)
just seeds-webui
# Build a static, read-only bundle (no editing)
cd typescript/seeds-webui && bun run build
Shape
- Static SPA in prod. Hosted at
seeds.tachi.ac. No backend; reads commit history from the GitHub REST API and the current seeds from a pre-built/seeds-bundle/snapshot shipped with the site. - Dev mode adds a Vite plugin (
dev/vite-plugin-seeds-dev.ts) that mounts/__seeds/*against the local repo'sdb/seeds/. That plugin is only loaded duringvite dev;vite buildnever includes it. - In-browser SQLite (
@sqlite.org/sqlite-wasm+ OPFS) for queries. The worker atsrc/lib/sqlite/worker.tsingests collections on first load and caches them in OPFS by content hash. - Drafts are queued in IndexedDB. The Drafts drawer composes them into
JSON Patches and calls
transport.writeCollection, which in dev mode rewrites the file and re-runssort-seeds.js.
Edit-mode safety
Two locks:
VITE_SEEDS_EDIT_MODEis set to the literalfalseduringvite build, so everyEDIT_MODE-guarded branch is tree-shaken out of the prod bundle.- At runtime, the transport additionally probes
/__seeds/pingbefore unlocking edit paths. A static host where somebody deploys a dev build by mistake will still act read-only.