TL;DR

Threlmark’s local-first architecture treats disk storage as the central source of truth, enabling offline use, easy sync, and interoperability. This approach simplifies data safety and fosters seamless multi-device workflows.

Imagine working on your project board without needing an internet connection, knowing your data is safe and instantly accessible. That’s the power of Threlmark’s approach — it puts the disk at the heart of everything, similar to how Disk Is the Contract: Inside Threlmark’s Local-First Architecture emphasizes the importance of local storage as the central source of truth.

This isn’t just about saving files; it’s about building a system where your device’s local storage becomes the ultimate source of truth. No cloud, no central server, just simple, reliable, and portable data. It’s a shift that redefines how we think about project management, AI, and collaboration in today’s offline and multi-device world, as discussed in this article on 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
Information Technology Project Management (MindTap Course List)

Information Technology Project Management (MindTap Course List)

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
Blink USB Flash Drive for local video storage with Blink Sync Module 2

Works with Blink Sync Module 2 to enable local video storage for up to 10 Blink devices.

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
Sipeed NanoKVM-USB 4K HDMI KVM Over IP Adapter, Professional Server Operations & Maintenance Tool, 1080P 60fps Video Capture Card for Remote Management & Multi-Device Collaboration (KVM Full Kit2)

Sipeed NanoKVM-USB 4K HDMI KVM Over IP Adapter, Professional Server Operations & Maintenance Tool, 1080P 60fps Video Capture Card for Remote Management & Multi-Device Collaboration (KVM Full Kit2)

[PORTABLE O&M REMOTE ACCESS] This NanoKVM-USB is a premier O&M tool designed for seamless multi-device collaboration. It eliminates…

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 disk as the single source of truth by organizing data into individual, inspectable JSON files.
  • Atomic writes and tolerant merge strategies make file-based systems safe and adaptable for future changes.
  • Using one file per item reduces race conditions, improves concurrency, and allows self-healing of data structures.
  • Offline work and multi-device sync are natural benefits of a local-first architecture that always reads from local disk.
  • Open, plain-text data fosters interoperability and user control, avoiding vendor lock-in.

Why the disk is the ultimate contract for your data

In Threlmark’s world, the disk isn’t just storage — it’s the contract. Every file, every folder, is a piece of the truth. When you open your project, you’re reading the same files that any external tool can write to.

For example, a project’s roadmap lives in items/. Each card is a simple JSON file, not a complex database. This makes the data transparent, portable, and safe from lock-in. If your system crashes or you switch devices, your data stays intact because it’s always stored on disk, ready to be read or updated without fuss, as explained in this detailed overview of local-first architecture.

Why the disk is the ultimate contract for your data
Why the disk is the ultimate contract for your data

How Threlmark’s file layout turns the disk into a living contract

Threlmark’s architecture is a carefully designed folder structure, where each piece of data lives in its own file. The root folder contains a manifest (threlmark.json) and a dependency graph (links.json).

Each project has its own folder with JSON files for metadata, lane order, and WIP limits. The key part: each roadmap card gets a dedicated file in items/. External suggestions go into suggestions/, and recorded handoffs sit in handoffs/.

This design ensures every artifact is inspectable, portable, and compatible with any tool that reads files — making the disk the undeniable source of truth, similar to concepts discussed in this article on local-first systems.

Making file-based state safe and reliable

Using files as a database sounds risky — but Threlmark uses two proven patterns to keep data safe. First, **atomic writes**. Every update writes to a temp file, then atomically renames it over the original. This way, crashes never corrupt data.

Second, **read-merge-write**. When updating, the system reads the current file, spreads in the changes, preserves essential fields like id and createdAt, bumps updatedAt, and writes back atomically. This approach ensures compatibility across different tools and future updates.

Making file-based state safe and reliable
Making file-based state safe and reliable

One file per item: the secret to concurrency and healing

Instead of a big roadmap.json list, Threlmark uses one file per item. This means each card can be updated independently, avoiding race conditions. When multiple tools or devices change data, they don’t step on each other.

