TL;DR

Threlmark’s architecture treats the local disk as the source of truth, storing data in JSON files. This approach boosts offline resilience, simplifies sync, and removes dependency on centralized servers, reshaping how we build apps.

Imagine working on your project, making changes, and knowing your data is safe right there on your disk. No cloud, no server, no middleman. That’s the core idea behind Threlmark’s local-first architecture — the disk isn’t just storage; it’s the contract that defines everything.

This approach turns traditional app design on its head. Instead of relying on a central database or an online server, Threlmark treats files on your device as the single source of truth. It’s a game-changer for offline work, multi-device sync, and building simpler, more transparent apps. In this deep dive, I’ll walk you through how this architecture works, why it’s so powerful, and what it means for the future of app design. Learn more about local-first architecture.

Disk is the contract: inside Threlmark’s architecture — ThorstenMeyerAI.com
ThorstenMeyerAI.com
Threlmark · Technical Deep-Dive
Threlmark · architecture

Disk is the contract: inside a local-first roadmap hub

A Next.js app on top of plain JSON files — no database, no cloud, no accounts. The key decision: the on-disk layout IS the API. Everything else cascades from taking that seriously.

Next.js · TypeScript · JSON-on-disk · MIT · part 2 of the Threlmark series
01The core decision

There is no server-of-record — the files are the record

The UI and any external tool reach the same files through the same discipline. The data root defaults to ~/.threlmark — home-based, because it’s a shared hub every one of your apps points at.

~/.threlmark/ ├─ threlmark.json # manifest ├─ links.json # dependency graph ├─ projects// │ ├─ project.json # meta + wipLimits │ ├─ board.json # lane ordering │ ├─ items/.json # ONE card per file ← source of truth │ ├─ suggestions/ # the Inbox (drop-zone) │ ├─ handoffs/ # recorded agent handoffs │ ├─ reports/ # agent report drop-zone │ └─ ROADMAP.md # human-readable mirror ├─ shared/items/ # cards many projects ref └─ archive/ # archived, still readable

Inspectable

Every artifact is a file you can cat, diff, grep, commit.

Portable · no lock-in

Back up with cp, sync with Dropbox / git, migrate trivially.

Interoperable

Any tool in any language joins by reading / writing files.

Restartable

No in-memory state to lose — stateless over the files.

02Making files safe
SANDISK 1TB Extreme Portable SSD (Old Model) - Up to 1050MB/s, USB-C, USB 3.2 Gen 2, IP65 Water and Dust Resistance, Updated Firmware - External Solid State Drive - SDSSDE61-1T00-G25

SANDISK 1TB Extreme Portable SSD (Old Model) – Up to 1050MB/s, USB-C, USB 3.2 Gen 2, IP65 Water and Dust Resistance, Updated Firmware – External Solid State Drive – SDSSDE61-1T00-G25

Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity…

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Two disciplined patterns instead of a database

“Just use files” is easy to get wrong. These two patterns — ported from a battle-tested sibling app — are what make file-based state sound rather than reckless.

Pattern 1

Atomic writes

Write to a temp file in the same dir, then rename() over the target. Rename is atomic on one filesystem — a crash mid-write leaves the complete old file or the complete new one, never a half.

write .tmp-pid-rand fsync rename() over target
Pattern 2 · one file per item

The board heals itself

A single roadmap.json array races when two tools write at once. One file per card makes writes collision-free. Lane order lives in board.json and reconciles on read.

The payoff: an external tool never touches board.json. It writes an item file — the board fixes itself on Threlmark’s next read. Unknown keys are preserved, so the contract is forward-compatible.
03Derived, never stored
Yuan Smart Sync Pen for Note Taking, Digital Notebook(3-Pack A4) with Pen, Sync Handwriting, Offline Storage, Note Sharing, Gift for Adult Women Men Coworker Teacher Student Friend for IOS and Android

Yuan Smart Sync Pen for Note Taking, Digital Notebook(3-Pack A4) with Pen, Sync Handwriting, Offline Storage, Note Sharing, Gift for Adult Women Men Coworker Teacher Student Friend for IOS and Android

【Creative Paper Tool】 The Yuan Smart Pen with Digital Notebook Set is an innovative, app-based paper product system….

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

The numbers can’t drift from the files

Anything computable from item state is computed — so the displayed numbers can never disagree with the underlying JSON. Priority is the clearest example: it’s calculated on read, never persisted.

priority — computed on read

Impact weighted heaviest; effort the only axis that subtracts. Reused verbatim from the original tool, so imported cards rank identically.

priority = max(0, round(impact·3 + evidence·2 + fit·2effort·1.5))
a 5 / 5 / 5 / 4 card 29
work-item age
now − lane-entry time. Past threshold (dev 7d, ranked 21d, idea 60d) → stale.
cycle time
first DevelopmentDone. Derived from append-only transitions[].
throughput
items reaching Done per ISO week, 8-week window.
WIP
count per lane; over the cap shows 3 / 2 in red.
04The closed agent loop · press play
Free Fling File Transfer Software for Windows [PC Download]

