OrderOps
A white-label B2B ordering platform that runs on top of legacy ERPs: two-way sync, offline mobile ordering and safe write-back, in production for two wholesale distributors.
- Role
- Creator: architecture, backend, sync worker, frontend and deployment
- Client
- Two wholesale distributors (cosmetics & household goods, FMCG)
The problem
Sales agents, the warehouse and finance were working from phone calls, spreadsheets and an ERP that only the office could use. The ERP itself had to stay: it is the source of truth for stock, prices, invoices and tax. One of the companies also ran a legacy POS system, and neither database was documented.
What I built
Reverse-engineered both schemas with discovery scripts and a confidence-rated mapping document, and analysed more than 500 vendor stored procedures before writing a single row.
Built a dedicated NestJS sync worker: one job per domain (18 domains) on a single FIFO queue, with a hang guard, backoff of 1, 2, 5, 10 and 15 minutes, and one alert per outage.
Made reads incremental: ID floors with an overlap margin, frozen baselines for closed fiscal years, and checksum-based change detection per day.
Made write-back safe to retry: a marker checked under row locks so an order can never be booked twice, and a serializable transaction with a table lock against the vendor's MAX+1 numbering race.
Shipped an offline-first PWA for sales agents: orders queue on the phone and sync idempotently when the connection returns; offline data packs are encrypted.
White-label deployment per company by tag: content-hash image builds, migrations, seed and health check in one guarded script, least-privilege database logins and private networking to the ERPs.
Architecture
Integrations
- Legacy MSSQL ERP: read 12 domains, write orders back
- Legacy POS system: write invoices, read them back
- Central-bank EUR exchange rates
- Web Push notifications
Outcomes
Stock sync: 0 differences across 65k rows; run time down from ~11 s to ~2 s
Invoice sync: ~163k upserts per run → 0 in steady state
~2.4M invoice lines and ~2.9M POS lines mirrored for reporting; 20+ legacy reports rebuilt as read-only SQL
20+ production releases across two companies
Tech stack
Next case study
Stoku