TL;DR

Threlmark treats disk as the primary contract for data, making apps more resilient, portable, and collaborative. This approach reduces complexity and keeps data consistent without relying on central servers or databases.

Imagine a project tool that doesn’t rely on a cloud database or complicated server infrastructure. Instead, it lives on your disk—simple, local, and incredibly flexible. That’s what Threlmark achieves with its local-first architecture, where the disk isn’t just storage; it’s the contract.

In this post, you’ll see how this design makes the whole system more reliable, hackable, and suited for modern workflows—offline work, multi-device sync, and AI collaboration included. We’ll unpack the mechanics, the decision behind it, and practical tips for applying this pattern in your own projects.

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
SANDISK 128GB Ultra Flair USB 3.0 Flash Drive, SDCZ73-128G-G46, Black

SANDISK 128GB Ultra Flair USB 3.0 Flash Drive, SDCZ73-128G-G46, Black

High-speed USB 3.0 performance of up to 150MB/s(1) [(1) Write to drive up to 15x faster than standard…

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
Music Studio 11 - Music software to edit, convert and mix audio files - Eight music programs in one for Windows 11, 10

Music Studio 11 – Music software to edit, convert and mix audio files – Eight music programs in one for Windows 11, 10

Music software to edit, convert and mix audio files

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
SUUNTO Nautic S Dive Watch Computer w/Bright AMOLED Display, GPS, Offline Maps and Weather Tools, Wireless Tank Pressure, Up to 60H on a Single Charge

SUUNTO Nautic S Dive Watch Computer w/Bright AMOLED Display, GPS, Offline Maps and Weather Tools, Wireless Tank Pressure, Up to 60H on a Single Charge

Bright AMOLED Display for Superior Readability-Enjoy crystal-clear visibility underwater with a bright AMOLED screen, designed for easy reading…

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 disk as the system’s contract: make all data files the authoritative source of truth.
  • Use atomic, temp-file writes to prevent corruption during concurrent updates.
  • Store each logical item as a separate JSON file for straightforward concurrency and external editing.
  • Design your app to read, merge, and heal its file structure automatically for resilience.
  • Plain JSON files support interoperability, forward-compatibility, and long-term safety.

Why Threlmark’s Disk-Based Design Changes Everything

Threlmark’s core idea is simple but revolutionary: your disk is the system’s single source of truth. Unlike traditional apps that rely on remote databases, Threlmark stores every piece of data directly in JSON files on your device.

This means every file — the project metadata, cards, links, and even the AI handoffs — is the authoritative record. You can open, edit, or sync these files with any tool. This approach makes your data portable, inspectable, and safe from server crashes or lock-in.

For example, when a team member updates a card, they just modify a file. No database, no API, no special permissions. And when another team member’s device reads that file, it instantly sees the latest state. It’s a straightforward, reliable system that’s easy to reason about.

Why Threlmark’s Disk-Based Design Changes Everything
Why Threlmark’s Disk-Based Design Changes Everything

How Making the Disk the Contract Simplifies Data Management

When the disk is the contract, every change boils down to a file write. Threlmark enforces this with atomic file writes—write to a temp file, then move it into place. This prevents corruption, even if your laptop crashes mid-save.

Plus, the system uses a read-merge-write approach. It reads the current file, merges in updates, and writes back atomically. This ensures data stays consistent without locks or complex concurrency controls.

Take a typical scenario: you update a card’s status, and your colleague edits another card at the same time. Both changes are safe because each update is a separate, atomic file operation. No race conditions, no clobbering.

One File Per Item: The Secret to Seamless Collaboration

Threlmark keeps each card, project, or item as a separate JSON file. This might seem trivial, but it’s a game-changer for collaboration and concurrency. Instead of editing a big list, you update just one file.

For example, if you’re working on a task list, changing one task’s status only rewrites that task’s file. No need to load or rewrite the whole list. External tools can even modify individual files without conflicts.

The board layout, which orders tasks in lanes, is stored separately. It’s a self-healing structure: every time you read it, it checks if all items are still present and adjusts itself if needed.

One File Per Item: The Secret to Seamless Collaboration
One File Per Item: The Secret to Seamless Collaboration

Making Files Interoperable and Future-Proof

Threlmark’s JSON files aren’t locked in a proprietary format. They’re plain, human-readable, and compatible with any tool that can read or write JSON. This openness means your data isn’t stuck in a black box.

It also supports forward compatibility. If a new feature adds fields, older tools will just preserve them when reading and writing files. No data loss or need for upgrades.

For example, an external AI agent can inspect, modify, or add new attributes to a card just by editing the JSON file. All without special permissions or APIs.

How Threlmark’s Architecture Supports Offline and Multi-Device Work

Local-first tools like Threlmark excel at offline use. Since all data lives on your disk, you can keep working without internet. When you go online, the system syncs files with other devices or servers.

This is why the disk-as-contract model is so powerful: it removes the reliance on a central server for immediate data access. Your device becomes the master, and sync handles the rest.

A real-world example: a designer in a remote cabin updates project cards without Wi-Fi. Later, when they reconnect, the changes sync seamlessly. No disruptions, no data conflicts.

How Threlmark’s Architecture Supports Offline and Multi-Device Work
How Threlmark’s Architecture Supports Offline and Multi-Device Work

Practical Tips for Building Your Own Disk-Centric App

  1. Use atomic file writes to prevent corruption during saves.
  2. Keep each data entity in its own JSON file to simplify concurrency.
  3. Design your app to read and merge files rather than rewrite large blobs.
  4. Make your file structure self-healing so it remains consistent over time.
  5. Ensure all files are plain JSON for maximum interoperability.
For example, if you’re building a note app, store each note as a separate JSON file. When editing, only replace that file atomically. When syncing, compare files directly.

The Big Tradeoffs: When Disk-Based Might Not Be Enough

While this architecture offers simplicity and safety, it’s not for every app. Large-scale multi-user apps with complex permissions or real-time collaboration might need a more traditional database approach.

For example, a SaaS CRM with hundreds of users and intricate access controls might find file-based storage unwieldy. But for personal projects, small teams, or offline-first apps, it’s perfect.

Think of it like choosing a bicycle over a car: it’s lightweight, simple, and fast—if it fits your ride.

The Big Tradeoffs: When Disk-Based Might Not Be Enough
The Big Tradeoffs: When Disk-Based Might Not Be Enough

What Apps Can Win With This Approach?

Notes, task managers, design tools, and field apps all benefit from this architecture. They need fast, reliable local storage, offline capabilities, and flexible sync.

Imagine a field worker updating a checklist in a remote area. Their device stores everything locally, then syncs when back online. No data loss, no delays.

By adopting the disk-as-contract mindset, you craft apps that are resilient, portable, and adaptable.

Frequently Asked Questions

Is disk-based storage suitable for multi-user, real-time apps?

Disk-based storage works well for small teams and offline use, but it can become complex with many concurrent users and real-time collaboration. For large-scale multi-user apps, a dedicated database might still be necessary.

How do I handle sync conflicts in a disk-centric system?

Since each item lives in its own file, conflicts are easier to detect and resolve. You can implement merge strategies that compare file versions and prompt for resolution, or automate conflict resolution based on timestamps.

Can I migrate from a database to a disk-based system later?

Yes. You can export your data into JSON files and reorganize them into your new structure. The key is designing your file layout to be as simple and compatible as possible from the start.

What tools help manage disk-based data in practice?

Tools like git, Dropbox, or Syncthing can sync and version control your JSON files. For automation, scripting languages like Python or Node.js work well for batch updates and conflict resolution.

What’s the biggest benefit of treating disk as the system contract?

It simplifies data management, reduces dependencies, and makes your app inherently portable and safe against crashes or server failures. Everything is inspectable and modifiable as plain files.

Conclusion

Making disk the contract turns your app into a resilient, portable, and offline-friendly system. It shifts the complexity away from servers and locks, focusing instead on simple, robust file operations.

Think of your data as a living set of files—easy to inspect, edit, and sync. That’s the real power of Threlmark’s design. If you want your app to be flexible and future-proof, start treating your disk like your most trusted partner.

You May Also Like

What to Know Before Buying a Laser Line 3D Scanner

Navigating the key factors before purchasing a laser line 3D scanner can ensure you select the perfect tool for your project needs and goals.

Anthropic’s Series H: Powering AI Innovation Through Compute Investment

Discover why Anthropic’s $65B Series H isn’t just a valuation — it’s a massive compute and infrastructure strategy shaping the future of AI. Read more.

When a Desktop CAD Workstation Is Worth the Upgrade

Just when your CAD workstation can’t keep up, upgrading becomes essential—discover the key signs that it’s time to invest in better performance.

When a Mixed Reality Headset Is Worth the Upgrade

Guided by performance and comfort concerns, learn when upgrading your mixed reality headset can truly enhance your immersive experience.