Insipred from Andrej karpathy reader3 repo

A lightweight, self-hosted EPUB reader with a beautiful interface for reading digital books. Upload your EPUB files through a simple drag-and-drop interface and enjoy a clean reading experience.
- Drag & Drop Upload - Simply drag EPUB files to upload
- Web-Based Interface - No command line needed
- Delete Books - Remove books with one click
- Reading Progress - Automatically tracks where you left off
- Bookmarks - Save your favorite passages
- Clean UI - Minimalist design inspired by Kindle and Apple Books
- Dark Mode & Themes - Multiple reading themes (sepia, night mode)
- Chapter Navigation - Easy next/previous chapter controls
- Table of Contents - Quick navigation sidebar
- Responsive Design - Works on desktop, tablet, and mobile
- Fast Processing - Efficient EPUB parsing and caching
- Secure - Path traversal protection, file validation
- Production Ready - Logging, health checks, error handling
- 100MB File Support - Handle large EPUB files
- Clone the repository
git clone https://github.com/cipheraxat/reader3.git
cd reader3- Install dependencies
pip install -r requirements.txt- Start the server
python server.py- Open your browser
http://localhost:8123
If you prefer uv:
uv run server.py- Open the web interface at
http://localhost:8123 - Drag an EPUB file onto the upload zone, or click to browse
- Wait for processing (10-30 seconds depending on book size)
- Your book appears in the library!
- Click on any book card to start reading
- Use Previous/Next buttons to navigate chapters
- Use the Table of Contents sidebar for quick navigation
- Your reading progress is automatically saved
- Click the ποΈ Delete button on any book card
- Confirm the deletion
- Book is permanently removed
# Books storage directory (default: books)
BOOKS_DIR=books
# Cache size for loaded books (default: 10)
MAX_BOOK_CACHE_SIZE=10
# Server host (default: 0.0.0.0)
HOST=0.0.0.0
# Server port (default: 8123)
PORT=8123
# Number of workers (default: 1)
WORKERS=1Create a .env file:
BOOKS_DIR=/path/to/your/books
PORT=3000
MAX_BOOK_CACHE_SIZE=20Deploy your own instance for free:
railway upfly launch
fly deploySee DEPLOYMENT.md for detailed deployment instructions.
reader3/
βββ server.py # FastAPI web server
βββ reader3.py # EPUB processing engine
βββ requirements.txt # Python dependencies
βββ templates/
β βββ library.html # Library page (book grid)
β βββ reader.html # Reading interface
βββ books/ # Uploaded books storage
βββ *_data/ # Processed book data
βββ book.pkl # Book metadata & content
βββ images/ # Extracted images
GET /- Library page (list all books)POST /upload- Upload EPUB fileDELETE /delete/{book_id}- Delete a book
GET /read/{book_id}- Redirect to first chapterGET /read/{book_id}/{chapter_index}- Read specific chapterGET /read/{book_id}/images/{image_name}- Serve book images
GET /health- Health check endpoint
- File validation - Only EPUB files accepted
- Size limits - Maximum 100MB per file
- Path traversal protection - Prevents directory access attacks
- Input sanitization - Cleans filenames and book IDs
- Secure file handling - Temporary files auto-cleanup
βorA- Previous chapterβorD- Next chapterB- Toggle bookmarks sidebarT- Toggle table of contentsESC- Close sidebars
- Project Gutenberg - 70,000+ free public domain books
- Standard Ebooks - High-quality public domain books
- Open Library - Millions of books
- ManyBooks - Free ebooks
- Your own purchased EPUB files
- Check file is
.epubformat - Ensure file size is under 100MB
- Check server logs for errors
- Verify disk space available
- Wait for page to auto-refresh (1 second)
- Manually refresh the browser
- Check if
books/directory has the*_datafolder - Look for
book.pklfile inside the book's data folder
- Check if port 8123 is already in use
- Install all dependencies:
pip install -r requirements.txt - Check Python version (3.8+ required)
# Enable auto-reload
RELOAD=true python server.pypython reader3.py path/to/book.epubThis creates a book_data/ directory with processed content.
This is a personal project, but feel free to fork and modify it for your needs. The code is intentionally simple and easy to understand.
MIT
Built with:
- FastAPI - Web framework
- EbookLib - EPUB parsing
- BeautifulSoup - HTML processing
Note: Code is ephemeral now and libraries are over - ask your favorite LLM to customize this reader in whatever way you like! π€