Notes App
Table of Contents
Project Overview
An offline-first, Obsidian-class Markdown and Personal Knowledge Management (PKM) vault built with Svelte 5 Runes, Vite 6, Marked.js, KaTeX, and IndexedDB. It pairs bi-directional [[WikiLinks]], backlinks, unlinked mentions, and an interactive force-directed Knowledge Graph with a Right Inspector sidebar, slash commands, Obsidian callouts, YAML frontmatter pills, multi-tabs, and a resizable scroll-synced split view.
Problem Statement
Browser-based Markdown tools rarely bridge the gap between lightweight note pads and full PKM vaults like Obsidian. Supporting bi-directional linking, live math rendering, multi-tab editing, and graph visualization offline—without XSS vulnerabilities, async race conditions, or main-thread typing lag—requires fine-grained reactivity and hardened local persistence.
Solution Architecture
Svelte 5 Runes drive fine-grained reactive state across open tabs, the editor, and the Right Inspector. Keystrokes feed a sanitized Marked.js + KaTeX + Highlight.js + DOMPurify rendering pipeline while debounced transactions persist notes, version history, and disk sync into IndexedDB.
Technical Deep Dives
Svelte 5 Runes, Bi-Directional WikiLinks & Knowledge Graph
- Upgraded the reactive core to Svelte 5 Runes, indexing
[[Note Title]]and aliased links across the vault to power incoming Backlinks, Unlinked Mentions (with 1-click auto-link), note embeds, and instant creation of unresolved notes. - Built an interactive pan/zoom force-directed SVG Knowledge Graph (
Ctrl+G) visualizing note clusters and hub connections alongside a collapsible Right Inspector (live H1–H6 Outline, Links, and Folder/Tag Properties).
Obsidian Authoring, KaTeX Math & Hardened Sanitization
- Added
[[WikiLink autocomplete, a/Slash Command menu, smart list continuation with native Undo/Redo preservation, clipboard image paste, interactive preview task checkboxes, and 1-click Daily Notes. - Supports KaTeX math equations, styled & collapsible Obsidian callouts (
> [!NOTE],> [!FAQ]-), YAML frontmatter property pills, and theme-adaptive Highlight.js code blocks—all sanitized through DOMPurify with XSS and race-condition fixes.
Multi-Tab Synced Split View, 4 Themes & Offline Persistence
- Engineered a multi-tab bar with a draggable split-pane divider (25%–75%) and proportional scroll synchronization between Editor and Preview, plus dedicated print styles and 4 palettes (Dark Obsidian, Clean Light, Pure OLED Black, Warm Sepia).
- Persists notes, version history, and disk sync asynchronously in IndexedDB with safe single-note
.md/.htmlexport and full-vault.jsonmerge backup.
Algorithm & Complexity Benchmarks
Markdown + KaTeX + DOMPurify Render
vs O(N) VDOM re-renderO(N) Space: O(N) Fine-grained Svelte 5 Runes updates keep live split-view preview compilation under 15ms.
IndexedDB Vault Lookup & Graph Index
vs synchronous localStorageO(V + E) Space: O(V + E) Async IndexedDB persistence and incremental WikiLink indexing avoid main-thread typing stalls.
Architecture Trade-Offs
Offline Knowledge Vault Storage
Handles rich notes, pasted images, and version snapshots asynchronously without hitting the 5MB synchronous storage ceiling.
Reactivity & Graph Rendering
Delivers obsidian-class WikiLinks, multi-tabs, and pan/zoom graph navigation while keeping the Vite 6 bundle lightweight and memory usage low.
Project Results
Obsidian-Class PKM
Delivers WikiLinks, backlinks, unlinked mentions, Knowledge Graph, KaTeX math, callouts, and Right Inspector 100% offline in the browser.
Hardened & Fast
Eliminated XSS and async race loopholes while maintaining sub-15ms live preview compilation with Svelte 5 Runes.
Workspace Ergonomics
Multi-tabs, resizable scroll-synced split view, slash/WikiLink autocomplete, and 4 adaptive themes with zero cloud lock-in.