AI slop app to read Korean with a pop-up dictionary
README.md

Hanok Reader #

Hanok Reader is a private, offline-first Korean reading app for static hosting. It is built with React and TypeScript and produces a complete Tangled Pages site in docs/.

There is no Hanok-owned account system, backend, analytics, or runtime API. Imported texts remain in the browser's IndexedDB, while users may optionally connect a remoteStorage account for a private sync copy. The service worker caches the interface, Korean WASM analyzer and model, 53,000-entry Korean–English dictionary, and 403 grammar explanations so the app continues working without a connection.

Features #

  • Local library with on-device status, resume progress, and confirmed deletion
  • Paste-and-edit workflow plus local .txt and .epub file uploads
  • EPUB spine and table-of-contents conversion into editable chapter markup
  • Embedded EPUB images saved locally and fitted to page and scroll views
  • Markdown-style import editor with live preview
  • # and ## headings converted into reader chapter navigation
  • Collapsible chapter panel
  • Progressive worker parsing plus windowed scroll/page rendering for multi-megabyte texts
  • Memory-conscious large-file import mode that keeps the full editor closed unless requested
  • System-aware light and dark themes with a persistent manual override
  • Clickable Korean words with:
    • Garu WASM morphological analysis
    • NIKL Korean–English definitions
    • NIKL Hanja origins and per-character Unicode Unihan glosses
    • context-aware, morpheme-sequence Kimchi Grammar explanations
    • tabs for alternate morphological analyses
  • One-tap vocabulary mining with a selectable dictionary definition, source sentence, dictionary form, Hanja roots, and an inspectable duplicate warning
  • A fully local FSRS-6 review deck with Anki-style learning/relearning steps, four answer grades, 90% default desired retention, interval previews, review history, and a default limit of 10 new cards per day
  • Saved scroll anchor or page number for every text
  • Optional remoteStorage synchronization for immutable text content, library metadata, reading position, mined cards, review history, and deck settings
  • Installable PWA and complete cache-first offline support
  • Responsive desktop and mobile layouts

Local development #

npm install
npm run dev

Quality checks:

npm run lint
npm test
npm run build

The production build is committed in docs/ because Tangled Pages serves static files directly from a repository directory.

Tangled Pages #

In the Tangled repository:

  1. Open Settings → Sites.
  2. Choose the main branch.
  3. Set the deploy directory to /docs.
  4. Choose the sub-path site type. Tangled serves it at /hanok-reader/.
  5. Save.

The app uses relative asset URLs and hash routing, so it works from the Tangled sub-path without a hosting-specific rebuild. Its manifest identity is fixed to /hanok-reader/ so it remains distinct from the other installable apps on the same domain.

Refreshing the language data #

The generated packs are committed and no data download is needed to build the app. To refresh them:

  1. Put a current NIKL CSV snapshot at scripts/.cache/nikl.csv.
  2. Put the Korean Learners’ Dictionary full JSON archive at scripts/.cache/krdict-full-20260719.zip.
  3. Put Unicode’s Unihan archive at scripts/.cache/Unihan-17.0.0.zip.
  4. Extract Kimchi Grammar into scripts/.cache/kimchi-grammar-main/.
  5. Run npm run data.
  6. Run npm run build.

See THIRD_PARTY_NOTICES.md for sources and licenses. Dictionary examples and media are intentionally excluded, as is Kimchi Grammar's separately licensed audio.

Storage model #

Data Local storage
React app, WASM analyzer, model, dictionary, Hanja index, grammar Cache Storage, managed by sw.js
Imported texts, chapters, EPUB asset references, reading mode and progress IndexedDB (hanok-reader), with immutable text optionally mirrored to private remoteStorage
Mined cards, deck settings, scheduling state, and append-only review history IndexedDB (hanok-reader), optionally mirrored to private remoteStorage
Embedded EPUB image bytes Cache Storage (hanok-reader-user-assets-v1)
Explicit light or dark theme preference Local Storage (hanok-reader-theme)

Both local stores are browser-origin scoped. Clearing site data removes the local library and review deck unless an optional remoteStorage copy has been connected. EPUB images are never included in remoteStorage sync.

remoteStorage sync #

Hanok Reader can connect directly to a remoteStorage provider such as 5apps from the static site. It writes sync records only to the private hanok-reader category and keeps IndexedDB as the authoritative local store. Because remoteStorage authorization is shared by every app on an origin, Hanok Reader and Omni Diary request both suite categories when connecting. Each app still reads and writes only its own category. The connection is optional, and disconnecting does not remove Hanok Reader's local data.

Cards, immutable review events, deck settings, book titles, reading positions, and immutable text chunks are synchronized. Matching text imported independently on two devices is identified by a SHA-256 content hash, and its content is stored once under that hash. EPUB images stay on the importing device. Removing a book from the library does not remove its immutable text payload from remoteStorage, so other devices and a later identical import can continue using it. The earlier AT Protocol proposal remains documented in ATPROTO_SYNC_DESIGN.md for historical reference.

License #

The application code is MIT licensed. Generated dictionary and grammar packs retain their source data licenses; see the third-party notices.