docs: add comprehensive reader implementation plan
Add detailed 8-week implementation plan for ebook, comic, and manga reader with hybrid architecture, panel detection, offline support, and libre fonts. Key Features: - Hybrid reader architecture: Shared infrastructure + specialized components - Ebook reader: EPUB parsing, HTML rendering, CFI navigation, typography engine - Comic reader: Grid-based + ML + manual panel detection, zoom animations - Manga reader: RTL navigation, vertical scroll mode - Offline support: PWA with service worker, cached pages - Dictionary: Offline-capable word lookup - Annotations: Bookmarks, highlights, notes (reuses existing DB schema) - Reading statistics: Speed tracking, time estimation - KOReader-style progress: Pages, chapter-relative, percentage, time-left Theming Strategy: - UI Chrome: All 11 Bookhoard themes - Ebook text: 5 reading-optimized themes (light, sepia, dark, night, high-contrast) - Comics/manga: All 11 themes (visual content works well with colors) Typography: - 8 bundled libre fonts (~1.2MB WOFF2): Literata, Crimson Text, Source Serif 4, EB Garamond, Libertinus, Noto Serif, Charis SIL, IBM Plex - Standard weights only (400, 400i, 700, 700i) - Font acquisition script included - Offline-ready (no network requests for fonts) Database Schema: - panel_data: Hybrid panel detection (grid/ML/manual) - reading_speed: Per-user reading speed tracking - dictionary_cache: Offline dictionary support - reader_settings: Per-user preferences (DB + localStorage fallback) API Endpoints: - 10 new reader routes (/api/readers/*) - Lazy-loading page cache (5-page ahead) - WebSocket integration for real-time sync - Bruno API tests included Phased Timeline: - Week 1-2: Infrastructure & basic reader - Week 3-4: Comic/manga features - Week 5-6: Advanced features - Week 7: Offline support - Week 8: Polish & testing Code Reuse: - Reuses existing WebSocket sync, progress tracking, annotations - Surgical code edits (extend, don't duplicate) - Follows existing Bookhoard patterns and conventions Includes: - Database schema changes (SQL) - API endpoint specifications - TypeScript type definitions - Frontend architecture (SSR-first with Alpine.js) - Integration test patterns - Bruno OpenCollection YAML tests - User and developer documentation locations Estimated total implementation time: 8 weeks
This commit is contained in: