Walkthroughs
Full-stack sync
HTTP and Postgres reference backends with pull/push contract.
Melon-db sync follows a Watermelon-compatible pull/push protocol. See Sync backend for request/response shapes.
HTTP (in-process)
bun run demo:sync:httpUses @melon-db/sync-server HTTP helpers and playground-node client code.
Standalone sync server
bun run sync-serverPoint your app’s pullChanges / pushChanges at the server URL (see playground-rn sync client).
Postgres reference
bun run postgres:up
bun run sync-server:postgres
# separate terminal:
bun run demo:sync:postgresPostgresSyncStore in @melon-db/sync-server implements the same contract against Postgres.
Verify
- Pull returns
changesgrouped by collection and a newtimestamp. - Push applies local outbox entries and clears after acknowledgement.
- Sync playground demonstrates client-side flow in the browser.
Future sliding-window retention (prd-4) layers on top of this sync stack — see PRD compliance.
