edrlab / thorium-reader

A cross platform desktop reading app, based on the Readium Desktop toolkit
https://www.edrlab.org/software/thorium-reader/
BSD 3-Clause "New" or "Revised" License
1.86k stars 157 forks source link
electron epub epub-reader epub3 lcp opds opds-feed react reader redux typescript

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:

See: https://github.com/edrlab/thorium-reader/wiki/Localization-(l10n)-language-translations

library publication info reader

Prerequisites

1) NodeJS 18 (check with node --version) 2) NPM 9 (check with npm --version)

Technologies

Quick start

Install dependencies

Start application in development environment

(with hot-reload dev server, web inspectors / debuggers)

Start application in production environment

Build installers

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.

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:

Each part runs a model-controller and a view for the renderer process.

To link these 3 parts we use:

Diagram

Model View Controller Architecture

MVC

architecture diagram

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:

api

Src:

At the moment there are 17 API endpoints from (src/main/redux/sagas/api):

library:

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):