$ show koodo-reader/koodo-reader
Koodo Reader is a cross-platform ebook reader application supporting a wide range of formats (EPUB, PDF, MOBI, AZW3, TXT, FB2, CBR/CBZ, MD, DOCX, HTML, etc.). It is built as an Electron desktop app with a React/TypeScript frontend and a separate Go HTTP server for OPDS catalog serving and KOReader sync. The application provides a full-featured reading experience including bookmarks, notes, highlights, text-to-speech (with multiple voice engines), translation and dictionary lookup (via built-in and custom plugins), OCR for scanned PDFs, and cloud sync/backup across many providers (WebDAV, S3, OneDrive, Google Drive, Dropbox, etc.). It also includes a library management system with shelves, tags, search, and import from local files, folders, URLs, and OPDS catalogs. The architecture is a monolith with a clear separation between the Electron main process (Node.js) and the renderer (React), plus an optional Go server for network-facing features. The codebase is large and feature-rich but shows signs of technical debt: widespread use of deprecated React lifecycle methods, heavy reliance on opaque minified libraries (kookit-extra), frequent `as any` type casts, and mixed Chinese/English comments. Despite these issues, the application is actively maintained and offers a robust set of features for ebook enthusiasts.
The LLM identified 5 files worth highlighting for reuse:
A self-contained full-screen protection overlay that supports PIN code entry, password, and biometric authentication (macOS Touch ID, Windows Hello). It is themable via CSS and can be dropped into any React application needing a lock screen. The component manages its own state (PIN input, error handling, biometric retry) and communicates via callbacks, making it reusable without tight coupling to the rest of the app.
An Emscripten-compiled 7-Zip WASM module exposed as a UMD library. It provides a self-contained archive extraction and compression utility that works in browsers, Node.js, and Web Workers. The module initializes asynchronously (via `Module['ready']`) and supports MEMFS, NODEFS, and WORKERFS file systems. This is a highly reusable asset for any project needing archive operations without native dependencies.
Defines the built-in plugin catalog for translation, dictionary, and TTS plugins. Each plugin entry includes metadata (name, ID, description, languages, default config, icon) and is used to generate the plugin market UI. The catalog pattern is cleanly separated from plugin execution logic, making it easy to add, remove, or override plugins. The typed interface (`PluginCatalogItem`) ensures consistency and could be extracted as a standalone plugin registry for other applications.
Contains an `AsyncQueue` class that serializes asynchronous tasks, ensuring they execute one at a time. This is used to manage cover image loading and processing without race conditions. The pattern is generic and can be extracted for any scenario requiring sequential async execution (e.g., throttling API calls, ordered file writes). The implementation is minimal and well-encapsulated.
A full-featured text-to-speech player component that integrates system speech synthesis and custom voice plugins. It supports play/pause/stop, speed control, sentence-level navigation, multi-role AI speech, and voice preview. The component is self-contained with its own CSS and state management, and communicates via props and callbacks. It can be reused in any application needing a TTS interface with plugin extensibility.