RetailSync — Distributed Commerce Platform
Node.js · ODOO · React Native · Next.js · MongoDB · Production
Four applications needed the same Odoo data. Four sync layers meant four systems that drift apart.
A multi-branch retail operation needs its ERP truth accessible through a web storefront, a customer mobile app, an admin dashboard, and a delivery tracking system. Building separate business logic for each creates maintenance debt that compounds on every schema change.
THE STANDARD APPROACH FAILS BECAUSE:
Odoo's relational model is the authoritative source but not architected for high-read consumer-facing applications. The architecture required separating read from write — without ever letting them diverge.
"Dual-layer: Odoo as the write source of truth, MongoDB as the read layer. One source. Zero drift."
— KEY ARCHITECTURAL DECISION
TECHNICAL DECISIONS // 4 MADE
Source-of-truth separation: writes always go through Odoo, reads serve from MongoDB
Odoo XML-RPC wrapped in a clean abstraction layer
150+ endpoints versioned and organized by domain
Event-driven stock sync — Odoo webhook triggers MongoDB update, not polling

React + Vite — full catalog and order management
Customer Mobile App
EXPO REACT NATIVE- Email/phone auth with secure JWT storage and 401 auto-retry
- Bilingual EN/AR with full RTL layout adaptation
- Dynamic banner carousel, promotions, category browsing
- Cart with 15% VAT calculation, address book, checkout flow
- Loyalty points dashboard — balance and validation via Odoo
- Order tracking with push notification support
Delivery Mobile App
REACT NATIVE- Shift management — clock in/out with break tracking
- Order acceptance with conflict handling
- Per-item collection checklist with DB sync
- 5-digit PIN delivery verification
- Today's earnings, weekly/monthly aggregated history
- Live driver location update to backend
Admin Web App
REACT + VITE- Full catalog CRUD — products, categories, attributes, units
- Promotions engine — fixed price, combo deals, bulk deals, coupons
- Cloudinary integration — image upload, crop, compress
- PDF invoice generation and print dispatch
- Sales analytics, inventory reports, delivery performance dashboards
- PWA support with service worker and pre-cache
Backend Integration
NODE.JS + ODOO- 150+ REST API endpoints organized by domain
- Dual-layer architecture: Odoo (write) + MongoDB (read)
- Real-time stock sync — Odoo webhook triggers MongoDB update
- Full order lifecycle: customer order → Odoo SO → invoice → stock move
- XML-RPC Odoo client wrapped in clean abstraction layer
- Axios interceptors with Bearer token and 401 refresh flow