Free Fling File Transfer Software for Windows [PC Download]

Intuitive interface of a conventional FTP client

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

A handoff is a first-class flow event

The genuinely 2026-shaped part: most building is done by AI agents, so Threlmark closes the loop. Watch a card go from ranked to Done without anyone dragging it.

Handoff → report → self-move

The brief carries a reporting protocol. The agent reports through REST or the filesystem — and a done report moves the card itself.

Ranked
Add price-drop alertsscore 31 · ready
Development
Handed off 🤖
Done
▶ preferred — REST
POST /api/projects/:id/
items/:itemId/report

Direct call. Applied immediately.

▶ fallback — filesystem
drop reports/.json
→ ingested on read

Robust even if the server’s down at finish time.

🤖 claude done: price-drop alerts shipped · typecheck + lint + build passed — card moved to Done
05Portfolio score & deployment
Smart Keypad Door Lock with Handle, Smart Door knobs with Lock, Auto Door Lock with Code and App, Keyless Entry Door Knob for Bedroom, Front Door, Smart Home, Apartment, Local Data Storage

Smart Keypad Door Lock with Handle, Smart Door knobs with Lock, Auto Door Lock with Code and App, Keyless Entry Door Knob for Bedroom, Front Door, Smart Home, Apartment, Local Data Storage

3-in-1 Smart Access Upgrade for Every Space – Transform your entryway experience with the KLLOQUE door lock, designed…

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

A small formula, and an honest hosting caveat

Because items are globally addressable (/), the Portfolio ranks everything together by a status-weighted score — finishing beats starting, blockers get a boost.

Portfolio ranking — status-weighted

In-flight work floats to the top; bottlenecks cost the most, so blockers get nudged up.

score = priority · statusWeight (+ 0.1 · blockedCount · priority)
1.3
development
1.0
ranked
0.85
idea
0.15
done
Path 1

Static read-only demo

Seeded data, writes to localStorage. Try-before-you-clone.

Path 2

Personal Node instance

Password-gated, persistent backed-up THRELMARK_DATA_DIR.

Path 3

Multi-tenant SaaS

Add accounts + per-tenant isolation. A separate build.

