Vellum/web
mithral cebe1977e4 Web: per-user library grants UI
Multi-user was the central design decision and grants were API-only, which
made the whole thing unusable from the browser.

- Users screen lists each account with an expandable library panel.
- Read and Download checkboxes per library, loaded lazily per user.
- Clearing both flags deletes the grant, so "no grant" and "granted nothing"
  stay the same state rather than two representations of the same thing.
- Admins show a note instead of checkboxes: they read every library by design.

Verified end to end: granted library visible and its items readable, ungranted
library 404s on both item access and search, revoke takes effect immediately.
2026-10-09 21:24:04 -04:00
..
src Web: per-user library grants UI 2026-10-09 21:24:04 -04:00
.gitignore Web UI: Svelte app, embedded into the binary 2026-10-09 16:40:58 -04:00
embed.go Web UI: Svelte app, embedded into the binary 2026-10-09 16:40:58 -04:00
index.html Web UI: Svelte app, embedded into the binary 2026-10-09 16:40:58 -04:00
package.json Web UI: Svelte app, embedded into the binary 2026-10-09 16:40:58 -04:00
pnpm-lock.yaml Web UI: Svelte app, embedded into the binary 2026-10-09 16:40:58 -04:00
pnpm-workspace.yaml Web UI: Svelte app, embedded into the binary 2026-10-09 16:40:58 -04:00
README.md Web UI: Svelte app, embedded into the binary 2026-10-09 16:40:58 -04:00
svelte.config.js Web UI: Svelte app, embedded into the binary 2026-10-09 16:40:58 -04:00
tsconfig.json Web UI: Svelte app, embedded into the binary 2026-10-09 16:40:58 -04:00
vite.config.ts Web UI: Svelte app, embedded into the binary 2026-10-09 16:40:58 -04:00

Vellum web

Svelte 5 + Vite + TypeScript single-page app. It is built to a static bundle in dist/ and embedded into the Go binary, so all asset paths are relative (base: './' in vite.config.ts).

Commands

pnpm install
pnpm dev      # dev server on :5173, proxying /api to :7788
pnpm build    # writes dist/
pnpm check    # svelte-check

Run the Go server on :7788 (make run from the repo root) and pnpm dev proxies API and health requests to it, so cookies and sessions behave exactly as they will in production.

Layout

src/
  main.ts                 entry point
  App.svelte              login gate -> shell
  app.css                 design tokens and base styles
  lib/
    api.ts                typed client; mirrors the Go handlers
    session.ts            auth + library stores
    nav.ts                view state
    components/
      Login.svelte
      Shell.svelte        nav + view switch
      Libraries.svelte    library list, create, scan, delete
      LibraryView.svelte  item grid with covers
      Reader.svelte       epub.js reader with progress sync
      Users.svelte        admin user management

The reader resumes from a spine index, which is why progress positions are integers: it round-trips through the polymorphic progress table without needing a text column.