How limitless-soul1/sard works
Sard is a Windows-first desktop ebook reader: users import or open EPUB/PDF books, read and annotate them, and manage their library and reading preferences locally. The React UI communicates with a Rust/Tauri core over typed IPC; the core persists application data in SQLite. Reading uses a Foliate-based engine, with a hosted transport path where required by WebKit. The README documents capabilities that are not all represented in sampled source; those are shown as product subsystems without guessing their internal call paths.
Main entry points: App.tsx App shell · commands/mod.rs Typed IPC · FoliateController.ts Reading engine · library/mod.rs Library records
Components 24
Desktop app
- App shell
src/App.tsx - Frontend IPC
src/lib/ipc.ts
Library and books
- Library UI
src/features/library/Library.tsx - Book import
src-tauri/src/books/mod.rs - Library records
src-tauri/src/library/mod.rs - Shelf placement
src-tauri/src/library/placement.rs - Library structure
src-tauri/src/library/structure.rs - Reading deposits
src-tauri/src/deposit/mod.rs - Image cards
src-tauri/src/photocards.rs
Reading experience
- Reader UI
src/features/reader/Reader.tsx - Reading engine
src/reader-engine/FoliateController.ts - Reader host
src/reader-host/main.ts - Reader transport
src/reader-transport/hosted.ts - Book styling
src/reader-engine/injectedCss.ts - Book search
public/foliate-js/search.js - Read-aloud UI
src/lib/tts.ts
Personalization
- Reading profiles
src/features/profiles/store.ts - Themes
src/theme/tokens.ts - Backgrounds
src/lib/background.ts
Rust core and storage
- Speech service
src-tauri/src/tts.rs - Typed IPC
src-tauri/src/commands/mod.rs - SQLite database
src-tauri/src/db/mod.rs - Schema migrations
src-tauri/src/db/migrations.rs
Other components
- Reader
Connections 29
- Reader → App shell: uses
README.md - App shell → Library UI: opens library
README.md - App shell → Reader UI: opens book
README.md - App shell → Frontend IPC: requests data
src/App.tsx - Library UI → Frontend IPC: loads books
- Reader UI → Reading engine: controls reading
- Reading engine → Book styling: styles pages
src/reader-engine/FoliateController.ts - Reading engine → Book search: searches text
- Reading engine → Reader host: runs in host
src/reader-host/main.ts - Reader transport → Reading engine: creates reader
src/reader-transport/index.ts - Reader transport → Reader host: connects host
- Reader UI → Read-aloud UI: offers read-aloud
README.md - Read-aloud UI → Speech service: requests speech
- App shell → Reading profiles: applies profiles
README.md - App shell → Themes: applies themes
src/App.tsx - App shell → Backgrounds: applies backgrounds
src/App.tsx - Frontend IPC → Typed IPC: invokes commands
- Typed IPC → SQLite database: reads and writes
src-tauri/src/commands/mod.rs - Typed IPC → Book import: dispatches imports
src-tauri/src/commands/mod.rs - Typed IPC → Library records: dispatches library calls
src-tauri/src/commands/mod.rs - Typed IPC → Reading deposits: dispatches deposit calls
src-tauri/src/commands/mod.rs - Typed IPC → Image cards: dispatches card calls
src-tauri/src/commands/mod.rs - Typed IPC → Speech service: dispatches speech calls
- SQLite database → Schema migrations: runs migrations
src-tauri/src/db/mod.rs - Library records → Shelf placement: uses placement
src-tauri/src/library/mod.rs - Library records → Library structure: uses structure
src-tauri/src/library/mod.rs - Book import → Shelf placement: reconciles placement
src-tauri/src/books/mod.rs - Reading deposits → Book import: uses book records
src-tauri/src/deposit/mod.rs - Reading deposits → Library records: uses library records
src-tauri/src/deposit/mod.rs