[pdrmdrs.dev]← projects
$ git log --oneline ~/projects/grocer

shared grocery list

wip

A real-time grocery list with live updates and push notifications — built to sync with my partner, and to learn realtime sync end to end. This is the log: every day I touched it, what I shipped, and why.

Next.jsTypeScriptPostgresWebSockets
4
days logged
10
entries
Day 05
latest
wip
status
decisionlogdraftdiagramscreenshotlink
sort
Day 01·12 Maykickoff
context
Two users, one list, edits need to appear on the other phone within a second.
options
Firebase RTDB · Supabase realtime · Postgres + custom WS
decision
Own the Postgres schema and push diffs over a small WebSocket service.
why
I want to actually learn conflict handling and connection lifecycle, not rent it. Vendor lock-in on the data model scared me more than the extra work.

lists (id, name, owner_id, created_at) — a list is the shared unit.

items (id, list_id, text, checked, position, updated_at, updated_by) — position is a float so reordering doesn't renumber everything.

memberships (list_id, user_id, role) — later, for sharing beyond just us two.

open q: soft-delete items or hard-delete? leaning soft, so 'undo' is trivial and sync stays append-ish.

repogithub.com/pdrmdrs/grocercommitchore: scaffold monorepo
Day 02·14 Maythe hard part first
diagram — client → WS gateway → Postgres LISTEN/NOTIFY → fan-out
shots/sync-flow.svg

Wired Postgres LISTEN/NOTIFY into the WS gateway. When an item mutates, the DB notifies, the gateway fans the change out to every socket subscribed to that list. No optimistic UI yet — the client just waits for the echo.

Latency is ~300ms on my network, which feels laggy when you tap a checkbox. Noted for later — this is the thing that'll make or break whether it feels "real time" or just "eventually".

read the full write-up · notify-based fan-out
Day 03·17 Maymake it feel instant
problem
Waiting for the server round-trip made every tap feel broken.
decision
Apply the mutation to local state immediately; when the server echo arrives, reconcile by updated_at.
risk
Two people toggle the same item at once — last-write-wins by timestamp. Acceptable for a two-person list; noted as a real problem if this ever grows.
screenshot — grocery list, checked + unchecked items
shots/day03-list-ui.png
Day 05·24 Mayshipped a preview

Web Push via service worker. The gateway already knew who was subscribed to a list, so it was mostly a matter of storing push subscriptions and firing on mutations from a different user.

Debounced to one notification per list per 60s so a big shop doesn't buzz your phone twenty times.

read the full write-up · web-push without a vendor
screenshot — live preview on mobile
shots/day05-mobile.png
livegrocer.pdrmdrs.devrepogithub.com/pdrmdrs/grocer
$ HEAD — more to come as I build in the open
LOG~/projects/grocerday 01wip10 entries