Wim Cools
1.1K posts

Wim Cools
@wcools
Building https://t.co/mH2S4ymRdI - A new IDE but for notes and tasks (local-first, encrypted and multiplayer)




Local AI agents really feel like a turning point. That's awesome but tbh I'm just as excited about the terminal/CLI aesthetic comeback they're causing 🤩

Okay a very-high level (raw!) braindump of some architecture/stack decisions. We'd love to write some blog posts about it later but gotta ship first :) - app written completely from scratch in vanilla ES6 - no frameworks, no dependencies - (.. except libsodium for encryption and one for grapheme parsing if i'm not forgetting sth) - entire dev env is simply editing source file and reloading - CSS rules and design also done by hand - editor also completely from scratch. no contenteditable. - .. this was needed to seamlessly blend outlining (structured/networked) features with long form editing, so it both works without losing the illusion of simply editing text - that includes logic for scrolling, dragging, selections, (multiplayer) cursors, formatting, dataviews, ... - app UI plugins can be written in JS to create dynamic views or add features. isolated by subdomain. - we try to batch, defer and delta-render whenever possible. virtual scrolling in some places, lots more low hanging fruit there if needed. - main thread is for UI updates - custom-made sync engine, which runs in a separate shared worker thread - multiple tabs communicate async with shared worker (kind of offline multiplayer) - data cached locally in indexeddb ("sharded" into buckets for performance) - worker thread also takes care of other work like encryption. e.g. attachments are decrypted on first request off the main thread then cached in separate indexeddb. - because all data is local, things like dynamic queries, views and global fuzzy sort are pretty quick! - real-time updates over websocket, fallback over POST if needed - syncing backend server written in Go. - data updates synced as encrypted deltas, server occasionally creates new snapshots of entire encrypted state - both client and server consolidate deltas and resolve conflicts (like tree cycles) in same global order to ensure eventual consistency allowing for concurrent offline edits - server can be self-hosted on mac, windows or linux. deployment is running a single binary. - encrypted data on server is stored in a SQLite per workspace - encrypted files on server stored on FS or R2 - lowest part of the stack for cloud version: just simple metal, dedicated servers. commodity hardware super cheap and powerful these days There's plenty more for an actual write up but yeah those have to wait for now ;). If you're interested in more you can always ask @jdvhouten or me
