Plus, the system automatically reconciles the lane order on read. If a card disappears or is moved, the board heals itself. This self-healing behavior keeps your view consistent without manual intervention.

How Threlmark’s architecture supports offline work and multi-device sync

Because all data lives on disk, you can work offline without a hitch. When your device reconnects, Threlmark syncs changes across devices by merging committed updates. This background process is lightweight and reliable.

Imagine editing a card on your laptop while offline, then seeing it updated on your tablet hours later. The system handles conflicts gracefully, using change graphs and deterministic resolution to keep everything in sync.

How Threlmark’s architecture supports offline work and multi-device sync
How Threlmark’s architecture supports offline work and multi-device sync

Interoperability and open data: why it matters

Threlmark’s file-based approach isn’t locked behind a proprietary database. Any tool or script can read or write data directly. Want to build your own plugin or integrate with another app? Just read the JSON files.

This openness makes your data truly portable — no vendor lock-in, no obscure formats. Plus, you can back up or migrate your data with common file operations, as highlighted in this piece on data portability.

Real-world example: managing a complex multi-project setup

Imagine juggling three projects: a website redesign, a marketing campaign, and a product launch. Each has its own folder, with individual cards for tasks, ideas, and bugs. When a developer updates a bug card on their laptop, the change immediately becomes part of the shared data, illustrating the benefits of local-first architecture.

Later, when they check their tablet, the latest updates are there — no manual sync needed. This seamless flow is possible because of the file-per-card structure and the local-first philosophy.

Real-world example: managing a complex multi-project setup
Real-world example: managing a complex multi-project setup

What developers gain by treating the disk as the source of truth

Developers love simplicity. Threlmark’s approach reduces complexity by removing the need for a database. It’s just files, atomic operations, and a clear contract.

This means easier backups, straightforward debugging, and fewer hidden failure modes. Plus, it’s easier to extend or adapt as needs evolve.

Practical tips for building your own local-first app

  1. Use atomic file operations for all writes.
  2. Design your data model as independent files.
  3. Implement read-merge-write updates with tolerant normalization.
  4. Build a self-healing reading process that reconiles inconsistencies.
  5. Ensure your app can work offline and sync changes in the background.

Frequently Asked Questions

What does ‘local-first’ mean in plain English?

Local-first means your data is stored primarily on your device, not in the cloud. The app works offline, and cloud sync is a background process that keeps multiple devices in step.

How does sync work when devices reconnect?

When devices come back online, Threlmark merges changes by tracking a graph of updates, resolving conflicts deterministically. It’s like piecing together a puzzle from different angles without losing data.

What happens if two people edit the same card at once?

Threlmark’s system uses change graphs and rules to reconcile conflicts automatically. The latest changes are merged, preserving both edits where possible, and alerting you if manual resolution is needed.

Can local-first architecture power complex products, not just notes or Kanban boards?

Yes. By designing data as independent files and supporting background sync, local-first can scale to complex apps like CRMs, project management tools, and collaborative platforms.

How do you ensure data security if everything is stored locally?

You can encrypt your files and control who has access. Local storage reduces attack surfaces, and with proper encryption, your data stays private even if devices are lost or stolen.

Conclusion

Threlmark’s approach shows that the simplest solution — the disk as the contract — can be incredibly powerful. It offers resilience, flexibility, and a seamless experience for multi-device workflows.

Next time you build or choose a project tool, ask yourself: are you making the disk the contract? If not, consider how this approach could simplify and strengthen your work.

Practical tips for building your own local-first app
Practical tips for building your own local-first app
You May Also Like

Wiring for Industrial Sensors and Actuators

Wiring for industrial sensors and actuators is critical for reliable operation, and understanding key best practices can prevent costly mistakes—discover how to get it right.

Building Automation System Cabling

Learn why proper building automation system cabling is crucial for reliability and scalability, and discover the key practices to ensure long-term success.

Supporting VR and AR Applications

Understanding how supporting hardware and software integrate is essential to creating immersive VR and AR experiences that truly engage users.

Networking for Smart Agriculture

Laying the foundation for smart agriculture relies on robust networking solutions that ensure seamless data exchange and enhanced farm productivity.