Multi-tenant retail SaaS
RetailFlow
Retail software for shops that trade on khata.
- Role
- Solo · design, build and ship
- Focus
- Web · Product
- 231
- tests
- 35
- tables
- 92
- migrations
- 22
- permissions
Overview
A multi-tenant POS, inventory and credit-ledger platform for South Asian shops — barcode billing, weighted-average costing, khata credit ledgers and shift reconciliation, on a Postgres schema where every tenant is isolated by Row Level Security and every rupee is an integer.
What it does
- Barcode billing with mixed payment on one bill — cash, khata and JazzCash/Easypaisa
- Shifts with declared float and expected-vs-actual variance, reconciled to the paisa
- Multi-unit inventory (carton → packet → piece) with Urdu product names
- Partial goods receipt and a weighted-average costing engine with historical cost snapshots
- Khata ledgers with DB-enforced credit limits and aging buckets
- Owner / manager / cashier roles over 22 permissions, with PIN counter hand-off
Engineering decisions
01
Money is never a float
Every amount is stored as an integer and the cash drawer reconciles to the paisa before anyone goes home.
02
One RPC, one transaction
A sale lands completely — stock, money, ledger, invoice number — or not at all. The drawer and the shelf can never disagree.
03
Tenants isolated by the database
SELECT-only RLS for clients and no client write policy on any financial table; writes go through permission-checked RPCs.
Stack
- App
- Next.js 15React 19 Server ComponentsTypeScript (strict)Tailwind
- Data
- Supabase PostgresRow Level Security41 RPCs
- Ops
- 56 API routesResendWhatsApp Cloud API