2.8 KiB
2.8 KiB
TextDB
TextDB is a non-destructive, completely offline, local-first text editor with built-in Markdown preview functionality. Its core promise is simple: your edits never overwrite your history. Every manual save is immutable and append-only, and autosaves are kept as a separate draft layer. No accounts, no telemetry, no remote fonts, and no network calls.
Features
- Non-destructive editing: manual saves are immutable; drafts never overwrite manual versions.
- Sidebar list of texts with live search (titles + version bodies).
- Editor with title, content area, and clear save status.
- Cmd/Ctrl+S creates a new immutable manual version.
- Markdown preview mode with external link support and printable output.
- Pressing Tab toggles Edit/Preview mode.
- Autosave draft (debounced) that can be safely discarded.
- History panel listing versions by timestamp (drafts included when present).
- Settings: theme (default/bright), text size slider, and optional line numbers.
- Collapsible sidebar with persistent state.
- Nested folders (projects) with expandable tree view.
- Right-click a text or folder to move it into another folder.
- Deleting a folder moves its contents one level up (never deletes texts).
- Export the current text to a
.txtfile. - Open
.txtor.mdfiles to create new entries from file content. - Drag and drop
.txtor.mdfiles onto the window to import them. - Registers
.txtand.mdfile associations for using TextDB as a default editor.
Use cases
- Non-destructive notepad: jot ideas without fear of losing earlier thoughts.
- Safe editor for authors: keep every revision and compare or roll back at any time.
- Research notes: maintain evolving notes with an audit trail of changes.
- Sensitive drafts: keep local-only writing with immutable history and zero cloud sync.
- Prompt or snippet library: store and iterate on reusable text safely.
Tech stack
- Tauri v2
- React + Vite + TypeScript
- SQLite via
@tauri-apps/plugin-sql
Install & run
- Install dependencies:
npm install
- Start the app:
npm run tauri dev
Autosave + versioning behavior
- Typing triggers a debounced autosave (~600ms) that writes to the draft record.
- Manual saves (Cmd/Ctrl+S or the button) append a new version and clear any draft.
- Autosave only overwrites the single draft row; manual versions are never overwritten.
- History shows all manual versions plus the current draft (if any).
Local storage
- SQLite is loaded via
Database.load("sqlite:text.db"). - The database file is stored in the Tauri app data directory.
- The app is fully offline by design: no telemetry, no external fonts, no CDNs.
- UI settings (theme, text size, line numbers, sidebar + folder collapse state, last selected text) are stored in localStorage.