v1.0 · local-first sync engine · MIT

Edits drift apart.
State flows back together.

Coalesce is an open-source CRDT engine for apps that work offline, on every device, at once. Each replica keeps writing on its own. When they meet, they merge — automatically, deterministically, without a server deciding who wins.

Read the quickstartpnpm add @coalesce/core
6 replicas · 6 converged

How it merges

Three behaviours, one data structure.

01

Concurrent edits converge

Two people type into the same paragraph on different continents. Coalesce interleaves their operations and both screens settle on one text — no lock, no prompt, no “theirs or mine”.

02

Sync you can see

Peers trade changes in the background over any transport you hand it: WebSocket, WebRTC, a USB stick. The status hook tells your UI exactly how many ops are still in flight.

03

Offline is just a branch

A replica that loses signal keeps working on its own copy. When it reconnects, its history buds back into the main document instead of overwriting it.

Quickstart

A few lines from a JSON object to a shared one.

Wrap any plain object in a document, point it at a relay or a peer, and mutate it like you always have. Every change becomes an operation; every operation is safe to apply twice, out of order, a week late.

4.1 kB
core, min + gzip
MIT
licence, forever
212
contributors
0
servers required
// board.ts
import { doc } from '@coalesce/core'

const board = doc('kanban', {
  peers: 'wss://relay.example.dev',
  persist: 'indexeddb',
})

board.change((d) => {
  d.columns.todo.push({ title: 'Ship 1.0' })
})

board.status() // → { peers: 6, pending: 0 }

Bring your own app.
We'll keep it in one piece.

Coalesce is a fictional project, made to demo a gooey blob system. Built by its community, governed in the open.

← All skills