Skip to content

Development

SamsterZero edited this page Aug 14, 2026 · 3 revisions

Development

Granthalay uses SvelteKit 2, Svelte 5 runes, TypeScript, Tailwind CSS 4, JSZip, sanitize-html, and Zod. The current application builds as a static site.

bun install
bun run dev

Useful commands:

Command Purpose
bun run check Svelte and TypeScript diagnostics
bun run lint Prettier and ESLint checks
bun run test Unit and EPUB regression tests
bun run format Apply repository formatting
bun run build Produce the static build
bun run preview Preview the production build

Treat EPUB content as hostile input. Keep sanitization in the parse path, normalize archive paths, revoke object URLs, and never render unsanitized HTML. Storage changes must upgrade existing IndexedDB data safely.

The EPUB regression suite generates original EPUB 2, EPUB 3, and malformed archives in memory. It tests package discovery, spine order, NCX and EPUB navigation, CSS, raster images, and SVG without shipping third-party book content.

Use Zod at untrusted configuration and API boundaries. Pino is reserved for structured backend logs and must not enter the PWA bundle. Sentry is optional and must follow the privacy rules in Data and Privacy.

Read the repository's contribution guide and project guide before making large reader, storage, security, or future server changes.

Clone this wiki locally