|
|
||
|---|---|---|
| .github | ||
| public | ||
| scripts | ||
| src | ||
| .gitattributes | ||
| .gitignore | ||
| Dockerfile | ||
| empty-module.ts | ||
| eslint.config.mjs | ||
| LICENSE | ||
| next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.mjs | ||
| README.md | ||
| tailwind.config.ts | ||
| template.env | ||
| tsconfig.json | ||
OpenReader WebUI 📄🔊
OpenReader WebUI is a document reader with Text-to-Speech capabilities, offering a TTS read along experience with narration for both PDF and EPUB documents. It can use any OpenAI compatible TTS endpoint, including Kokoro-FastAPI.
- 🎯 TTS API Integration: Compatible with OpenAI text to speech API, Kokoro FastAPI TTS, or any other compatible service; enabling high-quality voice narration
- 💾 Local-First Architecture: Uses IndexedDB browser storage - no server uploads required
- 🛜 Optional Server-side documents: Manually upload documents to the next backend for all users to download
- 📖 Read Along Experience: Follow along with highlighted text as the TTS narrates
- 🎧 Audiobook Creation: Create and export audiobooks from PDF and ePub files with m4b format
- 📚 EPUB Support: Read EPUB files with table of contents
- 📄 PDF Support: Read PDF files with clean text extraction
- 💬 Follow along with highlighted text as the TTS narrates
- 📲 Mobile Support: Works on mobile devices, and can be added as a PWA web app
- 🎨 Customizable Experience:
- 🔑 Set TTS API base URL (with optional API key)
- 🏎️ Adjustable playback speed
- 📐 Customize PDF text extraction margins
- 🗣️ Multiple voice options (checks
/v1/audio/voicesendpoint) - 🎨 Multiple app theme options
Demo
https://github.com/user-attachments/assets/262b9a01-c608-4fee-893c-9461dd48c99b
🐳 Docker Quick Start
docker run --name openreader-webui \
-p 3003:3003 \
-v openreader_docstore:/app/docstore \
richardr1126/openreader-webui:v0.2.2-alpine
(Optionally): Set the TTS API_BASE URL and/or API_KEY to be default for all devices
docker run --name openreader-webui \
-e API_BASE=http://host.docker.internal:8880/v1 \
-p 3003:3003 \
-v openreader_docstore:/app/docstore \
richardr1126/openreader-webui:v0.2.2-alpine
Requesting audio from the TTS API happens on the Next.js server not the client. So the base URL for the TTS API should be accessible and relative to the Next.js server. If it is in a Docker you may need to use
host.docker.internalto access the host machine, instead oflocalhost.
Visit http://localhost:3003 to run the app and set your settings.
Note: The
openreader_docstorevolume is used to store server-side documents. You can mount a local directory instead. Or remove it if you don't need server-side documents.
⬆️ Update Docker Image
docker stop openreader-webui && docker rm openreader-webui
docker pull richardr1126/openreader-webui:latest
Adding to a Docker Compose (i.e. with open-webui or Kokoro-FastAPI)
Create or add to a docker-compose.yml:
volumes:
docstore:
services:
openreader-webui:
container_name: openreader-webui
image: richardr1126/openreader-webui:latest
environment:
- API_BASE=http://host.docker.internal:8880/v1
ports:
- "3003:3003"
volumes:
- docstore:/app/docstore
restart: unless-stopped
Dev Installation
Prerequisites
Steps
-
Clone the repository:
git clone https://github.com/richardr1126/OpenReader-WebUI.git cd OpenReader-WebUI -
Install dependencies:
npm install -
Configure the environment:
cp template.env .env # Edit .env with your configuration settingsNote: The base URL for the TTS API should be accessible and relative to the Next.js server
-
Start the development server:
npm run devor build and run the production server:
npm run build npm startVisit http://localhost:3003 to run the app.
Dev server runs on port 3000 by default, while the production server runs on port 3003.
💡 Feature requests
For feature requests or ideas you have for the project, please use the Discussions tab.
🙋♂️ Support and issues
For general questions, you can reach out to me on Bluesky. If you encounter issues, please open an issue on GitHub following the template (which is very simple).
👥 Contributing
Contributions are welcome! Fork the repository and submit a pull request with your changes.
❤️ Acknowledgements
- Kokoro-FastAPI for the API wrapper
- react-pdf
- react-reader
- Kokoro-82M for text-to-speech
Docker Supported Architectures
- linux/amd64 (x86_64)
- linux/arm64 (Apple Silicon)
- linux/arm/v7 (Raspberry Pi)
Stack
- Framework: Next.js (React)
- Containerization: Docker
- Storage: IndexedDB (in browser db store)
- PDF:
- EPUB:
- UI:
- TTS: (tested on)
- NLP: compromise NLP library for sentence splitting
License
This project is licensed under the MIT License.