
Haazir Billing — GST Billing & Inventory Platform
Runs an Indian shop's billing, GST and stock across a desktop, a phone, a POS terminal and the web — from one shared codebase.
Multi-tenant GST billing, inventory, sales/purchase, returns and reporting for Indian businesses. One Fastify API serves a Flutter app family (Windows desktop, Android/iOS mobile, Android POS), a Next.js responsive web app and a super-admin panel — five surfaces from a single shared core.

- Industry
- Retail / SMB
- Role
- Architect & Full-Stack Engineer
- Team
- Solo — one author in the repository history
- Type
- SaaS Platform
- Year
- 2025 — present
01
Overview
Haazir Billing is a multi-tenant billing and inventory platform for Indian retail, grocery, medical, hardware and wholesale businesses. It covers GST invoicing, estimates, purchases and receive-stock, credit and debit notes, party ledgers and discounts, bank accounts and transactions, expenses, staff permissions and reporting.
The architecture is what makes five surfaces maintainable by one person. The three Flutter apps — Windows desktop, Android/iOS mobile and Android POS — are thin shells over a single shared core package that holds every model, service, provider, screen and the theme; each app's entry point is one line. A Next.js web app replicates the desktop experience for the browser, and a separate Next.js super-admin panel manages the platform. All of them speak to one Fastify API over JWT plus a shop-id header, so a feature lands once and appears everywhere.
Multi-tenancy is per-shop: every request is scoped by shop id, with admin and staff roles carrying per-feature permissions. Sessions and hot data sit in Redis; MySQL via Sequelize holds the domain. Login is OTP over WhatsApp, and the same WhatsApp integration delivers invoices, with Firebase handling push.
The Windows build is published on the Microsoft Store, and the desktop and POS surfaces keep working through connectivity gaps — which for a counter is the difference between trading and not.
02
Business challenge
The same billing product was needed on a shop desktop, a phone, a touch POS terminal and the web. Building four applications separately would have meant four codebases drifting apart, and a feature request landing four times — while the business still needed GST compliance, stock and party ledgers to agree across all of them.
What discovery showed
Separated what is genuinely platform-specific — window chrome, printer access, touch target sizing — from what is not, and found almost everything else (models, services, state, screens, theme) was identical across the three Flutter targets.
Before this system
03
Solution
Put every model, service, provider, screen and the theme into one shared Flutter core package and reduced each of the three apps to a one-line entry point. A Next.js web app replicates the desktop experience for the browser, and all surfaces — plus a super-admin panel — talk to one Fastify API scoped per shop.
What it does
04
My contribution
- Role
- Architect & Full-Stack Engineer
- Team
- Solo — one author in the repository history
- Scope of my work
- API, shared Flutter core, the three application shells, web application and super-admin panel
- Engagement
- Built at Mopa Global Services
05
Product screenshots
Screens from the application itself. Select any image to view it full size.
06
Architecture
Swipe sideways, or expand to zoom.
Three thin Flutter shells, one shared core, one tenant-scoped API
The desktop, phone and POS builds contain almost no code of their own — models, services, state, screens and theme all live in one shared package, so a screen is written once and ships to all three. The browser apps are separate Next.js projects against the same API. Every request carries a JWT and a shop id, so tenant scoping is enforced at the boundary rather than remembered query by query.
- Interface
- Service
- Data store
- External system
How it fits together
- 01Fastify 5 REST API at /api/v1 over MySQL (Sequelize) with Redis for sessions and cache
- 02JWT bearer auth plus an x-shop-id header — every request is tenant-scoped
- 03Three Flutter apps (Windows, Android/iOS, Android POS) as thin shells over one shared core package
- 04Next.js 16 responsive web app mirroring the desktop surface
- 05Separate Next.js super-admin panel for platform-level management
- 06WhatsApp Business API for OTP login and invoice delivery; Firebase FCM for push
- 07Consistent response envelope with top-level pagination on list endpoints
Data and API design
- 01REST API under /api/v1 with a consistent response envelope and top-level pagination on list endpoints.
- 02Every request carries a JWT and an x-shop-id header; the shop id scopes all data access.
- 03On the device, SQLite mirrors items, categories, contacts, sales and purchases, with a synced flag on each locally created row.
- 04Stock changes made offline are logged to a pending table and replayed in order.
07
Engineering challenges
01
One product, four places to run it
- The difficulty
- A shop bills on a desktop, a phone, a touch POS terminal and a browser. Built separately, every feature and every fix lands four times.
- Why it mattered
- The applications drift apart in the gaps, and a small team spends its time keeping them level instead of improving the product.
- Options weighed
- Four separately built applications
- One shared Flutter core with a thin shell per platform
- What was built
- Everything that is not genuinely platform-specific — models, services, state, screens and theme — lives in one core package. Each of the three Flutter applications is a one-line entry point over it; only window chrome, printer access and touch sizing differ.
- Why this approach
- Separating what is truly platform-specific showed that almost nothing was.
- Result
- A screen is written once and ships to desktop, mobile and POS together.
02
Billing has to keep working when the connection drops
- The difficulty
- A shop cannot stop serving customers because the internet is down — and a device that reports “connected” may still be unable to reach the server.
- Why it mattered
- A sale that cannot be recorded is either lost or written on paper and re-entered later.
- What was built
- Sales are written to local SQLite first, with a local id and an unsynced flag. A connectivity watcher checks both the network state and whether the API host is actually reachable. When it reports online — and every five minutes while anything is pending — a sync service posts sales, then purchases, then stock changes, stores the server ids that come back, and refreshes the catalogue.
- Why this approach
- Writing locally first makes the network an optimisation rather than a dependency, and syncing in a fixed order keeps stock consistent with the sales that changed it.
- Result
- The counter keeps trading through an outage and the server catches up on its own. Each record is sent independently, so one rejected row cannot block the rest.
03
An offline catalogue has to be the whole catalogue
- The difficulty
- Barcode search and the inventory list filter the local cache in memory. The API returns products a page at a time, so a single fetch leaves a large shop with only its first hundred items.
- Why it mattered
- A product missing from the cache cannot be scanned at the counter while offline.
- What was built
- The sync service fetches every page of the catalogue, saves it locally and records that the cache is complete before the offline paths rely on it.
- Why this approach
- The offline paths are only correct if they can trust the cache to be complete, so completeness is tracked explicitly.
- Result
- Shops with catalogues of well over a thousand products can scan and bill any item offline.
04
Tenant isolation that does not rely on memory
- The difficulty
- Every shop’s sales, stock and ledgers live in one database.
- Why it mattered
- Scoping spread across handlers is one forgotten filter away from one shop seeing another’s sales.
- Options weighed
- Each handler adds its own shop filter
- The shop id is a required part of the request contract
- What was built
- The shop id travels as a required header alongside the JWT, so scoping is applied at the boundary.
- Why this approach
- A rule enforced where requests enter cannot be forgotten in a new handler.
- Result
- New endpoints are tenant-scoped by default.
05
Signing in shopkeepers who do not use email
- The difficulty
- Many shopkeepers do not reliably have email, and password resets over SMS meant another vendor and another cost.
- Why it mattered
- An account a shopkeeper cannot get back into is a lost customer.
- Options weighed
- Email and password
- One-time passwords over SMS
- One-time passwords over WhatsApp
- What was built
- WhatsApp carries both one-time-password login and invoice delivery to customers.
- Why this approach
- It is the channel the users already live in, and one integration covers two needs.
- Result
- One fewer vendor, and fewer support requests about access.
08
Technology stack
- Frontend
- FlutterRiverpodNext.js 16React 19TypeScriptTailwind CSS 4TanStack Query
- Backend
- Fastify 5Node.jsSequelize
- Data
- MySQLRedis
- Infrastructure
- Docker
Why these choices
- Flutter + Riverpod
- One core package compiled for Windows, Android, iOS and POS terminals.
- SQLite
- Local storage that lets billing continue offline.
- Fastify 5
- The single REST API behind every surface.
- MySQL + Sequelize
- Server-side system of record for every shop.
- Redis
- Sessions and cache.
- Next.js 16
- Browser application and the super-admin panel.
- WhatsApp Business API
- Login codes and invoices on the channel shopkeepers already use.
09
Security & scale
Security
Scalability
10
Business impact
Every figure is labelled with where it comes from: a measurement, an estimate, a design target, or a fact of the system as built.
5
Surfaces from one codebase
Windows, Android and iOS, POS terminal, web and super-admin.
1
Shared core package
Models, services, state, screens and theme written once.
Offline
Billing through outages
Sales are stored locally and synchronised when the server is reachable.
Listed
Microsoft Store
The Windows build is published on the Microsoft Store.
What changed
- Adding a feature
- BeforeBuilt and fixed separately for each platform.
- AfterWritten once in the shared core, shipped to every Flutter target.
- Losing connectivity
- BeforeBilling stops, or moves to paper.
- AfterSales are recorded locally and synchronised afterwards.
- Stock and ledgers
- BeforeHad to be kept in agreement across separate apps.
- AfterOne API and one database behind every surface.
One codebase serves five surfaces, so a shop can bill on a desktop, a phone, a POS terminal or the browser and see the same stock and ledgers. The Windows build is on the Microsoft Store, and the counter keeps trading through connectivity gaps.
11
Project status
What I took from it
- A shared core with thin platform shells is what makes a four-surface product maintainable by a small team.
- Putting the tenant key in the request contract beats trusting every handler to scope its own queries.
- Choosing the channel users already use — WhatsApp — removed both a vendor and a support burden.
A billing platform that a small team can keep level across five surfaces because almost all of it is written once — and that a shop can rely on because the counter does not depend on the connection.
Next step
Need a similar solution for your business?
Tell me what you are trying to build or fix. I will come back with how I would approach it, what it realistically takes and where the risks are.


