Offline-first field sales app on Expo and Supabase: lessons from a year in production
The author built and has run a field sales system for a distributor, used daily since November 2025 by reps on mid-range Android phones. The app is an Expo (React Native) frontend on a Supabase backend, with 64 tables, 132 database functions, and 163 row-level security policies in one codebase shipping to iPhone, Android, and a browser console. Because reps often lose signal in basements, rural roads, and warehouses, every write goes through a local queue that replays when connectivity returns, using client-generated UUID keys so replays cannot create duplicate records. Access control for eight user roles is enforced in Postgres via RLS policies rather than only in the UI, since direct API calls could otherwise bypass it. The author also highlights a common date bug where UTC timestamps can assign the wrong calendar day to visits recorded in timezones ahead of UTC.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in