Prototypes
Ledger
P12 · CRM on the device
Anna’s laptop
Ben’s laptop
Side by side
The server
How it is built
Ledger
?
Search
⌘
K
Records
Contacts
Deals
This device
Load 10,000 contacts
The server
Contacts
Deals
Saved
New
Name
Company
Stage
Owner
Email
Deal
Stage
Amount
Owner
Close date
Stage
Owner
Delete
?
Device
Search
⌘
K
Open, change and create contacts and deals
Search, filter and sort every record on this device
Changes from the team arrive when the network is back
All
Contacts
Deals
Actions
↑
↓
Move
↵
Open
Tab
Scope
Esc
Close
Keyboard shortcuts
How Ledger is built
Each contact and each deal is a Yjs document on the device, stored in IndexedDB. The page is cached by a service worker, so it opens with no network.
A change is written on the device first. The records with changes wait in a list, and each is sent as the difference from what the server has acknowledged.
The server keeps every update and answers with the updates from other devices since the device’s last sync. Over the WebSocket the server sends a message when there is something new, with the record each device has open.
Text merges letter by letter. Tags, people and tasks are sets and lists that keep what both sides added. A stage, an owner, an amount or a date chosen differently on two devices keeps both values, and each device shows the conflict until a person keeps one.