Flutter · Offline-first · Supabase

A store app that keeps selling when the signal drops

Inventory, sales and utang tracking for sari-sari stores. Everything works offline on the store phone and syncs when there’s signal, so the owner can check sales from anywhere. Two phones can sell at the same time and still agree on the numbers.

Three phones showing Tinda: checkout, a sync notice and the sales report
Role
Design, Flutter, backend
Platforms
Android (Flutter), web demo
Data
Drift (SQLite) + Supabase
Built
November 2026

The problem

The notebook works, until you want to know what you actually earned

Most sari-sari stores run on a notebook: one page for utang, scribbles for what to buy at the palengke, and a guess at the day’s profit. Apps exist, but they stop working when the signal drops, and in a lot of barangays it drops every day.

The goal: an app that’s as quick as the notebook, never needs signal to make a sale, and lets the owner see the numbers from another phone.

Ma, how much did we sell today? And did Kuya Ben pay?Mark, 6:12 PM
Wait, I’ll check the notebook. I think he paid ₱100 last week 🤔Aling Nena
Also the cola is gone, buy more later6:14 PM · no signal at the store again

A typical exchange, written for illustration

What I built

Fast at the counter, clear for the owner

Product grid for selling, in Filipino
Checkout with amount received and change
Barcode scanner

Counter · selling

A sale in a few taps

Tap products or scan their barcode, then type what the customer handed over. The change shows big, so there’s no mental math at a busy counter.

  • Cash, GCash or utang
  • Stock goes down as you sell, with a warning when an item runs low
  • Filipino or English, switchable any time
Utang list with balances per customer
A customer's utang history and payment

Utang · per customer

The notebook page, but it adds itself up

Credit sales go on the customer’s tab with what they bought. Payments come off it. Each suki has a running balance and a history you can show them when they ask.

Sales report with profit and best sellers
Restock list with suggested quantities

Owner · reports

What sold, what you earned, what to buy

Sales and profit for today or the week, compared with the same time before, plus best sellers. Items at or below their alert level go on a restock list with a suggested quantity and estimated cost, ready to copy into a message.

Web demo: two phones offline, each with changes waiting to sync

Two phones · no signal

Both keep working, then agree

The live demo runs two phones and a pretend cloud side by side. Cut the signal on either one, keep selling and editing, then bring it back and watch them sync. A guided version plays the tricky case for you.

Tech stack

FlutterDartDrift (SQLite)Supabase (Postgres, Auth, Realtime)PL/pgSQLmobile_scannerFlutter localizations (Filipino, English)React + TypeScript (web demo)Vitest

How sync works

Two phones edit the same store offline. Who wins?

Offline sync is easy until two phones change the same thing. I split the data in two, because sales and product edits need different rules.

Sales never conflict

Stock isn’t stored as a number. It’s the sum of stock moves: opening, restock, each sale. Two phones selling the last sardinas offline both keep their sale; stock goes to −1 and the app asks for a recount. Blocking a sale would be worse: the customer is standing there with cash.

Edits merge by field

Products sync field by field, each with a hybrid logical clock timestamp. If one phone renames an item while the other changes its price, both changes stay. If both change the price, the newest edit wins and the other phone gets a small “Changed on another phone” notice.

Nothing gets lost or doubled

Every change has an id, so a push retried after a dropped connection is ignored the second time. The server numbers accepted changes under a per-store lock, and phones pull “everything after N”, so a phone with a wrong clock can’t skip anything.

The same rules run in the Flutter app (Drift), in Postgres (push_changes and pull_changes) and in the web demo. The Postgres functions were tested on PostgreSQL 16 with the two-phone scenario, retries and paging, and the web version has unit tests for the same cases. For cheap phones, SQLite runs on a background isolate, lists build lazily, and reports draw plain bars instead of loading a chart library.

Walkthrough

Two phones lose signal and keep selling

Need an app that works without signal?

I build Flutter apps that keep working offline and sync when the signal comes back, for stores, field teams, deliveries and inventory.

Tindahan ni Aling Nena is a fictional store made for this demo. The web demo simulates the cloud in your browser; the Flutter app syncs through Supabase.