How duwqijlk/margin-words works
Margin Words is an offline-capable English-novel reader for Chinese junior-high learners. Readers discover a title, sign in to add it, then read a stored or downloaded book with book-specific meanings and paragraph, sentence, and phrase notes; they can save words to a notebook and review them later. Copyrighted titles require the reader’s own EPUB. Optional accounts sync reading and study state. The README documents these capabilities; source excerpts and the index support selected internal links, but many UI and catalog modules were not sampled.
Main entry points: reader.tsx Novel reader · review.tsx Word review · handlers.ts Account handlers · shelf.tsx Book shelf
Components 24
Reader experience
- Reader app
src/components/margin-app.tsx - Book shelf
src/components/shelf.tsx - Discover catalog
src/components/discover.tsx - Library dashboard
src/components/dashboard-page.tsx - Guide and help
src/components/guide-page.tsx
Books and reading
- Novel reader
src/components/reader.tsx - Local book store
src/lib/book-db.ts - EPUB handling
src/lib/epub.ts - Book glossary
src/lib/glossary-format.ts - Paragraph notes
src/lib/paragraph-note.ts - Meaning card
src/components/floating-card.tsx - Reading position
src/lib/position.ts
Study tools
- Word notebook
src/components/notebook.tsx - Vocabulary state
src/lib/vocab-store.ts - Word review
src/components/review.tsx - Review scheduling
src/lib/srs.ts
Accounts and sync
- Account controls
src/components/account-dialog.tsx - Sync engine
src/lib/sync-engine.ts - Sync API
functions/api/sync.ts - Account handlers
functions/lib/handlers.ts - Session management
functions/lib/session.ts - D1 database
functions/lib/db.ts
Other components
- Reader
- Books host
Connections 25
- Reader → Book shelf: opens shelf
README.md - Book shelf → Discover catalog: browses titles
README.md - Discover catalog → Book shelf: adds book
README.md - Reader → Novel reader: reads book
README.md - Novel reader → Local book store: loads stored book
src/components/reader.tsx - Novel reader → EPUB handling: opens EPUB
src/components/reader.tsx - Novel reader → Book glossary: reads meanings
src/components/reader.tsx - Novel reader → Paragraph notes: loads notes
src/components/reader.tsx - Novel reader → Meaning card: shows meaning
README.md - Novel reader → Reading position: tracks position
src/components/reader.tsx - Reader → Word notebook: saves words
README.md - Word notebook → Vocabulary state: stores vocabulary
README.md - Novel reader → Vocabulary state: saves words
src/components/reader.tsx - Reader → Word review: reviews words
README.md - Word review → Review scheduling: schedules review
src/components/review.tsx - Word review → Vocabulary state: reads study state
src/components/review.tsx - Reader → Account controls: signs in
README.md - Account controls → Sync engine: enables sync
README.md - Sync engine → Sync API: syncs state
src/lib/sync-engine.ts - Sync API → Account handlers: routes requests
functions/api/sync.ts - Account handlers → D1 database: reads and writes
functions/lib/handlers.ts - Account handlers → Session management: checks sessions
functions/lib/handlers.ts - Books host → Novel reader: serves books
README.md - Library dashboard → Reader: summarizes library
README.md - Guide and help → Reader: explains features
README.md