Skip to content
All work

Case study · 01

Zia

Inventory forecasting and reordering for Shopify merchants.

Role
Founder & engineer, end to end
Period
Sep 2026 – present
Stack
TypeScript, React, Node.js, Cloudflare Workers, TiDB, better-auth, Shopify
Status
Live

The repository is private. This page shows architecture and product behaviour only.

01 The problem

Shopify merchants reorder stock from spreadsheets and memory. They find out a product is out of stock when a customer cannot buy it.

Zia turns sales history and supplier details into purchase orders. Forecasts are rule-based and explainable, and are not marketed as AI.

It has to work inside Shopify admin as an embedded app and as a standalone dashboard, with billing, seats and data a merchant can trust.

02 What I built

  1. zia

    zia: One product, two builds kept in feature parity

  2. node build

    node build: server/ + client/

  3. workers build

    workers build: cloudflare/api + cloudflare/web

  4. better-auth

    better-auth: Organisations, 2FA, admin, API keys

  5. shopify sync

    shopify sync: Products, orders and billing

  6. forecasts + POs

    forecasts + POs: Rule-based reorder points, supplier mapping

  7. tidb

    tidb: Shared data layer

  8. staff console

    staff console: Own Worker, required 2FA, roles, audit log

Zia is one product with two builds. The Node build (server/ and client/) and the Cloudflare Workers build (cloudflare/api and cloudflare/web) share TiDB and the same feature set, and every change lands in both.

Authentication runs on better-auth: organisations, two-factor authentication, admin tooling and API keys. Plans (Starter, Growth, Scale) set seat limits, and an organisation that is deleted stays restorable for 30 days.

The Zia AI assistant sits on a model-agnostic harness. Merchants get monthly AI credits, and any action that changes data waits for the merchant to confirm it.

The staff console runs on its own Worker with separate staff accounts, required 2FA, owner/admin/support/analyst roles and an audit log of every action.

03 Decisions and trade-offs

  1. Decision 01

    Chose Rule-based forecasts over marketing the forecasts as AI.

    Why: A merchant has to understand why Zia suggests a reorder before trusting it with money.

    Cost: The rules need tuning per store instead of learning on their own.

  2. Decision 02

    Chose A separate Worker for the internal staff console over admin routes inside the customer app.

    Why: Staff access gets its own accounts, required 2FA, roles and an audit log, away from customer sessions.

    Cost: A second deployment to run and keep in sync.

04 Results

What shipped

  • Embedded Shopify app and standalone dashboard, live at getzia.xyz.
  • Purchase orders, supplier mapping and rule-based forecasts.
  • Shopify sync and billing with Starter, Growth and Scale plans and plan-based seat limits.
  • API keys, and 30-day soft-delete and restore of organisations.
  • Zia AI assistant on a model-agnostic harness, with monthly AI credits and actions that need confirmation.
  • Internal staff console with owner, admin, support and analyst roles.

Want this kind of work on your team?

Next projectAfriex developer ecosystemAn SDK, two commerce plugins and 18 guides for cross-border payment integrations.