Skip to content
weLabsweLabsStorefront Playbook
Live demoQuickstart

Storefront setup

Install the storefront

Clone the monorepo, install it with pnpm and run the full store locally in Demo Mode, with no backend.

This page gets the storefront running on your machine in Demo Mode: a complete store with a catalogue, cart, checkout and a demo account, all in memory. You need no WordPress for any of it. Connecting a real WooCommerce site comes next, in Connect WooCommerce.

You need Version Notes
Node.js 22 or newer The repository’s engines field requires it. Older versions fail with syntax errors.
pnpm 10.33.0 Pinned in package.json. Corepack, which ships with Node, installs it for you. npm and Yarn are not supported.
Git Any current version With access to the private repository (see below).
Playwright Chromium Installed by a command below Only needed to run the browser test suite.

Check your Node version first:

Terminal window
node --version # must print v22 or later

If it prints an older version, install Node 22 or newer and make sure it comes first on your PATH. On a Mac with Homebrew, that usually means:

Terminal window
export PATH="/opt/homebrew/opt/node/bin:$PATH"
  1. Clone the repository.

    Terminal window
    git clone git@github.com:welabs-ltd/retail-store-frontend.git
    cd retail-store-frontend
  2. Turn on Corepack. It provides the exact pnpm version the repository pins.

    Terminal window
    corepack enable
  3. Install dependencies. One install covers the app and every package in the workspace.

    Terminal window
    pnpm install
  4. Create your environment file. The app reads apps/storefront/.env.

    Terminal window
    cp apps/storefront/.env.example apps/storefront/.env

    The template already sets COMMERCE_SOURCE=mock, which is Demo Mode.

  5. Set AUTH_SECRET. It signs the sign-in session cookie and is required in every mode. Generate a value:

    Terminal window
    openssl rand -base64 32

    Paste it into apps/storefront/.env:

    AUTH_SECRET=paste-the-generated-value-here
  6. Start the dev server.

    Terminal window
    pnpm dev

    Open http://localhost:3000. You have a working store.

Sign in, shop and pay with these. No real money moves and no payment provider is contacted.

What Value
Demo account demo@retail.store / demo1234
Coupon DEMO10 (10% off)
Card that is approved 4242 4242 4242 4242
Card that is declined 4000 0000 0000 0002
Card that asks for a bank check (3-D Secure) 4000 0000 0000 3220

Any future expiry date and any three-digit security code work. The full list of seeded data is in Demo data.

The storefront ships English and Arabic, with full right-to-left layout. Start it with both Locales:

Terminal window
STOREFRONT_LOCALES=en,ar pnpm dev

English is served at / and Arabic under /ar, with a language switcher in the header. The first Locale in the list is the default and has no prefix. To make it permanent, set STOREFRONT_LOCALES=en,ar in apps/storefront/.env. See Configuration for the rules.

These are the same checks CI runs on every push. Run them from the repository root.

Terminal window
pnpm typecheck # strict TypeScript across every workspace package
pnpm lint # ESLint, including the architecture and right-to-left rules
pnpm test # Vitest: the contract suite and package tests, no network
pnpm test:e2e # Playwright smoke suite, always in Demo Mode
pnpm build # production build

Install the Playwright browser once before the first pnpm test:e2e:

Terminal window
pnpm --filter @welabs/retail-storefront exec playwright install chromium

If your WordPress runs locally on a .test domain (Laravel Herd, Valet and similar tools), Node will not trust its self-signed certificate. You have two options.

Point Node at your local certificate authority’s root certificate. Node reads this variable when it starts, so set it in your shell, not in .env:

Terminal window
export NODE_EXTRA_CA_CERTS="/path/to/your-local-ca.pem"
pnpm dev

Herd and Valet keep their CA certificate in their own configuration folder.

Product images from a local backend work without extra settings: when WOO_STORE_URL points at a .test, localhost or private-network address, the image optimiser is allowed to fetch from it in development.

Next.js 16 blocks the dev server’s scripts for any host other than localhost. If you open the store from a phone on your network or through a tunnel, the page renders but nothing is clickable. List the extra hosts in apps/storefront/.env:

DEV_ALLOWED_ORIGINS=192.168.1.20,*.trycloudflare.com

The list is comma-separated and accepts wildcards. It only affects pnpm dev, never a production build. Behind a tunnel, also set AUTH_TRUST_HOST=true so sign-in sees the tunnel’s address instead of localhost.

Storefront Playbook · Built by weLabsFeaturesFAQTalk to us