2026-09-28·por Sijie Wang#node#lucerna#software#architecture

key-designs

Parent: architecture

The load-bearing subsystems of Lucerna, each verified against code (deep-read, not surveyed). Grouped by what they serve.

The reading substance

  • raw-display-cursor — the dual-coordinate backbone: every position stored as a book-absolute raw offset, display reconstructed → layout-independent bookmarks/notes/vocab/karaoke.
  • dynamic-pagination — DOM-measured pagination that reflows on font/viewport; a repaginate-only fast path; LayoutKey + PAGINATION_VERSION.
  • all-forms-underline — mark one inflection, light up every form of its lemma; the elision tokenizer that must agree across underline/POS/LLM.
  • vocabulary-loop — tap → 3-tier lookup → verb enrichment → save → all-forms → server-owned SM-2.
  • full-text-search — per-book FlexSearch at sentence granularity, disk-persisted (restore-vs-rebuild + versioning).
  • tts-audiobook — desktop-local Piper/sherpa-onnx audiobook + word-level karaoke timed from PCM energy, raw-offset-anchored.

The linguistic core

  • linguistic-two-engines — two parallel engines: TS/LLM-first (any language) vs Python/spaCy dep-parse (deterministic, DE+EN).
  • upload-ingestion — client-side EPUB/PDF/text parse (server OCR for scans) → contentHash, the join key everything anchors to.

The architecture pillars

  • cross-platform-seams — one framework-agnostic core drives web + desktop via three registry seams + a lazy binding proxy; HTTP-delegate vs Hybrid-wrapper repos.
  • offline-first-outbox — desktop offline-first: transactional Outbox (same-tx atomicity), cloud-authoritative wipe-and-refill, IPC tx-id bridge, temp-id reconcile.
  • backends-three-services — the auth / mainbackend / nlp-api split (why three, what each owns; SRS + i18n live here).
  • high-availability-proposal — proposal, not built: where the single points of failure are today, and a staged plan (backups + restore drill → replicas → database standby, identity off self-hosting).