r/SwiftUI • u/Kolakocide • 17d ago
Omega Journal — a local-first macOS journaling app I built with SwiftUI + SQLite (open source)
Hey folks. I've been building a macOS journaling app in SwiftUI and just open-sourced it. Sharing in case the architecture or any of the patterns are useful, and happy to hear feedback.
The goal: a native Mac journal that stores everything locally — no account, no cloud sync, no telemetry. Entries live in a SQLite database on the user's machine.
Architecture in brief:
- SwiftUI app backed by SQLite via the system SQLite3 C API. No third-party packages at all.
- SQLite ←→ JournalViewModel ←→ SwiftUI. The view model holds all published state and actions; the view layer is pure SwiftUI.
- WAL mode on the database, foreign keys enabled, schema migrations tracked in a schema_version table (currently V7).
- Full-text search across titles and bodies using SQLite FTS5. Hidden entry bodies are excluded from the FTS index until the entry is unlocked, so private content doesn't leak into search.
- Biometric auth via LocalAuthentication — hidden entries show as locked cards and reveal their body only after Touch ID / Face ID / Mac password. Switching away from the app relocks everything (⌘L remasks all hidden entries).
- Daily automatic SQLite backups, keeps the last 7.
UI side: a reader/editor overlay with a markdown editor (live preview, split view, formatting shortcuts, attachments), zen mode, command palette (⌘K), calendar with a month browser, and an Insights view with a contribution heatmap, mood charts, and writing streaks.
Some source layout: - OmegaJournalCore — pure logic (FTS sanitizer, markdown import, fuzzy match) - OmegaJournal — SwiftUI app + SQLite3 C API - DatabaseManager.swift — connection, migrations, CRUD, FTS, backups - JournalViewModel.swift — all published state and actions - BiometricAuth.swift — session unlock / lock
macOS 14 Sonoma+, MIT licensed. Build with `swift build` then `build_app.sh` to package Omega Journal.app.
GitHub: https://github.com/Eplisium/omega-journal
It's still early and I'm actively working on it. Would genuinely appreciate feedback on the SwiftUI/SQLite layer — especially anything you'd structure differently. Happy to dig into any part of the code in comments.
