Skip to content
WASEEM AL-MATNI
All work

Case study · SaaS · Retail

Sulomx: a complete store system that runs on a phone

I designed, built, and launched Sulomx, a subscription SaaS that gives clothing shops a full point-of-sale, inventory, and customer-credit system as an installable app on Android, iPhone, and desktop. It keeps selling when the internet drops, adds products from photos with AI, and isolates every shop's data at the database level.

Role
Sole builder: product, data model, architecture, implementation, testing, deployment, and launch content
Stack
Next.js (App Router) · Tailwind CSS · PostgreSQL 17 with row-level security · Docker Compose · Caddy · Gemini API · Playwright
Infrastructure
Self-hosted on a Hetzner ARM server with a shared HTTPS proxy, per-container memory limits, and nightly off-site backups
Status
Live at app.sulomx.com with a public demo store; Free, Basic, and Pro subscription plans

Live demo store (opens in a new tab)sulomx.com (opens in a new tab)

Sulomx demo store dashboard on a phone: today's sales and profit in SYP and USD, stock value, and customer debts

The challenge

Clothing shops run on details generic software ignores: the same model in many sizes and colors, frequent exchanges, sales on credit, prices in two currencies, and staff who should sell without seeing cost or profit. Many also work with unstable internet during the day. Owners needed one system that handles all of it from the phone they already have.

The product

  • An installable progressive web app: added to the home screen on Android, iPhone, or desktop, it opens full-screen like a native app and works offline, with no app-store download and instant updates for every shop.
  • Sell in seconds: scan with the phone camera or a scanner; accept cash, mobile-wallet, or credit payments; and print the receipt or send it on WhatsApp. Stock updates instantly.
  • Size-and-color grids per model, with a barcode for every item.
  • Three ways to add products: from photos, with AI filling in names and categories; in photo batches; or by Excel import that recognizes Arabic or English column names.
  • Barcode labels on standard A4 sticker sheets or roll printers, with or without prices.
  • Customer credit and payments, returns and exchanges from the original invoice, cash-box closing, expenses, reports, and two-currency pricing.
  • An owner dashboard with today's sales and profit and the sizes running low, available from anywhere.

Multi-tenant architecture

Every shop is a tenant from day one, isolated by the database itself rather than by application code alone.

  • PostgreSQL 17 row-level security on every tenant table, keyed on the shop.
  • The app connects through a restricted role with no superuser or bypass rights, so every policy always applies.
  • Each request runs in a transaction scoped to the current shop; login and session lookups go through two tightly scoped database functions.
  • Role-based access enforced on the server: sellers never receive cost prices, and every write checks the owner role.
  • Versioned SQL migrations applied by script for a reproducible schema.

Offline-first selling

A shop cannot stop selling when the connection drops, so the phone keeps a local copy of products, prices, and stock, refreshed every 5 minutes while online.

  • With no connection, search and barcode scanning keep working; invoices are saved on the phone and can still be printed or sent on WhatsApp.
  • When the connection returns, queued invoices sync automatically and receive their official numbers.
  • Idempotent sync: an invoice sent twice over a weak connection is stored exactly once.
  • The app detects Wi-Fi with no real internet behind it and switches to offline mode on its own.
  • If two sellers sell the last piece at once, both sales are kept and the stock gap is flagged for the owner.
  • Safe logout: pending invoices are sent first, then shop data is cleared from a shared phone.

Infrastructure and operations

  • Docker Compose stack (Next.js and PostgreSQL) behind a shared Caddy proxy with automatic HTTPS, sized and memory-capped to share one server with another production site.
  • Nightly job: a database and uploads backup, an encrypted off-site copy, and a disk check, each result logged to an admin system page.
  • Restore drills: a script loads the latest backup into a throwaway container and verifies row counts.
  • Owner-controlled data: optional daily backup to the shop's own Google Drive and full Excel export at any time.
  • A public status page on independent hosting checks the app every 30 seconds and guides shops during any outage.

Quality assurance

  • Tenant isolation proven by an automated test that tries to read and write across shops on every table: 51 of 51 checks pass.
  • Playwright end-to-end tests against the deployed app: login, first-run setup, products, sales, and seller permissions.
  • Offline selling tested on a real phone: internet cut, sales completed, connection restored, and invoices synced automatically. The full test is recorded on video.
  • Duplicate-safe sync verified by sending the same invoice twice and confirming it is stored once.

Back to all work