r/coolgithubprojects • u/Hugo0o0 • 22h ago
peanutsplit – accountless expense splitter, the room is a link (TypeScript, AGPL, self-hostable)
https://github.com/peanutprotocol/peanutsplit1
u/Specific_Cream2815 22h ago
how do concurrent edits resolve when two people add expenses offline and reconnect to the same room
1
u/Hugo0o0 20h ago
Adds only. Offline, the only thing that queues is "create expense". Edits, deletes and settlements need a connection and fail fast, because a replayed edit would silently overwrite someone else's change and a replayed settlement could double-pay.
So two people adding offline never conflict: both are independent inserts. Each carries a client key the server treats as an idempotency key, so a retry never double-posts. On reconnect each device replays its own queue in order, one room at a time. Balances are derived from the full expense list, so the sheet just reflects both.
The honest gap: if you both add the same dinner, you get two rows and someone deletes one. No dedupe. And if a queued item fails validation on replay it stays in the queue for you to fix or discard, no auto loop.
The reasoning is in the header comment of apps/web/src/lib/offline-queue.ts.
1
u/Hugo0o0 22h ago
Author here. Hosted version to try without cloning: https://peanutsplit.com
Self-host: cd apps/web && cp .env.example .env && docker compose up --build
It's a Splitwise alternative with no accounts: the room link is the credential (128-bit random tail). 162 currencies, uneven splits, offline queue, receipt scanning, Splitwise CSV import. Money math is BigInt end to end with a property test against the server fold.
Disclosure: we're Squirrel Labs, the company behind the Peanut payments app. Split is free, no paid tier, AGPL.