High-Performance Local-First Novel & Worldbuilding Studio and CRDT Engine
English โข ํ๊ตญ์ด โข ๆฅๆฌ่ช โข ็ฎไฝไธญๆ
Narratics is a production-grade, local-first novel writing studio and worldbuilding engine engineered to solve the reliability, synchronization, and formatting bottlenecks of traditional narrative software (e.g. Scrivener, Notion, Google Docs).
- 100% Local-First (Zero-Network Invariant): All writing, worldbuilding lore, chapter organization, and snapshot versioning operate directly against a single-file
.narrSQLite WAL container. Zero network calls or cloud accounts required. - Cycle-Free Tree CRDT (Kleppmann Tree Move): Arbitrary reparenting, chapter reordering, and multi-device tree divergence deterministically converge without orphan nodes or circular dependency panics.
- UTF-16 Indexing (yrs Text Engine): Eliminates multi-byte clipping bugs in 3-byte Korean characters, astral plane symbols, and 4-byte emojis across Web (TipTap), Desktop (Tauri), and Mobile (Swift/Kotlin) surfaces.
- Single-File SQLite WAL Container (
.narr): Replaces fragile directory-bundle formats (.scriv) with atomic, zero-corruption SQLite WAL storage supporting 1M+ character manuscripts. - Automated Ergonomics & Zero-Manual-QA: Built-in 45% eye-level typewriter scroll locking,
@mention lore autocomplete, corkboard matrix synchronization, and split-view reference inspection.
narratics/
โโโ Cargo.toml # Workspace root & package manifest
โโโ LICENSE # PolyForm Noncommercial License 1.0.0
โโโ apps/
โ โโโ desktop/ # Tauri v2 Native Desktop Application (macOS/Win/Linux)
โ โโโ Cargo.toml
โ โโโ tauri.conf.json
โ โโโ src/ # Native IPC commands & desktop state
โ โโโ ui/ # Zero-divergence local web studio shell
โโโ crates/
โ โโโ engine-core/ # Pure offline Rust CRDT engine & container
โ โ โโโ src/tree_crdt.rs # Kleppmann Tree Move CRDT
โ โ โโโ src/text_engine.rs # yrs UTF-16 text editing & tombstone compaction
โ โ โโโ src/container.rs # .narr single-file SQLite WAL persistence
โ โโโ backend-sync/ # Axum AOT sync server & responsive Web Studio
โ โ โโโ src/app_state.rs # Multi-book library, CRUD & Typst PDF compiler
โ โ โโโ src/web_ui.rs # TipTap editor, corkboard, lore mentions & split-view
โ โ โโโ src/landing_ui.rs # Production landing page & downloads
โ โ โโโ tests/regression_suite.rs# 5-test comprehensive backend regression suite
โ โโโ mobile-bridge/ # C-FFI / JNI / Swift Native Mobile Bridge
โ โโโ bindings/android/ # Kotlin JNI bindings
โ โโโ bindings/ios/ # Swift bridge interface
โโโ docs/ # Verified screenshots, benchmarks & specs
โโโ scripts/
โ โโโ regression_gate.sh # Full zero-defect build, test & E2E gate script
โ โโโ sync_desktop_ui.py # Auto-synchronizes web studio to desktop shell
โโโ tests/
โโโ e2e_ux_automated_gate.py # Headless browser E2E interaction gate
Every release candidate is strictly subjected to a 13-axis adversarial hardening suite (crates/engine-core/tests/adversarial_hardening.rs), ensuring zero-defect stability under extreme conditions:
| Axis | Scenario & Invariant | Verdict | Execution Time |
|---|---|---|---|
| Cycle 1: Offline Invariant | Total network partition during heavy writes, crash restart, snapshot preservation | PASS | 0.05s |
| Cycle 2: Boundary & Negative | Empty doc deletion, negative offsets, out-of-bound text slicing | PASS | 0.00s |
| Cycle 3: Filesystem Hostility | Special characters, nested path traversal, directory permissions friction | PASS | 0.05s |
| Cycle 4: Deep Tree Cycle | 50-level circular ancestor reparenting attempts blocked deterministically | PASS | 0.00s |
| Cycle 5: Poison CRDT Payload | Malformed byte streams and truncated wire packets rejected gracefully | PASS | 0.06s |
| Cycle 6: Korean & Astral Emoji | 3-byte Hangul + 4-byte emoji boundary slicing without panic | PASS | 0.00s |
| Cycle 7: 4-Peer Convergence | 4-device concurrent edits and chapter movements converge to identical tree | PASS | 0.00s |
| Cycle 8: Tombstone Compaction | 200 consecutive deletes/edits with 1.1ms bounded memory compaction | PASS | 0.01s |
| Cycle 9: SQLite WAL Contention | Multi-connection concurrency, transaction isolation, atomic rollback | PASS | 0.01s |
| Cycle 10: Schema Parity | Lossless JSON / Binary wire-format roundtrip fidelity | PASS | 0.00s |
| Cycle 11: 1M-Char Stress Load | 1,000,000-character manuscript streaming without latency spikes | PASS | 0.02s |
| Cycle 12: Injection Defense | Malicious lore IDs and SQL injection attempts neutralized | PASS | 0.01s |
| Cycle 13: Trash Quarantine | Deleted chapter/scene safe quarantine and isolation invariant | PASS | 0.00s |
To eliminate human manual QA fatigue, tests/e2e_ux_automated_gate.py runs real browser DOM and keyboard event evaluations:
-
@Mention Autocomplete Navigation: Simulates@keystroke,ArrowDownhighlight switching, andEntertoken insertion. -
Typewriter Mode Vertical Locking: Measures cursor vertical coordinates across 30 lines of typing to verify eye-level 45% (
$\pm 5%$ ) lock. - Cross-Chapter Scene Reparenting: Verifies dragging and inspector dropdown reparenting with SQLite WAL roundtrip.
- Corkboard Active Synchronization: Validates chapter switching and active card highlighting when navigating sidebar items.
- Reversible Undo Notification: Validates 6-second timeout toast notification and undo callbacks.
- Rust:
1.80+(stable) - Python:
3.10+(for E2E browser tests) - Typst: (Optional, for PDF book typesetting export)
# Clone the repository
git clone https://github.com/cycorld/narratics.git
cd narratics
# Check workspace compilation
cargo check --workspace
# Run complete 22-unit test suite + adversarial hardening
cargo test --workspace -- --nocapture
# Run full zero-defect regression gate (includes E2E UX tests)
./scripts/regression_gate.sh# Build and run the Axum web studio locally
cargo run --release -p narratics-backend-sync
# Open http://localhost:3901/ in your browserThis project is licensed under the PolyForm Noncommercial License 1.0.0.
- Personal & Noncommercial Use: 100% Free and Unrestricted. You may freely use, modify, study, run, and distribute Narratics for personal projects, open-source research, education, hobbyist writing, and amateur creative pursuits.
- Commercial Use & Commercial Services: Any use for commercial purposes (including but not limited to commercial SaaS hosting, enterprise licensing, or paid subscription services) requires a separate commercial license agreement.
For commercial licensing, enterprise deployment, or partnership inquiries, please contact:
- Charles Choi (
cycorld@martian.link) - Entropy Paradox, Inc. (์ํธ๋กํผํจ๋ฌ๋ ์ค ์ฃผ์ํ์ฌ)