RYX
RYX Tech
Back to all articles
Case Study

How We Built Valoryx: An Offline-First GST Billing App

How we built desktop billing software that keeps working without internet, and what it takes to sync it back without conflicts.

RYX Tech2025-01-206 min read

Short answer

Valoryx is built offline-first because retail billing cannot pause for a network. Bills are written to a local SQLite database inside an Electron desktop app and confirmed to the user immediately, then a background sync pushes them to PostgreSQL when connectivity returns. Conflicts are avoided by making the local device authoritative for its own bills and never editing the same record from two places.

The Problem

A trading business in Coimbatore came to us with a simple ask: they needed GST-compliant billing software that worked during power cuts and connectivity outages — which happen daily in their warehouse.

Every SaaS billing tool they tried either required constant internet or lost data when it dropped. Excel was becoming unmanageable.

The Architecture Decision: Offline-First

We built Valoryx as a desktop application using Electron, with SQLite as the local database. Here's why:

  • SQLite: zero-config, embedded, file-based. No database server to manage. Works completely offline.
  • Electron: ship a full Node.js + Chromium app as a native .exe / .dmg. Users install it like any desktop app.
  • Supabase: when internet is available, changes sync to the cloud. Postgres on the backend, real-time subscriptions for multi-device access.

The Sync Strategy

The trickiest part: what happens when two users edit the same record offline?

We used a last-write-wins strategy with timestamps, plus a conflict queue that shows the user when a merge conflict needs manual resolution. Simple, transparent, reliable.

Tech Stack

  • Frontend: React + TypeScript (inside Electron)
  • Local DB: SQLite via better-sqlite3
  • Cloud sync: Supabase (Postgres + Realtime)
  • Auth: Supabase Auth (email/password per business)
  • Build: Electron Forge for packaging

The Result

Valoryx now handles GST invoice generation, inventory management, customer ledgers, GSTR-1 export, and multi-device sync. The client went from 2 hours of daily manual billing to 20 minutes.

See Valoryx in our portfolio or contact us if you need something similar. Related reading:

Frequently asked questions

What does offline-first mean in software architecture?
The local device is the primary store rather than a cache. The application reads and writes locally and treats the network as an optional background process. The user never waits for a server, and losing connectivity changes nothing about what the app can do.
How does Valoryx sync data without conflicts?
Each device owns the bills it creates, so two devices never edit the same record. Bills queue locally with a device identifier and sequence number, then upload when a connection appears. Because records are append-only rather than mutable, there is nothing to merge.
Why use Electron instead of a web app for billing software?
Thermal printer access and guaranteed local storage. Browsers restrict direct printer control and can clear local storage without warning. An Electron desktop app talks to the printer directly and owns its database file, which is what counter billing needs.
Can offline-first architecture work for other kinds of business software?
Yes, wherever work continues when the network does not — field service, warehouse scanning, attendance, delivery. It fits poorly where multiple users must edit the same record simultaneously, since that reintroduces the conflict problem append-only billing avoids.

Work with RYX

Need help building this for your business?

We build custom software, web apps, and billing systems for Indian businesses. Direct developer access.

Talk to us →