Solo Developer 2026 Ongoing
Nextpage
A local-first Markdown journal for macOS that keeps every note as a plain .md file in a folder you choose, with debounced atomic autosave and conflict detection when files change outside the app. Stage 1 makes no AI or sync requests; both are planned.
Overview
Nextpage stores each journal entry as an ordinary Markdown file in a folder the user picks, so notes stay readable and editable outside the app. Stage 1 provides folder and file navigation, create, read, edit, rename, and delete flows, GitHub-flavored Markdown preview with task lists, debounced atomic autosave, detection of changes made outside the app, and security-scoped access to the chosen folder. It is a thin fork of MiaoYan's macOS app, with unrelated features removed. AI-assisted journaling and Git synchronization come later.
Problem
Most note apps keep your writing in their own database. I wanted a journal where the plain-text file is the source of truth, so the notes outlive the app, can be edited in Finder or tracked in Git, and are never silently overwritten when the same file changes in two places.
Constraints
- Native macOS app targeting macOS 12 or later, built with Xcode 16 or later
- Stage 1 is deliberately small — no AI, no sync, no database
- Built on a fork of MiaoYan's macOS app rather than from scratch, so the inherited file and editor pipeline has to be trimmed carefully
- Markdown text is authoritative; rendered HTML is derived and never saved over the source
- Every write must be atomic, and a file changed both in the app and on disk must not lose either version
Implementation
I chose a thin fork of an existing macOS Markdown editor and kept its proven file and editor pipeline, then removed cloud sync, mobile support, presentations, wikilinks, tags, encryption, image upload, export, auto-update, and AI integration from the Stage 1 build. File rules live behind a small storage interface, writes go through a debounced atomic save that is flushed when switching files or quitting, and a file watcher reports outside edits so a divergent file produces a recoverable conflict instead of an overwrite. The codebase is organised into Business, Controllers, Views, Helpers, Extensions, Resources, and XCTest modules.
Key Decisions
-
Decision 01
Fork an existing editor instead of starting a new UI project
ReasoningThe three-pane sidebar, file list, editor, and preview were already proven. Keeping them let Stage 1 focus on journal-specific storage rules rather than rebuilding an editor.
Alternatives considered- A new SwiftUI app (more rebuild work before the first usable version)
-
Decision 02
One Markdown file per entry, no database
ReasoningThe file is the source of truth, so the journal stays portable and can be edited in Finder or tracked with Git. Rendered HTML is derived and never written back.
Alternatives considered- A local database (hides notes from other tools)
-
Decision 03
Atomic writes with conflict detection
ReasoningAutosave is debounced and flushed on file switch and quit. If a file changed both in Nextpage and on disk, the app produces a recoverable conflict copy or asks for an explicit choice instead of overwriting.
Alternatives considered- Last write wins (can silently lose content)
-
Decision 04
Security-scoped bookmark for the journal folder
ReasoningLets a direct-download app reopen the user-selected folder after relaunch without asking again.
Alternatives considered- Ask for the folder on every launch
Engineering Challenge
The autosave window where a journal can lose text
Saving on every keystroke would be wasteful, so autosave waits 1.5 seconds after the last edit before writing. That wait is exactly where a journal can lose text: quit, close the window, or switch files inside it and the last keystrokes are gone. The save code treats it as a data-loss surface. A flush call cancels the pending timer and writes synchronously, and the app calls it when the app terminates, the window closes, the note switches, and on an explicit save. A write that fails stays marked as unsaved and is retried by the next flush.
One subtle case is recorded in the code: if the timer fires at almost the same instant as a flush, the note can be written twice. Because each write is atomic and carries the same content, the cost is one extra write, so the code accepts it rather than adding locking. A test file for the debounce and flush behaviour pins these rules.
This save pipeline comes from the upstream MiaoYan editor that Nextpage forks, and the test file cites an upstream fix. My contribution was keeping it intact while trimming the fork, and writing the Stage 1 rule that a divergent outside edit must never be silently overwritten. That outside-edit flow still needs its manual smoke test.
Evidence
- Platform macOS 12 or later
- Storage One plain .md file per entry
- Network Requests None in Stage 1 — no AI or sync
- Test Files 18 XCTest files, but the test target does not compile at the current head
Stage 1 is a local Markdown journal that is built but not yet fully verified: pick a folder, navigate its files, write, preview, with atomic autosave and outside-edit detection designed to protect the text. The test target needs a fix before the suite can run, and the manual smoke test is still open. It is a fork with unrelated features removed, so much of the editor pipeline comes from the upstream project and my work is the Stage 1 scope, storage rules, and the journal-specific direction. AI prompt settings are designed in the repository but not implemented, and Git synchronization is not started.
Figures last checked against the source on 2026-11-23.
Limitations
- The XCTest target does not compile at the current head: running xcodebuild test on 2026-11-23 stopped with "type 'ClipboardManager' has no member 'makeUploadPlaceholder'", because a test still references image upload code that Stage 1 removed, so the suite cannot run until that is fixed
- The Stage 1 manual smoke test of create, edit, preview, rename, delete, relaunch, and outside-edit flows on a chosen folder is not recorded as done
- It is a fork of MiaoYan's editor, so much of the editor and file pipeline is upstream work and my contribution is the Stage 1 scope and storage rules
- The repository history was reset on 2026-10-04, so earlier commits are not available as evidence
- No AI features and no Git synchronization exist yet; the AI prompt settings are a design document only
- macOS only, built from source, and shipped outside the Mac App Store
Learnings
- Starting from a proven editor let me spend the effort on the storage and conflict rules, which is where a journal can actually lose data
- Making the plain file the source of truth simplifies everything else: previews are derived, and other tools can edit the same notes
- Removing features deliberately, and leaving them in Git history instead of disabled in the app, keeps a fork small enough to reason about
- Writing down a definition of done for Stage 1 made it clear what to leave out
Tech Stack
- Swift 6
- AppKit
- WKWebView
- swift-cmark-gfm
- XCTest
- Markdown
Nextpage is an early-stage macOS app. Stage 1 is local only: it makes no AI requests and no sync requests, and both are planned rather than built.
What’s Built
- Navigation: Folder and Markdown-file navigation for a folder you choose
- Editing: Create, read, edit, rename, and delete flows
- Preview: GitHub-flavored Markdown rendering, including task lists
- Autosave: Debounced atomic saves, flushed on file switch and quit
- External changes: Detection of outside edits with recoverable conflicts
- Folder access: Security-scoped access to the selected journal folder
What’s Next
- AI-assisted journaling: A design for global and per-project AI prompt settings exists in the repository; it is planned, not implemented
- Git synchronization: Planned for a later stage
- Manual smoke test: Stage 1 is only complete once the create, edit, preview, rename, delete, relaunch, and external-edit flows are confirmed on a user-selected folder