Examples
Learn by example
Each example pairs the React and Next.js code with a rendered sample of what it produces, plus the SQL and policies. They are illustrative snippets, not full repositories.
Todo app with RLS
A per-user todo list where Row Level Security keeps every user to their own rows.
Magic-link sign-in
Passwordless sign-in: email a link, exchange the code for a session, share it with the server.
Multi-tenant SaaS starter
Tenants, membership and switching, with a restrictive RLS guard on every tenant table.
File upload with Storage
Private per-user files: upload, list, sign a URL and delete, guarded by storage policies.
Realtime chat
Room messages pushed over Postgres changes, with presence and a typing broadcast.
E-commerce: exact stock on purchase
Buy several products in one transaction: the order, its items and the stock decrement commit together or not at all.
Meeting room booking
No double booking, enforced by an EXCLUDE constraint; booking, moving and cancelling are one transaction each.
Timed ticket hold
Reserve limited tickets for a few minutes; pay by webhook; unpaid holds go back on sale by themselves.
Live cursors and presence
See who is online, who is typing and where everyone points, with no table at all.