mirror of
https://github.com/Tony0410/readlater.git
synced 2026-05-24 13:52:03 +08:00
883b0d71329dbd0dd0b8921f39822f8e363ed5dc
- Handle NotAllowedError gracefully instead of showing alerts - Make resume() async and catch playback errors - Reset state properly when autoplay is blocked - Clean up unused dependencies in playEdge callback Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ReadLater
A self-hosted read-it-later app with text-to-speech support. Save articles, read them later with a clean dark reader interface, and listen to them with high-quality TTS.
Features
- Save Articles: Paste URLs or use the bookmarklet to save articles
- Clean Reader: Distraction-free reading with dark mode (black background, white text)
- Customizable: Adjust font size, font family, line height, and content width
- Favorites & Archive: Organize your reading list
- Text-to-Speech:
- Browser TTS (built-in, works offline)
- Kokoro TTS (high-quality, self-hosted)
- Speed control up to 3x
- Bookmarklet: One-click saving from any browser
Quick Start
Using Docker (Recommended)
# Clone or download the project
cd /root/projects/readlater
# Start with Docker Compose
docker compose up -d
# Access at http://localhost:3000
Manual Installation
# Install dependencies
npm install
# Run database migrations
npm run db:migrate
# Start development server
npm run dev
# Or build for production
npm run build
npm start
Usage
Adding Articles
- Paste URL: Use the input field at the top of the app
- Bookmarklet: Go to
/bookmarkletand drag the button to your bookmarks bar
Reading
- Click any article to open the reader
- Use the settings panel (gear icon) to customize:
- Theme: Dark (default), Light, or Sepia
- Font Size: 14-32px
- Font Family: Serif, Sans, Mono, or System
- Line Height: Tight to Loose
- Content Width: Narrow to Wide
Text-to-Speech
- Click the speaker icon to start reading
- Control playback with pause/resume/stop buttons
- Adjust speed in settings (0.5x to 3x)
Browser TTS
Works out of the box using your browser's built-in speech synthesis.
Kokoro TTS (Optional)
For higher quality TTS, uncomment the kokoro service in docker-compose.yml:
kokoro:
image: ghcr.io/remsky/kokoro-fastapi:latest
container_name: kokoro-tts
restart: unless-stopped
ports:
- "8880:8880"
Then select "Kokoro" in the TTS settings.
Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
DATABASE_PATH |
./data/readlater.db |
Path to SQLite database |
PORT |
3000 |
Server port |
Data Persistence
The SQLite database is stored in ./data/readlater.db. Mount this directory as a volume when using Docker.
Tech Stack
- Framework: Next.js 16 with App Router
- Language: TypeScript
- Database: SQLite with Drizzle ORM
- Styling: Tailwind CSS
- Article Extraction: Mozilla Readability
- TTS: Web Speech API + Kokoro-FastAPI
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/articles |
GET | List articles (query: filter=all|favorites|archived) |
/api/articles |
POST | Save new article (body: {url}) |
/api/articles/[id] |
GET | Get single article |
/api/articles/[id] |
PATCH | Update article |
/api/articles/[id] |
DELETE | Delete article |
/api/save |
GET | Bookmarklet endpoint (query: url) |
Development
# Start dev server
npm run dev
# Generate new migration after schema changes
npm run db:generate
# Run migrations
npm run db:migrate
# Open Drizzle Studio (database GUI)
npm run db:studio
# Lint
npm run lint
License
MIT
Description
Languages
TypeScript
97.2%
CSS
1.7%
Dockerfile
0.8%
JavaScript
0.3%