Skip to content

obmakesomething/002

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

37 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PDF/EPUB Reader with Translator & Bionic Reading

A comprehensive web-based reading application with translation, grammar explanation, vocabulary management, and advanced Bionic Reading features for enhanced learning.

โœจ Key Features

๐Ÿ“– Document Support

  • PDF & EPUB Support: Read both PDF and EPUB files seamlessly
  • Table of Contents: Navigate through books with interactive TOC
  • Page Navigation: Easy page turning and zoom controls
  • Progress Tracking: Automatically saves your reading progress

๐ŸŒ Learning Tools

  • Real-time Translation: Instant Korean translation of selected text
  • Grammar Explanation: Detailed grammar analysis with tense detection
  • Vocabulary Management: Save and organize unknown words
  • Context-aware Notes: Add annotations and highlights to any text

๐Ÿง  Bionic Reading

  • Fixation Control: Adjust the number of bold characters (1-5)
  • Saccade Adjustment: Control word spacing for optimal eye movement
  • Opacity Settings: Fine-tune emphasis intensity (1-100%)
  • Dual Modes: Choose between Letters or Syllables emphasis
  • Flexible Application: Apply to entire document or selection only

๐Ÿ” User Management

  • Secure Authentication: Private user accounts with encrypted passwords
  • Personal Library: Upload and manage your book collection
  • Reading Statistics: Track your learning progress over time
  • Cross-device Sync: Access your books from any device

๐Ÿ“ฑ Modern Interface

  • Responsive Design: Works on desktop, tablet, and mobile
  • Dark/Light Themes: Comfortable reading in any environment
  • Intuitive Controls: Easy-to-use interface for all features

๐Ÿš€ Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn

Installation

  1. Clone the repository

    git clone <repository-url>
    cd 002
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env
    # Edit .env and set your SESSION_SECRET
  4. Start the server

    npm start
  5. Open in browser

    http://localhost:3000
    

๐ŸŒ Deploy to Railway.app

Quick Deploy (Recommended)

Railway.app ๋ฐฐํฌ๋Š” ๋งค์šฐ ์‰ฝ์Šต๋‹ˆ๋‹ค! ์•„๋ž˜ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ผํ•˜์„ธ์š”:

  1. Railway ๊ณ„์ • ์ƒ์„ฑ

    • Railway.app์—์„œ GitHub์œผ๋กœ ๋กœ๊ทธ์ธ
  2. ํ”„๋กœ์ ํŠธ ๋ฐฐํฌ

    • "New Project" โ†’ "Deploy from GitHub repo"
    • ์ด ์ €์žฅ์†Œ ์„ ํƒ: obmakesomething/002
    • ๋ธŒ๋žœ์น˜: claude/pdf-reader-translator-011CUpbHwwWRm27xQSEgmgEh
  3. ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์„ค์ • (์ค‘์š”!)

    • Railway ๋Œ€์‹œ๋ณด๋“œ์—์„œ "Variables" ํด๋ฆญ
    • ์ถ”๊ฐ€ํ•  ๋ณ€์ˆ˜:
      SESSION_SECRET=your-random-secret-key-here
    • SESSION_SECRET ์ƒ์„ฑ: RandomKeygen.com
  4. ๋ฐฐํฌ ์™„๋ฃŒ!

    • ์ž๋™์œผ๋กœ ๋นŒ๋“œ ๋ฐ ๋ฐฐํฌ ์‹œ์ž‘
    • ๋ช‡ ๋ถ„ ํ›„ URL ํ™•์ธ: https://your-app.up.railway.app

์ƒ์„ธ ๋ฐฐํฌ ๊ฐ€์ด๋“œ

Railway ๋ฐฐํฌ ์ƒ์„ธ ๊ฐ€์ด๋“œ๋Š” DEPLOY.md ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”:

  • ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐฑ์—…
  • ์ปค์Šคํ…€ ๋„๋ฉ”์ธ ์—ฐ๊ฒฐ
  • ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ ๋กœ๊ทธ ํ™•์ธ
  • ๋ฌธ์ œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

Railway ๋ฌด๋ฃŒ ํ‹ฐ์–ด

  • ๐Ÿ’ฐ ์›” $5 ํฌ๋ ˆ๋”ง (์•ฝ 500์‹œ๊ฐ„)
  • ๐Ÿ’พ 1 GB ๋””์Šคํฌ
  • ๐Ÿš€ ์ž๋™ HTTPS
  • ๐Ÿ”„ GitHub push ์‹œ ์ž๋™ ์žฌ๋ฐฐํฌ

๐Ÿ“š How to Use

1. Create an Account

  • Navigate to http://localhost:3000/login.html
  • Register with a username and password
  • Login to access your personal library

