Skip to content
Projects

martinachain/yidu-english-reader

View on GitHub

About

读英语原版书的 AI 阅读器:双击查词、划选拆句、间隔重复复习。EPUB/PDF, 数据全本地。

AI & Machine Learning

How these counts are measured

Measured star growth

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.en.md

Original

Yidu (易读) · English Reading Assistant

Read the original · Ask only when stuck · Words & sentences saved automatically

中文 README · English

🔗 Live demo: yidu.srv1903550.hstgr.cloud (bring your own DeepSeek key)

Yidu is an AI-powered reading tool for people learning English — one product, two entry points:

  • 📖 Web reader — import EPUB / PDF / Markdown, double-click to look up words, select to analyze sentences
  • 🔍 Browser extension — select words and sentences on any English webpage (news, blogs, forums…), no need to import content first

Both entry points share the same vocabulary book, sentence library, and spaced-repetition (SRS) review queue: whether you looked up a word in a book or highlighted a sentence while browsing, everything lands in one place and feeds into the same review schedule.

All data lives in your own browser — no accounts, no server database. Works out of the box.


Web reader

  • Reads EPUB / PDF / Markdown — drag in or click to import; title, author and cover are extracted automatically
  • Double-click lookup — double-click any word and the AI gives its meaning in this sentence, not a generic dictionary entry
  • Select to analyze — highlight a long sentence and the AI breaks down its structure, key phrases, tricky points and a full translation
  • Vocabulary book + sentence library — everything you look up is saved automatically
  • Spaced repetition (SRS) — scheduled on a 1 / 3 / 7 / 14 / 30 / 60 day ladder; a sentence card "graduates" after you understand it 3 times in a row
  • Reading experience — table of contents, bookmarks, resume-where-you-left-off, reading progress; PDFs use lazy paging (hundreds of pages stay smooth)
  • Local-first data — everything is stored in the browser's IndexedDB; it does not sync across devices (a design trade-off, not a bug)

Quick start

Requires Node.js 18+.

git clone https://github.com/martinachain/yidu-english-reader.git
cd yidu-english-reader
npm install
npm run dev

Open http://localhost:3000. On first launch a dialog asks for your DeepSeek API Key — fill it in and you're ready.

No .env file needed — the key is entered in the UI and stored only in your local browser.

Browser extension

Select words and sentences on any English webpage without importing the page into the web reader first — whatever you save syncs automatically into the same vocabulary book and sentence library above.

Installation (manual load only for now — not yet published to the Chrome Web Store)

  1. Download the latest extension zip from GitHub Releases
  2. Unzip it
  3. Open Chrome and go to chrome://extensions
  4. Turn on "Developer mode" (top right)
  5. Click "Load unpacked" and select the unzipped folder
  6. A "Yidu" (易读) icon appears in the toolbar — click it to see capture stats, open the vocabulary book, or go to settings

Features

  • Select to look up — select a single word on any webpage (double-click or drag-select exactly one word) and get an instant Chinese meaning, no network or API key required (offline dictionary)
  • Select to analyze — drag-select a whole sentence and a panel pops up automatically with structure breakdown + translation (requires a DeepSeek API key in the settings page)
  • Auto-sync — opening the web reader automatically syncs any locally captured words/sentences into the vocabulary book, no manual import needed

The settings page lets you configure a DeepSeek API key (stored separately from the web reader's key — the two don't share storage, so each needs its own key).

Getting a DeepSeek API Key

Word lookup and sentence analysis call DeepSeek (cheap, and strong with Chinese). Both the web reader and the browser extension need their own key configured:

  1. Sign up and log in at platform.deepseek.com
  2. Create a key on the API Keys page (looks like sk-...)
  3. Top up a small balance (a sentence analysis costs a fraction of a cent)
  4. Paste the key into the app's (or extension's) settings dialog

The key is stored only locally (localStorage for the web reader, chrome.storage.local for the extension). Each request is sent directly from your browser to DeepSeek's official API — it never passes through this app's servers, nor any third party.

Self-hosting

This is a pure front-end app — no backend, no secrets held anywhere. Fork it and deploy to Vercel / Zeabur / Netlify / any static host, or run npm run build && npm start on your own machine. Every user talks to DeepSeek directly with their own key from their own browser, so a public deployment never becomes a "free DeepSeek proxy".

⚠️ One extra step for extension sync when self-hosting

The URL the extension syncs to is hardcoded in extension/manifest.json — Chrome's content_scripts.matches cannot be changed at runtime. It knows three addresses by default (the new home, the old Zeabur URL during the transition, and localhost):

"matches": ["https://yidu.srv1903550.hstgr.cloud/*", "https://english-reading.zeabur.app/*", "http://localhost:3000/*"]

So:

  • Local development (http://localhost:3000) — extension sync works out of the box ✅
  • Your own domain — the web reader works fine, but the extension will not sync words to it and will report a sync timeout

To sync to your own domain, change two places and reload the extension:

  1. extension/manifest.json — add your domain to both matches / exclude_matches entries
  2. extension/src/shared/storage.ts and extension/src/options/options.html — point the default / selectable reader URL at your domain

Then run node esbuild.config.mjs inside extension/ to rebuild, and reload it at chrome://extensions.


Tech stack

  • Framework: Next.js 16 (App Router + Turbopack), React 19, TypeScript
  • Styling: Tailwind CSS v4
  • Local storage: Dexie (an IndexedDB wrapper)
  • E-book parsing: epub.js, pdf.js
  • AI: the browser calls DeepSeek's official API directly via fetch (the deepseek-chat model) — no server-side proxy
  • Browser extension: Chrome Manifest V3, built independently with esbuild, syncs with the web reader via postMessage

Project structure

app/
  page.tsx              Bookshelf (import, review entry, API key settings)
  read/[bookId]/        Reader (lookup, sentence analysis, bookmarks, TOC)
  review/               Spaced-repetition review
  library/              Vocabulary book
components/             Reader, dialogs, panels, etc.
lib/
  deepseek.ts           Browser-direct DeepSeek calls (lookup / analysis)
  import-bridge.ts      Receives synced words/sentences from the browser extension
  db.ts, srs.ts, ...    Database, SRS algorithm, pdf/epub parsing, API key management
types/                  Shared types
extension/              Browser extension (independent build, Chrome Manifest V3)

Notes & limitations

  • Data is stored locally in the browser: clearing browser data / switching browsers = books and records are gone. The types reserve an updatedAt field, so cloud sync (e.g. Supabase) could be added later.
  • Safe to deploy publicly: this app is pure frontend — no backend, no secrets held server-side. Every user calls DeepSeek directly with the key in their own browser, so even a public deployment can't be abused as a "free DeepSeek proxy." (That's exactly why the server-side proxy was removed in favor of browser-direct calls.)
  • Key safety: your key stays in your own browser and is only ever sent to DeepSeek's official API — this app's servers never touch it.

License

MIT

Explore related projects

Loading…