Skip to content

dhruv-techdev/sync-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”„ SyncFlow

Shopify Multi-Store Inventory Synchronization SaaS

Sync inventory across every store, location, and warehouse β€” in real time, without overselling.


Version Status License

React Router Shopify Prisma BullMQ TypeScript Node


Getting Started Β· Features Β· Architecture Β· Roadmap


SyncFlow is a Shopify embedded SaaS application that synchronizes inventory across multiple Shopify stores, retail locations, warehouses, and future marketplace integrations. It is designed to prevent overselling, inventory mismatches, delayed stock updates, and the manual operational overhead faced by merchants running complex commerce operations.

πŸ“¦ ApplicationSyncFlow 🧩 TypeShopify embedded app (SaaS)
πŸ‘€ AuthorDhruv Patel 🏷️ Version1.0
πŸ“… DateJune 2026 πŸ“ StatusFinal Draft

🎯 Product Vision

The long-term vision of SyncFlow is to become a centralized inventory synchronization and intelligence platform for Shopify merchants. The product starts with reliable multi-store synchronization and expands toward marketplace integrations, ERP connections, warehouse systems, analytics, and AI-powered recommendations.

  • Position SyncFlow as a reliable, observable, and scalable alternative to slow or unclear inventory sync tools.
  • Support Shopify merchants managing multiple storefronts, locations, warehouses, or agencies.
  • Build a SaaS platform with subscription billing, usage controls, monitoring, and plan-based feature gating.
  • Create a technical foundation suitable for future Amazon, Walmart, TikTok Shop, ERP, and warehouse integrations.

❗ The Problem

  • Merchants oversell products when stock changes aren't propagated fast enough.
  • Inventory levels become inconsistent across multiple stores and locations.
  • Manual inventory management creates operational delays and human error.
  • Existing tools often lack observability, retry handling, webhook transparency, or scalable architecture.
  • Shopify Plus and DTC brands need reliable synchronization across high-volume stores.

✨ Features

βœ… In Scope

  • Multi-store Shopify connection management.
  • Store grouping and store-level sync permissions.
  • SKU, variant, inventory item, and location-aware inventory mapping.
  • Manual inventory synchronization from the merchant dashboard.
  • Scheduled inventory synchronization as a fallback mechanism.
  • Webhook-triggered synchronization for orders, inventory updates, product updates, refunds, and restocks.
  • Redis-backed queue processing with retries and dead-letter queues.
  • Shopify Admin GraphQL API integration for products, variants, inventory items, locations, and inventory levels.
  • Sync logs, discrepancy reporting, latency metrics, and failure monitoring.
  • Shopify subscription billing with Starter, Growth, and Scale tiers.
  • Plan-based store limits and sync volume limits.
  • Tenant isolation, audit logging, secure token handling, and webhook HMAC verification.
  • AI insight foundation for imbalance detection, smart recommendations, and basic demand forecasting.
  • Production readiness including CI/CD, monitoring, health checks, rollback checklist, and release notes.

🚫 Out of Scope (MVP)

  • Direct Amazon, Walmart, TikTok Shop, or eBay marketplace integrations.
  • Full ERP integration (NetSuite, SAP, Microsoft Dynamics).
  • Advanced warehouse management system replacement features.
  • Full AI demand forecasting model with guaranteed prediction accuracy.
  • Multi-currency billing outside the Shopify billing flow.
  • Custom enterprise SLA dashboard before v1.0.0.
  • Native mobile application.

πŸ—οΈ Architecture & Tech Stack

