Skip to content

DataViking-Tech/formhuset

Repository files navigation

Formhuset — Shopify synthetic store toolkit

Scripts that seed a Shopify development store with a complete, realistic-looking business: product catalog, customers, and three years of backdated order history — plus storefront content (pages, menus, policies, collections) so the shop passes as a real brand.

Built for formhuset.dataviking.tech: 48 abstract products (6 colors × 8 shapes × 3 sizes), ~1,200 customers, ~2,650 orders spanning 36 months with growth ramp, holiday seasonality, repeat buyers, discounts, refunds, and cancellations.

Requirements

  • Node 22+ (uses built-in fetch, no dependencies)
  • A Shopify store with a custom app installed, using the OAuth client credentials grant
  • Env vars: SHOP (myshopify domain), CLIENT_ID, CLIENT_SECRET

Scripts

Script Purpose
generate.mjs Core generator: probe (introspect API input types), products, customers, orders [--months N] [--limit N], repair (re-issue failed refunds), all
setup-store.mjs tags (tag products by color/shape), collections (create smart collections)
enrich-content.mjs pages, policies, menus, descriptions, all — storefront content realism pass
upload-images.mjs Match images/{color}-{shape}.png files to products and upload via staged uploads

Typical order: productscustomerstagscollections → publish to the Online Store channel → ordersrepairall content.

SHOP=xxx.myshopify.com CLIENT_ID=... CLIENT_SECRET=... node generate.mjs all

Design notes

  • Backdating: orders use processedAt (Shopify analytics respect it); createdAt is not settable.
  • Determinism: order composition, customer choice, discounts, and refund/cancel fates derive from a seeded RNG keyed on (month, index), so runs are resumable — progress checkpoints to state.json and re-running skips completed work.
  • Refunds need a parentId pointing at the SALE transaction; the repair subcommand backfills refunds that failed before that was in place.
  • Publishing: API-created products/collections are not visible on the Online Store until published to its publication (publishablePublish).
  • Payments: manual/test gateways marked SUCCESS — you cannot simulate real Shopify Payments payouts.
  • Customer emails are all @example.com and every order/refund/cancel is created with notifications suppressed, so nothing ever emails a real inbox.

Theme customization (hero, sections, footer) was done separately via the themeFilesUpsert GraphQL mutation against the Horizon theme; those snapshots are intentionally not committed.

About

Shopify synthetic store toolkit: seed a dev store with a catalog, customers, and 36 months of realistic order history

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages