@synapse/web #
The Synapse UI, a single-page app in Svelte 5 (runes) built with Vite.
index.html mounts src/app/main.ts, which mounts App.svelte, which renders
the active page from a client router over the History API. One build runs
everywhere. The NestJS API serves it, the Tauri shells embed it, and it also
deploys on its own as a static site with nothing behind it.
src has three layers and imports flow one way, from lib to pages to app;
dependency-cruiser fails pnpm lint if that is broken. app/ is the frame:
boot, router, top bar, auth gate. pages/ is one folder per screen, nested the
way the navigation is, so the viewer, the split-PDF wizard, the exercises and
the per-course settings sit under pages/course/. lib/ is the shared
infrastructure with no screen of its own. The Loro documents and their IndexedDB
persistence sit in data/, the HTTP, LAN and file-pack sync engines in sync/,
the upload and export pipelines in documents/, then the Tiptap editor, the AI
client and the Paraglide message catalogs. pdf.js is a bundled dependency loaded on
demand, so the viewer behaves the same in dev, in the built app and in the
shells.
The workspace on the device is the source of truth, which is why pages call the
repositories in lib/data/repos/ and never fetch study data over HTTP. Adding a
server endpoint for something a document field could carry is almost always the
wrong move. Read Architecture before changing the
data layer.
The scripts, the tests and the i18n rules are in Development.