|
1 | | -# OpenReader WebUI |
| 1 | +[](#license) |
| 2 | +[](../../pulls) |
2 | 3 |
|
3 | | -OpenReader WebUI is a web-based PDF reader with integrated Text-to-Speech capabilities. It provides a clean interface for reading PDF documents while offering synchronized text-to-speech playback using OpenAI's TTS API. |
| 4 | +# OpenReader WebUI |
4 | 5 |
|
5 | | -## Demo |
| 6 | +OpenReader WebUI is a sleek, web-based PDF reader with built-in Text-to-Speech capabilities, offering a seamless reading experience with synchronized audio narration. |
6 | 7 |
|
7 | | -https://github.com/user-attachments/assets/7a3457ba-feda-4939-928a-cb587b1c0884 |
| 8 | +- 🎯 **TTS API Integration**: Compatible with OpenAI API TTS and Kokoro FastAPI TTS, enabling high-quality voice narration |
| 9 | +- 💾 **Local-First Architecture**: Secure document handling with IndexedDB browser storage - no server uploads required |
| 10 | +- 🔍 **Smart Text Processing**: Real-time sentence detection and synchronized text highlighting during playback |
| 11 | +- ⚡ **Modern Tech Stack**: Built with Next.js, React, and Tailwind CSS |
| 12 | +- 🎨 **Customizable Experience**: |
| 13 | + - Adjustable playback speed |
| 14 | + - Multiple voice options |
| 15 | + - Dark/light/system theme support |
| 16 | + - Persistent user settings |
| 17 | +- 📱 **Cross-Platform**: Responsive design works seamlessly across desktop and mobile devices |
8 | 18 |
|
9 | | -## Features |
| 19 | +## **Demo** |
10 | 20 |
|
11 | | -- **PDF Document Management** |
12 | | - - Local document storage using IndexedDB |
13 | | - - PDF text extraction and rendering |
14 | | - |
15 | | -- **Text-to-Speech Integration** |
16 | | - - Real-time text-to-speech using OpenAI's TTS API, Kokoro TTS API, or anything else that follows the OpenAI API format |
17 | | - - Synchronized text highlighting |
18 | | - - Configurable playback speed |
19 | | - - Multiple voice options |
20 | | - - Click-to-read functionality |
21 | | - |
22 | | -- **User Interface** |
23 | | - - Light/Dark/System theme support |
24 | | - - Responsive design |
25 | | - - Configurable API settings |
26 | | - - Interactive PDF text selection |
27 | | - |
28 | | -## Tech Stack |
29 | | - |
30 | | -- **Framework**: Next.js with React |
31 | | -- **Storage**: IndexedDB for document storage |
32 | | -- **PDF Processing**: |
33 | | - - react-pdf for rendering |
34 | | - - pdf.js for text extraction |
35 | | - - compromise for text analysis |
36 | | -- **UI Components**: |
37 | | - - Headless UI for modals and dropdowns |
38 | | - - Tailwind CSS for styling |
39 | | -- **TTS Integration**: OpenAI TTS API |
| 21 | +https://github.com/user-attachments/assets/323251e6-3b3b-43cc-b139-cdab01ca7d75 |
40 | 22 |
|
41 | 23 | ## Installation |
42 | 24 |
|
43 | | -> You will need `node` and `npm` installed on your machine. If you don't have it, I recommend installing it using [nvm](https://github.com/nvm-sh/nvm). |
| 25 | +### Prerequisites |
| 26 | +- Node.js & npm (recommended: use [nvm](https://github.com/nvm-sh/nvm)) |
44 | 27 |
|
| 28 | +### Steps |
45 | 29 |
|
46 | 30 | 1. Clone the repository: |
47 | | -```bash |
48 | | -git clone https://github.com/richardr1126/OpenReader-WebUI.git |
49 | | -cd OpenReader-WebUI |
50 | | -``` |
| 31 | + ```bash |
| 32 | + git clone https://github.com/richardr1126/OpenReader-WebUI.git |
| 33 | + cd OpenReader-WebUI |
| 34 | + ``` |
51 | 35 |
|
52 | 36 | 2. Install dependencies: |
53 | | -```bash |
54 | | -npm install |
55 | | -``` |
| 37 | + ```bash |
| 38 | + npm install |
| 39 | + ``` |
56 | 40 |
|
57 | | -3. Set up environment variables: |
58 | | -```bash |
59 | | -cp .env.template .env |
60 | | -``` |
61 | | -> Edit the `.env` file with your configuration settings. |
| 41 | +3. Configure the environment: |
| 42 | + ```bash |
| 43 | + cp .env.template .env |
| 44 | + # Edit .env with your configuration settings |
| 45 | + ``` |
62 | 46 |
|
63 | 47 | 4. Start the development server: |
64 | | -```bash |
65 | | -npm run dev |
66 | | -``` |
67 | | - |
68 | | -The application will be available at [http://localhost:3000](http://localhost:3000). |
69 | | - |
70 | | -## Available Scripts |
71 | | - |
72 | | -- `npm run dev` - Start development server with Turbopack |
73 | | -- `npm run build` - Create production build |
74 | | -- `npm run start` - Start production server |
75 | | -- `npm run lint` - Run ESLint for code quality |
| 48 | + ```bash |
| 49 | + npm run dev |
| 50 | + ``` |
| 51 | + Visit [http://localhost:3000](http://localhost:3000) to run the app. |
| 52 | + |
| 53 | +## **Features** |
| 54 | + - Real-time sentence by sentence text-to-speech via OpenAI API TTS, [Kokoro FastAPI TTS](https://github.com/remsky/Kokoro-FastAPI), or others compatible with the `/v1/audio/speech` endpoint |
| 55 | + - IndexedDB-powered local storage |
| 56 | + - Synchronized text highlighting during playback (using string similarity for best match on the page) |
| 57 | + - Configurable playback speed and voice options, which checks `/v1/audio/voices` for available voices |
| 58 | + - Click-to-skip on the same page for navigation |
| 59 | + - Responsive design with light, dark, and system themes |
| 60 | + - All configuration settings saved in IndexedDB |
| 61 | + |
| 62 | +## Stack |
| 63 | + |
| 64 | +- **Framework:** Next.js (React) |
| 65 | +- **Storage:** IndexedDB (in broswer db store) |
| 66 | +- **PDF Processing:** |
| 67 | + - [react-pdf](https://github.com/wojtekmaj/react-pdf) |
| 68 | + - [pdf.js](https://mozilla.github.io/pdf.js/) |
| 69 | + - Compromise for text analysis |
| 70 | +- **UI Components:** |
| 71 | + - Headless UI |
| 72 | + - Tailwind CSS |
| 73 | +- **TTS Integration:** anything you want |
76 | 74 |
|
77 | 75 | ## Project Structure |
78 | 76 |
|
79 | 77 | ``` |
80 | 78 | src/ |
81 | | -├── app/ # Next.js app router |
82 | | -├── components/ # UI components |
83 | | -├── contexts/ # Contexts for state management |
84 | | -└── services/ # Utility functions |
| 79 | +├── app/ // Next.js app router |
| 80 | +├── components/ // Reusable UI components |
| 81 | +├── contexts/ // State management contexts |
| 82 | +└── services/ // Utility functions & integrations |
85 | 83 | ``` |
86 | 84 |
|
87 | | -## Browser Support |
| 85 | +## Contributing |
88 | 86 |
|
89 | | -The application requires modern browser features: |
90 | | -- IndexedDB for document storage |
91 | | -- PDF.js for document rendering |
| 87 | +Contributions are welcome! Fork the repository and submit a pull request with your changes. For significant alterations, please open an issue first. |
92 | 88 |
|
93 | 89 | ## License |
94 | 90 |
|
95 | | -MIT License |
| 91 | +This project is licensed under the MIT License. |
96 | 92 |
|
97 | 93 | ## Acknowledgements |
98 | 94 |
|
99 | | -- [react-pdf](https://github.com/wojtekmaj/react-pdf) for the PDF rendering library. |
100 | | -- [Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M) text-to-speech model |
101 | | -- [Kokoro-FastAPI](https://github.com/remsky/Kokoro-FastAPI/tree/master) for the text-to-speech api wrapper. |
| 95 | +- [react-pdf](https://github.com/wojtekmaj/react-pdf) |
| 96 | +- [Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M) for text-to-speech |
| 97 | +- [Kokoro-FastAPI](https://github.com/remsky/Kokoro-FastAPI) for the API wrapper |
| 98 | + |
| 99 | +## Support |
| 100 | + |
| 101 | +If you encounter issues or have suggestions, please open an issue on GitHub. |
102 | 102 |
|
103 | | -Thank you ❤️ |
| 103 | +<!-- ...existing sections for further documentation or credits if needed... --> |
0 commit comments