Layer Technology
Framework React Router 7 (embedded Shopify app)
Shopify @shopify/shopify-app-react-router, App Bridge, Polaris
API integration Shopify Admin GraphQL API
Database PostgreSQL via Prisma
Queue / Workers BullMQ + Redis (ioredis)
Logging pino
Runtime Node.js `>=20.19 <22

πŸ“ Project Layout

sync-flow/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ db/          # Prisma client (db.server)
β”‚   β”‚   β”œβ”€β”€ logger/      # pino logger
β”‚   β”‚   β”œβ”€β”€ queue/       # BullMQ config, producer, queues, health
β”‚   β”‚   β”œβ”€β”€ redis/       # Redis connection
β”‚   β”‚   └── types/       # Shared sync types
β”‚   β”œβ”€β”€ routes/          # React Router routes + webhooks + health API
β”‚   β”œβ”€β”€ shopify.server.ts
β”‚   └── root.tsx
β”œβ”€β”€ workers/
β”‚   └── sync.worker.ts   # Background sync worker (BullMQ consumer)
β”œβ”€β”€ prisma/
β”‚   └── schema.prisma    # PostgreSQL schema
└── extensions/          # Shopify app extensions

πŸš€ Getting Started

Prerequisites

  • Shopify CLI
  • Node.js (see engines in package.json)
  • A running PostgreSQL instance (DATABASE_URL, DIRECT_URL)
  • A running Redis instance (for the sync queue and workers)
  • pnpm (this repo uses a pnpm-lock.yaml)

Setup

pnpm install
pnpm run setup        # prisma generate && prisma migrate deploy

Local Development

Run the embedded app and the sync worker in separate terminals:

pnpm run dev          # Shopify app dev (embedded app)
pnpm run worker:dev   # BullMQ sync worker (watch mode)

Press P to open the app URL. After installing the app, you can start development.

Useful Scripts

Script Description
pnpm run dev Run the embedded app via Shopify CLI
pnpm run worker Run the BullMQ sync worker
pnpm run worker:dev Run the sync worker in watch mode
pnpm run build Build the app for production
pnpm run start Serve the production build
pnpm run setup Generate Prisma client and apply migrations
pnpm run typecheck Type generation + tsc --noEmit
pnpm run lint Run ESLint
pnpm run queue:health Check queue health (/api/health/queue)

πŸ—ΊοΈ Delivery Roadmap

SyncFlow is delivered in sprint-based releases.

Release Sprint(s) Scope
v0.1.0 Foundation 1 Prisma schema, Redis queues, tenant-aware services, logging foundation
v0.2.0 Store Connectivity 2 Connect/manage multiple stores, dashboard, groups, permissions
v0.3.0 Inventory Mapping 3 SKU/variant/product/location mapping and validation
v0.4.0 Sync Engine 4–6 Manual, scheduled & webhook-triggered sync, retries, DLQ, rate limits
v0.5.0 Analytics 7 Activity dashboard, discrepancy reports, latency & failure tracking
v0.6.0 Billing 8 Shopify billing, plan limits, usage controls
v0.7.0 AI Insights 9 Imbalance detection, recommendations, forecasting foundation
v1.0.0 Production 10 CI/CD, observability, security review, production readiness

πŸ‘₯ User Roles

Role Responsibilities Permissions
Merchant Admin App setup, store connections, billing, sync rules Full tenant-level
Operations Manager Monitors inventory, sync status, discrepancies, failures View & manage sync operations
Warehouse Manager Reviews warehouse-aware inventory and location mappings View & update assigned mappings
Support Analyst Investigates failed syncs, webhook events, DLQ jobs Read-only support / troubleshooting
Platform Super Admin Internal platform settings, incidents, operational health Internal admin

πŸ›‘οΈ Engineering Principles & Constraints

  • Respect Shopify API rate limits β€” use GraphQL cost tracking, throttling, queue delays, and retries.
  • Idempotency required β€” webhook delivery is not guaranteed exactly-once; use idempotency keys and unique constraints.
  • No inventory race conditions β€” use sync locks, conflict rules, and serialized processing per mapping.
  • Tenant isolation enforced β€” all merchant-facing data flows through tenant-scoped services and authorization guards.
  • Non-blocking sync β€” sync operations run asynchronously and must never block embedded app page requests.
  • Secrets never committed β€” production secrets stay out of version control.
  • Reliability over AI β€” the MVP prioritizes a dependable sync core before advanced AI features.

🎯 Success Criteria

Category Criteria
Functional Connect stores, map inventory, and run sync jobs
Reliability Failed jobs retry; exhausted jobs move to the dead-letter queue
Security Webhook HMAC verified; tenant isolation enforced
Performance Sync runs asynchronously and respects Shopify rate limits
Observability Sync activity, failures, latency, and discrepancies are visible
SaaS Billing plans and usage limits are enforced
Deployment Staging and production workflows are documented and testable

πŸ“¦ Deployment

The app builds to a standard Node server (pnpm run build β†’ pnpm run start) and ships with a Dockerfile. See Shopify's deployment documentation for hosting options (Google Cloud Run, Fly.io, Render, or manual). Remember to set NODE_ENV=production and provide DATABASE_URL, DIRECT_URL, and Redis connection variables.

The sync worker (workers/sync.worker.ts) must be run as a separate long-lived process alongside the web server.

πŸ“š Resources


SyncFlow β€” built by Dhruv Patel Β· Reliable inventory sync for Shopify merchants.

⭐ Reliability over hype Β· πŸ”’ Tenant-isolated by design Β· ⚑ Async, observable, scalable

About

Production-grade Shopify embedded SaaS for real-time multi-store inventory synchronization, webhook-driven sync orchestration, queue-based retry handling, analytics, billing, and AI-powered inventory insights.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors