Skip to main content
Version: v5.4.0

Stack

OpenReader is a pnpm workspace written in TypeScript. The architecture is described in the repository's v5/ documents.

PackageRole
Root appNext.js app: sign-in, library, reader, settings, API routes
packages/compute-workerSpeech generation, alignment, PDF layout, previews, conversion, exports
packages/ttsProvider clients shared by the app and worker
packages/databaseDrizzle schemas and migrations for SQLite and Postgres
packages/bootstrapStartup: configuration checks, migrations, and the embedded services
packages/runtime-configConfiguration shared by the app and worker
desktop/Electron shell for the desktop app (a separate project)

App​

TTS providers​

packages/tts uses the OpenAI SDK for OpenAI and OpenAI-compatible servers, the Replicate client, and direct bounded REST requests for Google AI Studio, Fish Audio and OpenRouter.

Compute worker​

  • Server: Fastify 5 with an OpenAPI contract; the app's client is generated from it
  • Jobs: NATS JetStream work queues and key-value state
  • Inference: onnxruntime-node with @huggingface/tokenizers
    • Speech: Kokoro-82M, exported with its per-phoneme durations so local Kokoro times its own words, with a port of Misaki and compromise for English pronunciation, and tables learned from Kokoro's own readings of Tatoeba sentences for Spanish, Hindi, Italian and Brazilian Portuguese. Voice packs and pronunciation data download when their language is first used.
    • Word timing for other providers: timestamped Whisper base and Whisper tiny.en
    • PDF layout: PP-DocLayoutV3
  • Documents: pdfjs-dist and @napi-rs/canvas to render pages, fast-xml-parser and jszip for EPUB, headless LibreOffice for DOCX
  • Audio: FFmpeg, a pinned LGPL build in published images and the desktop app (packaging/ffmpeg)
  • Exports and email: archiver, Resend

The worker runs embedded in Docker, native and desktop installs, or as its own service. The app talks to it only over HTTP.

Desktop​

Electron with electron-builder and electron-updater. It runs the same server and worker as the Docker image.

Tooling​

  • ESLint and TypeScript
  • Vitest 4 for unit and integration tests
  • Playwright for end-to-end tests in Chromium and WebKit
  • Docusaurus for this site (docs-site/)