- comics: reads pages straight out of the archive on demand. No extraction pass, so a 200-page CBZ is not materialised for a reader who views three pages. Pages are read into memory and served via http.ServeContent, which gives Range for free. - natural page ordering: page2 sorts before page10. Lexical ordering shuffles a numbered archive, which is the difference between a readable book and a scrambled one. - skips __MACOSX and dotfiles; rejects archives with no images. - cover is the first page. - media.Item gained ModTime (from the backing file) so page responses carry a Last-Modified and support conditional GETs. - web: ComicReader with a bounded prefetch window (two pages each way), page jump, keyboard nav, and progress stored as a page number. Verified: 3-page CBZ served in natural order, out-of-range 404, cover from page 1, progress round-trip. svelte-check 0/0. |
||
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||
| embed.go | ||
| index.html | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| svelte.config.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
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.