2. Upload a Book

  • Click the "Upload PDF/EPUB" button
  • Select your PDF or EPUB file
  • The book will appear in your library

3. Read and Learn

  • Select text to get instant translation and grammar explanation
  • Click "Add to Vocabulary" to save important words
  • Use the Table of Contents for easy navigation
  • Adjust zoom and page controls as needed

4. Enable Bionic Reading

  • Click the "๐Ÿง  Bionic Reading" button in the header
  • Toggle "Enable Bionic Reading" checkbox
  • Adjust settings:
    • Fixation: How many letters to emphasize
    • Saccade: How often to emphasize words
    • Opacity: How bold the emphasis appears
    • Mode: Letters or Syllables
  • Click "Apply Settings" to see changes

5. Manage Vocabulary

  • View saved words in the Vocabulary panel
  • Export your word list to JSON
  • Review translations and grammar notes

๐Ÿ›  Technology Stack

Frontend

  • PDF.js - PDF rendering engine
  • EPUB.js - EPUB reader
  • Vanilla JavaScript - No framework dependencies
  • Modern CSS - Responsive and beautiful UI

Backend

  • Node.js & Express - Server framework
  • SQLite - Lightweight database
  • better-sqlite3 - Fast SQLite driver
  • bcryptjs - Password encryption
  • express-session - Session management

๐Ÿ“ Project Structure

002/
โ”œโ”€โ”€ public/              # Frontend files
โ”‚   โ”œโ”€โ”€ index.html       # Main reader interface
โ”‚   โ”œโ”€โ”€ login.html       # Login/register page
โ”‚   โ”œโ”€โ”€ styles.css       # All styles
โ”‚   โ””โ”€โ”€ app.js           # Frontend logic
โ”œโ”€โ”€ uploads/             # User-uploaded books
โ”œโ”€โ”€ server.js            # Express server
โ”œโ”€โ”€ database.js          # Database operations
โ”œโ”€โ”€ package.json         # Dependencies
โ”œโ”€โ”€ .env.example         # Environment template
โ”œโ”€โ”€ .gitignore           # Git ignore rules
โ””โ”€โ”€ README.md            # This file

๐Ÿ”ง Configuration

Environment Variables

Create a .env file with:

PORT=3000
SESSION_SECRET=your-secret-key-here

Database

The SQLite database (reader.db) is created automatically on first run. It stores:

  • User accounts
  • Book metadata
  • Reading progress
  • Vocabulary entries
  • Notes and annotations

๐ŸŒ API Endpoints

Authentication

  • POST /api/register - Create new account
  • POST /api/login - User login
  • POST /api/logout - User logout
  • GET /api/auth/check - Check authentication status

Books

  • POST /api/books/upload - Upload PDF/EPUB
  • GET /api/books - Get user's book library
  • GET /api/books/:id - Get specific book
  • DELETE /api/books/:id - Delete book

Vocabulary

  • POST /api/vocabulary - Add new word
  • GET /api/vocabulary - Get all saved words
  • DELETE /api/vocabulary/:id - Delete word
  • DELETE /api/vocabulary - Clear all words

Progress & Notes

  • POST /api/progress - Update reading progress
  • GET /api/progress/:bookId - Get reading progress
  • POST /api/notes - Create annotation
  • GET /api/notes/:bookId - Get book annotations

๐ŸŽจ Customization

Bionic Reading Settings

The Bionic Reading feature can be customized through the UI or programmatically:

bionicSettings = {
    enabled: true,
    fixation: 2,       // 1-5 characters to emphasize
    saccade: 1,        // Word spacing (every N words)
    opacity: 70,       // Emphasis intensity (1-100%)
    mode: 'letters',   // 'letters' or 'syllables'
    apply: 'all'       // 'all' or 'selection'
};

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

๐Ÿ“„ License

MIT License - Feel free to use this project for learning and development.

๐Ÿ™ Acknowledgments

  • PDF.js by Mozilla - PDF rendering
  • EPUB.js by FuturePress - EPUB reading
  • MyMemory Translation API - Free translation service
  • Bionic Readingยฎ - Inspiration for the reading enhancement feature

๐Ÿ“ž Support

If you encounter any issues or have questions:

  1. Check the browser console for error messages
  2. Ensure Node.js and all dependencies are installed
  3. Verify the database file has write permissions
  4. Check that port 3000 is available

๐Ÿ”ฎ Future Enhancements

  • Text-to-speech functionality
  • More translation language options
  • Advanced NLP for better grammar analysis
  • Flashcard generation from vocabulary
  • Reading goals and achievements
  • Book sharing and recommendations
  • Mobile app versions (iOS/Android)

Built with โค๏ธ for language learners

About

RDxlsxAUTO

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors