Back to projects

SaaS ยท Point of sale

Ruang POS

Based in Indonesia

ruangpos.id
  • 30+businesses served

Overview

Offline-first point of sale for cafes, restaurants and shops. Sales keep working without internet, with recipes and cost of goods, stock ledger, purchasing, accounting and an online shop. One codebase serves many businesses, each isolated by Row Level Security. I also run its infrastructure: an Ubuntu VPS with PostgreSQL, Caddy for HTTPS, systemd, a firewall and scheduled encrypted backups to Cloudflare R2, with the web app on Vercel.

The problem

Ruang POS, formerly NuhaPOS, is a point of sale and back-office system for cafes, restaurants and shops, sold as a SaaS. Cashiers, outlet managers and owners use it, and a separate admin app runs the platform.

Small food and retail businesses often keep sales in a book, stock in a spreadsheet and orders in chat, so profit per item is only known after the fact. A cashier also cannot stop selling when the internet drops. The first NuhaPOS stored stock in a column and recomputed it through many views, so screens could disagree.

My part

I co-founded the product in 2018 and, with one other engineer, handle all of its technical work. The current version is a rebuild: I analysed the old system, kept its features and business rules, and replaced the data layer.

What I built

Offline cashier
Each sale is written to a local outbox before the payment request and retried with the same ID. A service worker reloads the app offline, and sales sync when the device is back online.
Catalog, recipes and stock
Units with conversions, modifiers, bundles and CSV import. Stock is a signed movement ledger with receive, adjustment, waste and stock-opname documents, a stock card and a period report.
Purchasing and payables
Supplier orders received in parts, goods receipts at invoice cost, purchase returns, supplier payments and payables aging.
Finance and accounting
A cash book, expenses, profit and loss, cash flow, a chart of accounts, double-entry journals derived from the transactions, trial balance, balance sheet and bank reconciliation.
Online shop, QRIS and receipts
A public online shop per business, dynamic QRIS with verified webhooks, and receipt and kitchen-ticket printing from the browser.
Platform layer
Client management, subscription plans with modules and limits, automatic invoicing, self-signup with a trial, and a time-limited, logged sign-in-as-client for support.

Decisions that shaped it

Rebuild on PostgreSQL instead of porting the code
The old data was split across tables per movement type and held stock in two places. The rebuild keeps the feature list and rules and uses one stock ledger and one unit model.
Offline sales as idempotent records
The sale ID comes from the cashier device and is the idempotency key, so a retry never moves stock twice. If prices changed or the shift closed while offline, the server rejects the sale with a clear conflict instead of changing the amount.
Multi-tenancy with Row Level Security
One codebase and one database serve many businesses. Every business table carries a client ID with RLS and the API runs as a non-owner role, so a missed filter in application code cannot leak another business's rows.
Ledgers guarded in the database
Stock balances update in the same transaction as the movement, locked in a fixed order to avoid deadlocks. Cash-book rows come from database triggers, and journals are derived from source documents so they cannot drift.
Cost snapshot per sale line
Each line stores the price and cost of goods at the moment of sale, so old reports keep their numbers after a recipe changes. Negative stock is allowed so an offline sale that happened is still recorded.

Where it stands

  • Covers the full path from cashier to accounting: sales, stock, purchasing, finance, online shop and platform admin.
  • Tested against a real PostgreSQL, including tenant isolation and exactly-once offline sync.
  • A migration script moves a business from the first NuhaPOS into the new system.
  • Shared receipt and tax math is one package used by both the cashier and the server.

Core features

  • Offline-first sales
  • Recipes and cost of goods
  • Stock ledger
  • Purchasing
  • Accounting
  • Online shop

Tech stack

  • NestJS
  • Nuxt 3
  • PostgreSQL
  • Drizzle
  • Capacitor Android
  • Cloudflare R2
  • Playwright
  • VPS
  • Caddy

Related clients