An open API service indexing awesome lists of open source software.

https://github.com/claritas-rs/claritas

A minimal, keyboard-friendly EPUB reader for the desktop built with Rust and Dioxus.
https://github.com/claritas-rs/claritas

desktop-app dioxus ebook epub gui linux reader rust

Last synced: 2 months ago
JSON representation

A minimal, keyboard-friendly EPUB reader for the desktop built with Rust and Dioxus.

Awesome Lists containing this project

README

          


A minimalist, fast and keyboard-friendly EPUB & PDF reader built entirely in Rust, running as a native desktop app via Dioxus.

---

### What's new in v1.5.2

- Added **CSV import** for reading stats so users can restore exported history without losing data
- Enhanced **CSV export** with each book's last reading position (chapter/spread or page)
- Added per-book activity tracking and export fields for pages, chapters and finished books

**Full Changelog:** https://github.com/claritas-rs/claritas/compare/v1.5.1...v1.5.2

### Features

| Feature | Description |
| :-----: | :--------------------------------------------------------------------------- |
| Auto | Auto-scans `~/Documents/Claritas` on startup and loads all EPUB/PDF files |
| Import | Import EPUB/PDF files manually or simply **drag and drop** into the library |
| Search | Live search across titles and authors in the library |
| Find | In-book text search with instant **yellow highlighting** (EPUB & PDF) |
| Time | Live **estimated reading time** for the current chapter (EPUB) |
| Sort | Organises books into **Continue Reading**, **Library** and **Read** sections |
| Stats | Tracks your reading stats with **CSV import/export** + position and activity details |
| Save | Persists reading progress and book status across sessions |
| Keys | Keyboard navigation — arrow keys to flip pages / chapters |
| Cover | Displays embedded cover images with graceful fallback |
| Theme | Dark minimal UI with a two-page spread reader layout (EPUB & PDF) |
| Core | 100% Rust — modular zero JS runtime core for maximum performance |

---

### Technologies






Dioxus • Tokio • Rayon • epub-rs • PDF.js • serde_json • base64 • image • rfd

---

### Structure

```
Claritas/
├── install.sh # One-step installer (binary + icons + .desktop)
├── claritas_core/ # Library — EPUB parsing, progress & status persistence
│ └── src/
│ └── lib.rs
└── claritas_desktop/ # Desktop app — UI built with Dioxus
├── assets/
│ ├── icon.png # App icon (512 × 512)
│ ├── claritas.desktop # .desktop entry template
│ └── style.css
└── src/
├── main.rs # App root, sidebar, search & screen routing
├── library.rs # Library view — grid, sections, book cards, import menu
└── reader.rs # Reader view — two-page spread, pagination, status bar
```

---

### Getting Started

#### Development

```bash
# Clone the repository
git clone https://github.com/claritas-rs/claritas.git
cd Claritas

# Run in development mode
cargo run -p claritas_desktop

# Build for release
cargo build --release -p claritas_desktop
```

> **Note:** On first launch Claritas scans `~/Documents/Claritas` for EPUB/PDF files.
> To change the default directory, update the path in `claritas_desktop/src/main.rs`.

#### Benchmarks & Profiling

The project is equipped with micro-benchmarks for the Rust core and `tracing` telemetry for the Dioxus frontend.

**Core Benchmarks (Criterion):**
To measure the performance of the EPUB engine (loading chapters, highlighting search results, splitting pagination):
```bash
cargo bench -p claritas_core
```
*Note: This requires an EPUB file located at `claritas_core/tests/fixtures/alice.epub`.*

**Baseline Performance (Alice in Wonderland EPUB):**
- **Open and parse:** ~0.73ms
- **Extract chapter & resolve images:** ~0.87ms
- **Calculate pagination limits:** ~0.27ms
- **Full-text highlighting search:** ~11.0ms

**Desktop Profiling (Tracing):**
To measure the real-world execution time of the Dioxus frontend (e.g., how long it takes to scan the library or paint the Virtual DOM), simply run the app via the terminal. The performance telemetry will be printed to standard output:
```bash
cargo run -p claritas_desktop
```

---

### Installation (Linux)

The included `install.sh` script builds the release binary and sets up proper desktop integration — icon sizes, `.desktop` entry and a launcher in `~/.local/bin`.

```bash
# From the repository root
bash install.sh
```

What the script does:

| Step | Action |
| :--: | :----- |
| 1 | Runs `cargo build --release -p claritas_desktop` |
| 2 | Installs the binary to `~/.local/bin/claritas_desktop` |
| 3 | Copies the icon to `~/.local/share/icons/hicolor/x/apps/` for sizes 48, 64, 128 and 256 |
| 4 | Installs `claritas.desktop` to `~/.local/share/applications/` |
| 5 | Refreshes icon and desktop database caches |

After installation, Claritas will appear in your application launcher and can be pinned to the taskbar.

> **PATH note:** If `~/.local/bin` is not in your `$PATH`, the script will remind you to add
> `export PATH="$HOME/.local/bin:$PATH"` to your `~/.bashrc` or `~/.profile`.

---

### Usage

| Action | How |
| :------------------------ | :------------------------------------------------------- |
| Open a book | Click the cover |
| Next / previous page | `→` / `←` arrow keys or the on-screen arrows |
| Search library | Type in the **Search** box in the sidebar |
| Search inside book | Press `Ctrl+F` or click the ⌕ icon while reading |
| Import EPUB/PDF files | **Drag & Drop** files, or use the **Import ▾** menu |
| Check reading time | Look at the status bar at the bottom of the reader (EPUB)|
| Export Stats as CSV | Go to Reading Stats and click **Export CSV** |
| Open book menu | Click **⋮** next to the book title |
| Mark as Currently Reading | Book menu → **Mark as Currently Reading** |
| Mark as Read | Book menu → **Mark as Read** |
| Move back to Library | Book menu → **Move to Library** |
| Remove from library | Book menu → **Remove from Library** |

---

### Author



GitHub


LinkedIn