Flow is a local-first markdown workspace that runs entirely in your browser. No account, no sign-up, no server holding your notes. You open it, write, and your docs stay in IndexedDB on your machine.
Live: https://markdown-editor.opalhq.fun/
Repo: https://github.com/duggal1/markdown-editor
I built it because I kept losing time to editors that asked for a login before I could type a heading, and because a lot of what I write is drafts I would rather not send anywhere. Local-first made that a property of the app instead of a line in a privacy policy.
Three engineering decisions did most of the work.
1. Virtualized preview, search in a web worker
Big docs are where most browser editors fall apart. The preview and the code pane are virtualized with TanStack Virtual, so only the rows in view are in the DOM. Updates are deferred and markdown is processed in chunks. Search and word count run in a web worker, so typing stays responsive while a large file is scanned. The editor is CodeMirror 6 with write, split and preview modes and GitHub-flavored markdown, not a homegrown engine. That saved me months.
2. Sandboxed HTML and SVG preview
Markdown allows raw HTML, which is a footgun. Inline HTML gets sanitized. A standalone HTML file renders in a sandboxed iframe with a strict content security policy. SVG preview has no script permissions. I can preview files you drop in without giving them a way to run code against the rest of the page.
3. The tiny ZIP writer behind /draw
/draw is a screenshot annotation mode. Coordinates are stored relative to the image, so annotations survive a resize. Export is JPEG, WebP, or a ZIP of everything. Instead of adding a zip library I wrote a dependency-free STORE zip writer and ran it in a worker. No compression, which is fine for screenshots, and it stayed small.
Saving is debounced IndexedDB writes with a bounded localStorage recovery copy for the case where a write dies mid-edit. PDF export is there too. The stack is React 19, TypeScript, Vite and CodeMirror 6. Built solo.
The honest tradeoff: local-first is not a backup. Your docs live in one browser's storage. Clear site data and they are gone. There is no sync and no versioned history yet. I would rather say that up front.
So, what is missing? If you open it with your largest markdown file, where does it break for you? What would you add first, and what would make you keep using an editor with no account?
Top comments (2)
Putting search and word count in a web worker is a nice win, since those are the first things to jank on a big file. One thing to watch with IndexedDB-only storage is that browsers can evict it under storage pressure unless you call navigator.storage.persist(), so it may be worth requesting that and offering a one-click export/backup for people with long-lived notes. For the sandboxed HTML preview, did you also drop allow-same-origin from the iframe sandbox so previewed scripts can't reach the editor's storage?
Chunked markdown plus search in a worker is what I would have missed first. Have you measured how large a file gets before debounced IndexedDB writes start to hitch on their own?