A browser-based EPUB reader with text-to-speech. No backend — open an EPUB and listen.
- EPUB 2 / EPUB 3 support — parses
container.xml → OPF → spine - Text-to-speech using the browser's native Web Speech API
- Sentence highlighting — current sentence highlighted and auto-scrolled into view
- Chapter navigation with table of contents sidebar
- Speed control — 0.5× to 2.0×
- Voice selection — all system voices, sorted by language match
- Mobile-first — responsive layout with sidebar drawer on mobile, static sidebar on desktop
Hosted on GitHub Pages: https://roy2100.github.io/readbook/
git clone https://github.com/roy2100/readbook.git
cd readbook
npm install
npm run dev
# Open http://localhost:5173 in Chrome or SafariRequires Web Speech API support. Recommended: Chrome or Safari on macOS (access to high-quality system voices including Siri voices).
npm install # install dependencies
npm run dev # dev server with HMR
npm run build # production build → dist/
npm test # run all 105 tests (single pass)
npm run test:watch # watch modeTests use Vitest with jsdom. Coverage spans EPUB parsing, sentence segmentation, HTML escaping, and the TTS state machine.
epub-parser.js EPUB unzip + OPF/spine/TOC parsing
highlighter.js Sentence segmentation + DOM annotation + highlight state
tts.js Web Speech API wrapper (sentence queue, pause/resume)
utils.js normalizePath() for resolving image paths inside ZIP
App.jsx Root component — wires state, chapter navigation, image resolution
components/ Sidebar, Reader, Controls, Header (React components)
hooks/ useBook, useIsMobile, useTts (custom hooks)
See CLAUDE.md for a detailed architecture description.