The elegant part: the store interface src/lib/*/store.ts is the natural seam — the same boundary that keeps the local tool simple is the one you’d extend for multi-tenancy. The architecture doesn’t fight that future; it just doesn’t pay for it until you need it.
ThorstenMeyerAI.com
Threlmark · open source (MIT) · github.com/MeyerThorsten/threlmark · part 2 of a series · file layout, formula, weights & agent-loop channels are Threlmark’s actual mechanics.

Key Takeaways

  • Treat the filesystem as your app’s API — it simplifies architecture and improves resilience.
  • Use JSON files for their readability, portability, and compatibility with atomic write techniques.
  • One file per item prevents race conditions and makes concurrent editing straightforward.
  • A layered directory structure enforces discipline and makes data easy to back up or migrate.
  • Atomic writes and tolerant merging ensure data safety and forward compatibility.

Why Making Disk the Contract Turns Apps Into Super-Resilient Machines

When your app’s data lives directly on your disk in JSON files, it becomes inherently more resilient. If your internet drops, your work doesn’t stop. You just keep editing, reading, and saving — because the data is right there, on your device.

Take a real-world example: a designer working on ideas across multiple devices. With Threlmark, her sketches, notes, and task lists stay available offline, no matter where she opens her laptop or tablet. When she reconnects, syncing is just a matter of copying files — no complicated conflict resolution needed.

This setup also simplifies debugging and extension. You can open a file, see exactly what’s stored, and even edit it manually if needed. Plus, it’s compatible with any language or tool that can read/write files, making integrations a breeze. The core idea? The filesystem itself becomes the API, a trusted source of truth that’s simple, transparent, and robust.

Why Making Disk the Contract Turns Apps Into Super-Resilient Machines
Why Making Disk the Contract Turns Apps Into Super-Resilient Machines

How Threlmark Stores Data — JSON Files That Speak Your Language

At the heart of Threlmark’s design is JSON — human-readable, flexible, and easy to work with. Every project, card, or task is a JSON file stored in a dedicated folder. For instance, each roadmap item lives in items/ as its own file — think of it like a separate note on your desk, always accessible. Explore more about data formats in app design.

Why JSON? Because it’s simple to inspect, diff, and merge. If you want to see what a task looks like, just open the file in your editor. Want to update its priority? Edit the JSON directly. This transparency makes data manipulation straightforward and safe, especially with atomic write techniques that prevent corruption during crashes.

Imagine working on a project, and manually editing a task’s JSON to prioritize it. When you save, the system atomically replaces the file, avoiding race conditions. This simplicity keeps the data consistent, even if multiple tools or devices modify files at once.

Why One File Per Item Beats Big JSON Files for Concurrency

Picture this: instead of a giant roadmap.json that holds all your tasks, Threlmark keeps each item as its own file. This tiny shift—one file per task—eliminates race conditions and makes updates lightning-fast.

Suppose two devices are updating different tasks simultaneously. With a big JSON file, they’d risk overwriting each other. But with individual files, each change is atomic. The system only needs to replace one file, not juggle a huge list.

And because the files can be read and written independently, multiple tools or users can work at once without conflicts. The system’s self-healing properties, like reconciling the lane order from board.json against existing items, keep everything consistent automatically.

Why One File Per Item Beats Big JSON Files for Concurrency
Why One File Per Item Beats Big JSON Files for Concurrency

How the Layered Filesystem Structure Keeps Everything Organized

Threlmark’s directory layout isn’t random; it’s a precise contract. At the root, you find threlmark.json and links.json, defining the core project metadata and dependencies. Each project has its folder with project.json, board.json, and then the key items/ folder holding individual task files. See how directory structures enforce data integrity.

External suggestions go into suggestions/, and completed or archived projects move to archive/ — all readable, all portable. Shared tasks are stored under shared/items/. This structure keeps everything predictable, making it easy to back up, sync, or manually edit.

Imagine a team sharing a folder on Dropbox. Anyone can peek into items/ and see the latest task states without needing a special database or server. It’s a simple, transparent contract that everyone can follow.

Keeping Data Safe with Atomic Writes and Tolerant Merging

Atomic writes are the backbone of safe file updates. Threlmark writes to a temporary file first, then renames it over the original. This guarantees that a crash or power failure doesn’t corrupt your data. Discover more about data safety techniques.

Imagine editing a task on your laptop. The system saves your changes as task.json.tmp, then instantly swaps it in. The original remains untouched until the new file is ready, so no half-written files are ever seen.

Additionally, the system reads files with a tolerant merge: missing fields get defaults, unknown keys stay untouched, and scores are clamped. This forward compatibility means you can add new features or tools without breaking existing ones — the files just evolve naturally.

Keeping Data Safe with Atomic Writes and Tolerant Merging
Keeping Data Safe with Atomic Writes and Tolerant Merging

Sync and Conflict Handling — Making Multi-Device Work Seamless

Syncing in Threlmark isn’t push or pull alone; it’s a continuous dance. Changes made locally are saved as files, then synchronized across devices via file sharing or cloud storage. Conflicts are rare because each file is atomic, and the system can reconcile differences by re-reading files and applying simple rules. Learn about seamless multi-device sync.

For example, if you edit a task on your phone and your laptop simultaneously, the last write wins at the file level. But more sophisticated tools can compare timestamps or merge changes intelligently. The key is that the architecture doesn’t rely on a central server — just files that any device can access and update.

This setup means your data stays consistent and accessible, even if some devices are offline temporarily. Once reconnected, the sync process quietly harmonizes all the changes without user intervention.

Developer Simplicity: Less Code, Fewer Bugs, More Power

When your app treats the disk as its main contract, your code gets simpler. No need for complex API layers, database drivers, or network error handling. Just read, write, and trust the filesystem.

For instance, updating a task involves just editing a JSON file and saving it atomically. No worries about partial updates or race conditions — the system handles that for you.

This simplicity means fewer bugs, easier debugging, and faster feature development. Plus, developers can peek directly into data files, making manual fixes or experiments straightforward.

Frequently Asked Questions

What does ‘disk is the contract’ mean?

It means the application’s core data is stored directly in files on your device, and these files define the system’s state. The app reads and writes these files as the single source of truth, making data transparent, portable, and easy to manage.

How is Threlmark’s architecture different from traditional server-based apps?

Unlike apps that rely on centralized databases or cloud servers, Threlmark keeps data locally on your disk. Syncing happens later, and the system’s logic depends on files rather than a remote source, offering better offline resilience and simpler data handling.

Why use JSON files instead of a database?

JSON files are human-readable, easy to diff, and portable. They allow direct manual editing, straightforward merging, and atomic updates, which reduce complexity and increase transparency compared to traditional database systems.

How does syncing work in a local-first system?

Syncing involves copying updated JSON files across devices via cloud storage or file sharing. Since each change is an atomic file update, conflicts are minimized, and the system can reconcile differences automatically or manually.

What happens when I’m offline?

You can continue working without interruption because your data is stored locally. Changes are saved directly to disk, and syncing occurs automatically once you reconnect to the network.

Conclusion

The future of building resilient, offline-capable apps might just be writing to your disk first. Threlmark shows that by making the disk the contract, you can create systems that are simpler, more reliable, and more open to collaboration.

Imagine your next app not relying on servers or complex databases but instead trusting the humble file system to hold everything — that’s the power of a local-first, disk-as-the-API approach. It’s a quiet revolution that puts you back in control.

Developer Simplicity: Less Code, Fewer Bugs, More Power
Developer Simplicity: Less Code, Fewer Bugs, More Power
You May Also Like

Build vs Buy a Prebuilt AI Workstation

Struggling to choose between building or buying your AI workstation? Discover the latest insights, real costs, and practical tips for 2026’s AI boom.

Why Investors See Anthropic’s Series H as a Compute Power Play

Discover why Anthropic’s $965B valuation is less about valuation and more about massive compute capacity — reshaping AI infrastructure and hardware supply chains.