thorium-reader
A cross platform desktop reading app, based on the Readium Desktop toolkit
Top Related Projects
The official source code repository for the calibre ebook manager
A modern ebook manager and reader with sync and backup capacities for Windows, macOS, Linux and Web
An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
A Java ePub reader and parser framework for Android.
A cross platform desktop reading app, based on the Readium Desktop toolkit
Enhanced eBooks in the browser.
Quick Overview
Thorium Reader is an open-source, cross-platform EPUB reader developed by EDRLab. It aims to provide a user-friendly, accessible, and feature-rich reading experience for digital publications, with a focus on supporting EPUB3 and other open standards.
Pros
- Cross-platform compatibility (Windows, macOS, Linux)
- Strong focus on accessibility features
- Support for multiple e-book formats, including EPUB2, EPUB3, and PDF
- Active development and regular updates
Cons
- Limited customization options compared to some commercial e-readers
- May have occasional performance issues with large libraries or complex EPUB files
- Learning curve for some advanced features
- Relatively small user community compared to more established e-readers
Getting Started
To get started with Thorium Reader:
- Visit the Thorium Reader releases page on GitHub.
- Download the appropriate installer for your operating system (Windows, macOS, or Linux).
- Install the application following the standard installation process for your OS.
- Launch Thorium Reader and start importing your e-books by clicking the "+" button in the library view.
- To open a book, simply click on its cover in the library.
For developers interested in contributing to the project:
- Clone the repository:
git clone https://github.com/edrlab/thorium-reader.git
- Install dependencies:
npm install
- Run the development version:
npm run start:dev
For more detailed instructions, refer to the CONTRIBUTING.md file in the repository.
Competitor Comparisons
The official source code repository for the calibre ebook manager
Pros of Calibre
- More comprehensive e-book management features, including library organization and metadata editing
- Supports a wider range of e-book formats and conversion options
- Larger and more active community, resulting in frequent updates and extensive plugin ecosystem
Cons of Calibre
- Heavier and more resource-intensive application
- User interface can be overwhelming for new users due to the abundance of features
- Less focus on modern, streamlined reading experience compared to Thorium Reader
Code Comparison
Thorium Reader (TypeScript):
export function isPublicationDocument(document: Document): boolean {
return document.documentElement.classList.contains("publication");
}
Calibre (Python):
def is_ebook_file(path):
return (os.path.exists(path) and os.path.isfile(path) and
os.path.splitext(path)[1].lower() in ebook_extensions)
Both examples show functions for identifying e-book files or documents, but Calibre's approach is more file-system oriented, while Thorium Reader's is DOM-based, reflecting their different architectures and primary use cases.
A modern ebook manager and reader with sync and backup capacities for Windows, macOS, Linux and Web
Pros of Koodo Reader
- More extensive file format support, including PDF, EPUB, MOBI, and TXT
- Built-in dictionary and translation features
- Customizable reading interface with themes and font options
Cons of Koodo Reader
- Less focus on accessibility features compared to Thorium Reader
- Not as actively maintained, with fewer recent updates
- Lacks some advanced EPUB3 support features present in Thorium Reader
Code Comparison
Thorium Reader (TypeScript):
export function isPublicationDocument(
document: Document | XMLDocument
): document is Document {
return document && typeof (document as any).documentElement !== "undefined";
}
Koodo Reader (JavaScript):
const handleShortcuts = (e) => {
if (e.key === "ArrowLeft") {
handlePreviousPage();
} else if (e.key === "ArrowRight") {
handleNextPage();
}
};
Both projects use different programming languages and have distinct approaches to handling e-book functionality. Thorium Reader focuses on EPUB-specific features and type safety, while Koodo Reader implements more general e-book reading capabilities with a broader range of supported formats.
An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
Pros of KOReader
- Supports a wider range of file formats, including PDF, DJVU, and CBZ
- Offers more advanced customization options for reading experience
- Designed for e-ink devices, providing better battery life and screen optimization
Cons of KOReader
- Less polished user interface compared to Thorium Reader
- Steeper learning curve for new users due to more complex features
- Limited support for DRM-protected content
Code Comparison
KOReader (Lua):
local ReaderUI = require("apps/reader/readeruiMenu")
local ReaderView = require("ui/widget/readerview")
function ReaderUI:init()
self.view = ReaderView:new()
-- Additional initialization code
end
Thorium Reader (TypeScript):
import { ReaderView } from "./ReaderView";
class ReaderUI {
private view: ReaderView;
constructor() {
this.view = new ReaderView();
// Additional initialization code
}
}
Both projects use similar architectural patterns, but KOReader is written in Lua while Thorium Reader uses TypeScript. KOReader's codebase is more focused on e-ink device optimization, while Thorium Reader emphasizes cross-platform compatibility and modern web technologies.
A Java ePub reader and parser framework for Android.
Pros of FolioReader-Android
- Specifically designed for Android, offering native performance and integration
- Includes built-in audiobook support
- Provides a customizable UI with themes and font options
Cons of FolioReader-Android
- Limited to Android platform, lacking cross-platform compatibility
- Less frequent updates and maintenance compared to Thorium Reader
- Smaller community and fewer contributors
Code Comparison
FolioReader-Android (Java):
public class FolioReader {
private static FolioReader singleton = null;
public static FolioReader get() {
if (singleton == null) singleton = new FolioReader();
return singleton;
}
}
Thorium Reader (TypeScript):
export class PublicationViewConverter {
public convertDocumentToView(document: R2Publication): PublicationView {
const publicationView = new PublicationView();
publicationView.documentTitle = document.Metadata.Title;
return publicationView;
}
}
The code snippets show different approaches:
- FolioReader-Android uses a singleton pattern for the main reader class
- Thorium Reader employs a converter class for transforming publication data
Both projects aim to provide e-book reading capabilities, but Thorium Reader offers cross-platform support and more frequent updates. FolioReader-Android, while more focused on Android, includes additional features like audiobook support. The choice between them depends on the specific platform requirements and desired features.
A cross platform desktop reading app, based on the Readium Desktop toolkit
Pros of Thorium-reader
- Active development with frequent updates and bug fixes
- Cross-platform support for Windows, macOS, and Linux
- Extensive documentation and user guides available
Cons of Thorium-reader
- Larger file size and resource usage compared to some alternatives
- Learning curve for new users due to advanced features
Code Comparison
Both repositories contain the same codebase for Thorium-reader, so there are no significant code differences to compare. However, here's a sample of the main entry point for the application:
const { app, BrowserWindow } = require('electron');
const path = require('path');
function createWindow() {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
});
win.loadFile('index.html');
}
app.whenReady().then(() => {
createWindow();
});
This code snippet is common to both repositories and demonstrates the basic structure of the Electron-based application.
Enhanced eBooks in the browser.
Pros of epub.js
- Lightweight JavaScript library for rendering EPUB files in browsers
- Highly customizable with extensive API for developers
- Supports a wide range of EPUB features and rendering options
Cons of epub.js
- Requires more development effort to create a full-featured reader application
- Limited built-in UI components, focusing primarily on rendering engine
- May require additional libraries for advanced features like annotations or DRM support
Code Comparison
epub.js:
var book = ePub("book.epub");
var rendition = book.renderTo("viewer", {width: 600, height: 400});
var displayed = rendition.display();
Thorium Reader:
import { PublicationView } from "readium-desktop/renderer/components/publication/PublicationView";
<PublicationView publicationIdentifier={publicationIdentifier} />
Summary
epub.js is a flexible, lightweight library for rendering EPUBs in web browsers, offering extensive customization options for developers. Thorium Reader, on the other hand, is a full-featured desktop application built with Electron, providing a complete reading experience out of the box. While epub.js requires more development effort to create a complete reader, it offers greater flexibility for web-based projects. Thorium Reader is better suited for users seeking a ready-to-use, cross-platform EPUB reader with advanced features like TTS and accessibility options.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Thorium Reader
Thorium Reader is an easy to use EPUB reading application for Windows 10/10S, MacOS and Linux. After importing e-books from a directory or OPDS feed, you'll be able to read on any screen size, customize layout settings, navigate via the table of contents or page list, set bookmarks ... A great care is taken to ensure the accessibility of the application for visual impaired people using NVDA, JAWS or Narrator.
Free application. No ads. No private data flowing anywhere.
This project is in constant evolution, corrections and new features will be added soon and your support is welcome for that. The application is based on the open-source Readium Desktop toolkit.
It is currently localized in following 25 languages:
- (en) English
- (fr) Français (French)
- (fi) Suomi (Finnish)
- (de) Deutsch (German)
- (es) Español (Spanish)
- (nl) Nederlands (Dutch)
- (ja) æ¥æ¬èª (Japanese)
- (ka) á¥áá áá£áá (Georgian)
- (lt) Lietuvių (Lithuanian)
- (pt-BR) Português Brasileiro (Portuguese - Brazil)
- (pt-PT) Português (Portuguese - Portugal)
- (zh-CN) ç®ä½ä¸æ - ä¸å½ (Simplified Chinese - China)
- (zh-TW) ç¹é«ä¸æ - å°ç£ (Traditional Chinese - Taiwan)
- (it) Italiano (Italian)
- (ru) Ð ÑÑÑкий (Russian)
- (ko) íêµì´ (Korean)
- (sv) Svenska (Swedish)
- (ca) Catalan
- (gl) Galician
- (eu) Euskadi (Basque)
- (el) ελληνικÏÏ (Greek)
- (bg) бÑлгаÑÑки (Bulgarian)
- (hr) Hrvatski (Croatian)
- (da) Dansk (Danish)
- (sl) SlovenÅ¡Äina (Slovene)
See: https://github.com/edrlab/thorium-reader/wiki/Localization-(l10n)-language-translations
Prerequisites
- NodeJS 18 (check with
node --version
) - NPM 9 (check with
npm --version
)
Technologies
- typescript
- electron
- reactjs
- redux
- saga
- i18next
Quick start
Install dependencies
npm install
(ornpm ci
): initialize localnode_modules
packages from dependencies declared inpackage.json
(this will also automatically call a long-running compilation stage innpm run postinstall
)- in case of failure to NPM "install" because of "Divina player" SHA integrity mismatch, please try running the following command in your shell:
node scripts/package-lock-patch.js && cat package-lock.json | grep -i divina-player-js
Start application in development environment
(with hot-reload dev server, web inspectors / debuggers)
npm run start:dev
(ornpm run start:dev:quick
to bypass TypeScript checks / launch the app faster)
Start application in production environment
npm start
(ornpm run start
)
Build installers
npm run package:win
ornpm run package:mac
ornpm run package:linux
Code Signing information: https://github.com/edrlab/thorium-reader/wiki/Code-Signing
Proxy server support
The HTTPS_PROXY
, HTTP_PROXY
, and NO_PROXY
environment variables are used to configure the behavior of a client application when making HTTP or HTTPS requests through a proxy server.
HTTPS_PROXY
: Specifies the proxy server to use for HTTPS requests. The value should be in the format http://proxy.example.com:8080.HTTP_PROXY
: Specifies the proxy server to use for HTTP requests. The value should be in the format http://proxy.example.com:8080.NO_PROXY
: Specifies a comma-separated list of hostnames or IP addresses that should not be proxied. This is useful for excluding local or intranet addresses from being proxied.
When these environment variables are set, the client application will automatically use the specified proxy server for HTTP or HTTPS requests, unless the request is for a hostname or IP address listed in the NO_PROXY variable.
we used proxy-agent
package from TooTallNate
(https://github.com/TooTallNate/proxy-agents/tree/main/packages/proxy-agent)
see https://www.npmjs.com/package/proxy-from-env#environment-variables for more information.
LCP support in Thorium Reader
Thorium Reader supports LCP-protected publications via an additional software component which is not available in this open-source codebase. When Thorium Reader is compiled from the open-source code without the additional production-grade library, the application can only load publications protected with the LCP "Basic Encryption Profile". For example, licenses generated by the open-source LCP server written in Go, without the patch that enables production-grade LCP Encryption Profiles.
In order to create a production-grade LCP-compliant variant / derivation of Thorium Reader (known as a "fork"), additional confidential software components and processes must be integrated in the custom application's build / release workflow. This represents a non-trivial amount of time and effort, as well as close collaboration between the fork's development team and EDRLab's technical staff. To cover operational costs, EDRLab charges a maintenance fee. Feel free to contact EDRlab to discuss your requirements.
Command line
thorium <cmd> [args]
Commands:
thorium opds <title> <url> import opds feed
thorium import <path> import epub or lpcl file
thorium read <title> searches already-imported publications with the
provided TITLE, and opens the reader with the
first match
thorium [path] import and read an epub or lcpl file [default]
thorium completion generate bash completion script
Positionals:
path path of your publication, it can be an absolute, relative path [string]
Options:
--version Show version number [boolean]
--help Show help [boolean]
[DEV] Architecture
Thorium-reader is composed of 3 parts:
- One node.js main process (electron back-end)
- One library window (chromium renderer)
- One to N reader window(s) (chromium renderer)
Each part runs a model-controller and a view for the renderer process.
- the model is a state container with Redux. It's based on flux architecture
- the controller is a middleware from Redux named Redux-saga. It handles all side effects and application behaviour.
- the view for the rendering is React with class components
To link these 3 parts we use:
- IPC/RPC: we use an implementation from Electron
- React/Redux: We use connect from react-redux.
Diagram
Model View Controller Architecture
API Concept
To have a POST request from a renderer process to the main process, we use the notion of API. It's not an http API but an RPC encapsuled one, to redux/redux-saga logic with Action and Reducer.
Here is a diagram of the communication:
Src:
- src/main/redux/sagas/api/api.ts
- src/common/redux/actions/api/index.ts
- src/renderer/common/redux/reducers/api.ts
At the moment there are 17 API endpoints from (src/main/redux/sagas/api):
library:
- apiapp:
- apiapp/search : search a library from apiapp protocol
- browser:
- httpbrowser/browse : browse and parse an opds URL
- opds:
- opds/getFeed : get an opdsFeed with its identifier
- opds/findAllFeed: get all opdsFeed saved
- opds/deleteFeed: delete an opdsFeed with its identifier
- opds/addFeed: add an opdsFeed
- opds/getUrlWithSearchLinks: get the search URL from an opdsFeed
- publication: (src/common/api/interface/publicationApi.interface.ts)
- publication/get: get a publicationView from id
- publication/delete: delete a publicationView from id
- publication/findAll: get all publicationView
- publication/findByTag: get all publicationView from a specific tag string
- publication/updateTags: update tags list from a publication
- publication/importFromLink: import a publication from an URL
- publication/importFromFs: import a publication from a fileSystem path
- publication/search: search publication from a query text
- publication/searchEqTitrle: search publication by title matching
- publication/exportPublication: export publication to the fileSystem
ACTION-REDUCER
From the main-process to the renderer-process, or from the renderer-process to the main-process.
List of all Actions in place (src/common/redux/actions):
- auth: opds authentication
- cancel
- done
- wipeData
- catalog
- getCatalog: ask to rehydrate catalogView in the libraryState
- setCatalogView: response from getCatalog
- setTagView: rehydrate tagStringView in the libraryState
- dialog: modal dialog view in library,reader
- closeRequest
- openRequest
- updateRequest
- download: download queue in library
- abort
- done
- progress
- history: history opds feed
- pushFeed
- refresh
- i18n
- setLocale
- import
- verify: import verification process
- keyboard: keyboard shortcut
- reloadShortcut
- setShortcut
- showShortcut
- lcp
- renewPublication
- returnPublication
- unlockPublicationWithPassphrase
- userKeyCheckRequest
- load: main proceess busy or not
- busy
- iddle
- net (not used)
- reader
- attachMode
- clipboardCopy
- closeRequest
- closeRequestFromPublication
- configSetDefault
- detachModeRequest
- detachModeSuccess
- fullScreenRequest
- openRequest
- openError
- setReduxState: trigger app persistence
- session: saved session
- enable
- toast: toast notification library,reader
- close
- open
Top Related Projects
The official source code repository for the calibre ebook manager
A modern ebook manager and reader with sync and backup capacities for Windows, macOS, Linux and Web
An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
A Java ePub reader and parser framework for Android.
A cross platform desktop reading app, based on the Readium Desktop toolkit
Enhanced eBooks in the browser.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot