Home/ Case Studies/ SaaS Inventory Management
SaaS · Inventory · Multi-Tenant

SaaS Inventory Management for Retail Chains — One Source of Truth Across 60+ Stores

A retail-chain operator wanted to productise their internal inventory tooling and resell it to peer chains. We rebuilt it as a multi-tenant SaaS platform — and shipped to 60+ retail stores across four customer chains in seven months.

60+Retail Stores Live
4Customer Chains
45%Stockout Reduction
99.95%Platform Uptime

Project at a glance

Industry
Retail · multi-store apparel + lifestyle
Scope
Multi-tenant SaaS web + Flutter scanner app + retailer admin
Team size
8 engineers + 1 PM + 1 SaaS-product manager
Timeline
5 months to v1 · 7 months to four-customer multi-tenancy
Regions
Pan-India · architecture sized for 500 stores
Status
Live · operating as ITD-managed SaaS for the founding chain

The client & the problem

The client had 22 stores running on a custom inventory app the founding team had built five years ago in PHP. It worked — barely — for them; it would never sell to anyone else. Two peer chains had asked to license it. The brief: turn the in-house tool into a multi-tenant SaaS that could run any retail chain, not just this one.

  • Hard-coded business logic: Pricing rules, GST handling, store-hierarchy, and category trees were all coded for one chain.
  • Single-tenant data model: No org_id on any table; every retrofit of multi-tenancy was risky.
  • Scanner workflow was deskbound: Stock take meant printing reports and walking the floor with paper.
  • Real-time sync was wishful thinking: Cross-store transfers reconciled overnight; weekend stockouts were routine.
  • Onboarding new chains was a 6-week dev project: Each new chain required code changes — that is not a SaaS.

The solution

We rebuilt the platform on a multi-tenant foundation: org_id everywhere, configurable hierarchies, plug-able pricing rules, and a Flutter scanner app for floor-staff. New chains onboard in 3-5 days now instead of 6 weeks.

1. Multi-tenant SaaS web (React)

Org-scoped login, store-hierarchy builder (org → region → cluster → store), category tree editor, master SKU catalog, GRN, transfer, sale, return, stock-take. Each chain sees only their data; the spine is shared.

2. Flutter scanner app

Barcode scan via phone camera (no dedicated hardware needed), GRN flow, transfer-in/out flow, stock-take floor mode, partial-quantity entry, offline-tolerant. Works on a Rs 9,000 phone.

3. Retailer admin (React)

Live store-level inventory, replenishment recommendations (we ship a baseline rule + each customer can override), GST report, sales report, ageing-stock dashboard, SLA dashboard for slow-mover liquidation.

4. Configurable pricing & rules engine

Pricing rules (MRP / sale / VIP / regional / store-override), GST mapping, discount stacking, expiry handling — all data, all editable in the UI. Chain B's '40% off Friday' rule is a config, not a code change.

5. Backend (Node.js + Postgres + Redis)

NestJS multi-tenant API with row-level org_id enforcement, Postgres with per-org connection pools, Redis pub/sub for real-time inventory updates across stores, BullMQ for async (e.g. nightly aging-stock recompute), AWS Mumbai.

Tech stack & why

We picked the stack for fit, performance under realistic load, and operational simplicity. Here is the breakdown:

NestJS TypeScript PostgreSQL Redis BullMQ React 18 Flutter 3.x AWS EC2 + RDS AWS S3 GitHub Actions Sentry Datadog Stripe (international) Razorpay (India)

NestJS multi-tenant guard at the API edge: every request resolves to an org from the JWT, every Postgres query is scoped to that org via a guard. We tested this with adversarial fuzz tests; in 4M synthetic cross-tenant requests, zero leaks.

Postgres row-level security plus app-level guards: belt-and-braces. RLS catches the 0.001% case where a developer forgets the WHERE org_id; the app guard catches the 99.999% normal flow with better performance.

Flutter scanner over native: any cheap Android phone is now a scanner. Customers don't have to buy Honeywells; staff use their own phones (with a small allowance). Onboarding hardware cost dropped from Rs 8,000/store to zero.

The hardest technical problem we solved

Real-time inventory sync at 60-store scale.

The customer's biggest pain was: store A has stock, store B has a customer asking for it, the system says no — sale lost. Real-time inventory across 60 stores sounds simple until you actually try.

We modeled inventory as a stream of immutable events (GRN, sale, transfer-in, transfer-out, adjustment). Aggregations are computed as projections; reads from cached aggregates with sub-second freshness. Writes go to Postgres; Redis pub/sub fans out to the affected stores' UIs.

Cross-store transfer time dropped from overnight to sub-minute. Stockout rate fell 45%. Saturday-evening rush — the toughest test — went from 'frequent system lag' to imperceptible.

Go-to-market & ramp

We dogfooded with the founding chain — all 22 stores live first. Three months of running both old and new in parallel before cut-over. Caught seven data-quality bugs in legacy data; would have been silent failures otherwise.

External customer #1 went live in week 24. The on-boarding playbook was: org-create, hierarchy-import, SKU-import, training, parallel-run for two weeks, cut-over. Week 28: customer #2. Week 31: customers #3 and #4 in parallel.

Results

60+Retail Stores Live
4Customer Chains On-boarded
45%Stockout Reduction
99.95%Platform Uptime
3-5 daysNew Chain Onboarding (was 6 weeks)
<1 minCross-Store Transfer Sync
Rs 8,000Hardware Cost Saved per Store
ZeroCross-Tenant Data Leaks (4M fuzz tests)

“We turned a five-year-old internal tool into a SaaS we can sell. The multi-tenant rebuild was the hard part — and ITD got the security layer right, which is what matters when you sell to other retailers.”

Founder & CEO

Retail Chain · Founding Customer

What we would do differently

Decide multi-tenant strategy before line one of code. We started with row-level org_id and pivoted to row-level + RLS in month four. Doable, but cost us 3 weeks of refactoring. Decide RLS-on or RLS-off in week one and stick to it.

Building a multi-tenant SaaS or productising internal tooling?

Going from internal tool to sellable SaaS is a different engineering problem than building either alone. Talk to a team that has shipped both.

Get a Free Consultation

Get Digital Growth Tips in Your Inbox

Weekly insights on app development, web design, SEO, and marketing. No spam — just actionable advice.

Join 2,500+ business owners. Unsubscribe anytime.