andyreagan.com

A little mobile editor for my org-mode brain   software orgmode pkm

I keep my whole personal knowledge base in Org mode – a flat directory of .org files in ~/brain, edited in Emacs on the laptop and exported to HTML for the blog. On the desktop this is a joy. On my phone it has always been the weak link.

The single biggest source of friction was adding photos. I'd take a picture of a race, a bike repair, a chicken coop fix – and then it would sit on my phone until I got back to a real keyboard, remembered to move it into the right media/ folder, and wrote the link by hand. Most of the time the moment passed and the photo never made it in. Everything else (a quick note, a link for the blogroll, ticking off a TODO) was technically possible through some combination of SMB shares and iOS org apps, but fiddly enough that I didn't reach for it.

So I built mobile-brain: a tiny mobile-first web app that does only the handful of things I actually want to do from my phone. View and edit pages from the org source (not the rendered HTML), create new posts and pages, capture a link to the blogroll or a note to my journal, toggle TODOs, and – the whole point – snap a photo or pick one from the gallery and have it dropped into the right companion media/ directory with the org link inserted right where my cursor is.

The design constraint that keeps it simple: it only ever writes .org source and image files. It never renders HTML, never publishes, never touches the deploy pipeline. All of that still happens on the desktop, where it belongs. The app just gets words and pictures into the files; Synology Drive syncs them back to the laptop, and the next time I'm at my desk the normal Emacs export takes over. That division of labor is why it could stay small enough to actually finish.

A few things fell out nicely. It runs inside my Tailscale VPN, bound to the tailnet IP, so there's no auth to build and nothing exposed to the internet – the network is the perimeter. It installs to the iOS home screen as a PWA, so it opens full-screen like a real app. And it adds backlinks the way org-super-links does on the desktop: pick a page to link to, and it both inserts the forward link and writes the reverse link into the target's :BACKLINKS: drawer, minting an :ID: if the heading doesn't have one. I had it use human-readable slug IDs (home-gym-build) instead of UUIDs – org-id indexes the literal :ID: value, so slugs resolve cross-file in Emacs exactly like UUIDs do, they're just nicer to read.

It is built with Flask and Svelte, which is overkill for what it is, but the two genuinely nicer-on-mobile pieces – inserting an image at the cursor, and autosave on a flaky connection – earned the front-end framework.

This very much embodies file over app: the app is disposable, the files are forever. If mobile-brain disappears tomorrow, my brain is still a pile of plain text I can open anywhere. That's the only kind of tool I want to build for this.

Last modified: June 30, 2026