Skip to content

Installation

Clone & Install

bash
git clone https://github.com/mageaustralia/maho-storefront.git
cd maho-storefront
bun install

Configure Backend

Edit wrangler.toml to point at your Maho instance:

toml
[vars]
MAHO_API_URL = "https://your-maho-instance.com"
SYNC_SECRET = "your-secret-key"
VariableDescription
MAHO_API_URLBase URL of your Maho backend (no trailing slash)
SYNC_SECRETShared secret for the /sync endpoint

Configure KV Namespace

Create a KV namespace in your Cloudflare dashboard, then update wrangler.toml:

toml
[[kv_namespaces]]
binding = "CONTENT"
id = "your-kv-namespace-id"

Build Assets

bash
# Build both CSS and JS
bun run build

# Or individually:
bun run build:css   # UnoCSS → public/styles.css
bun run build:js    # esbuild → public/controllers.js.txt

Local Development

bash
bun run dev

This starts Wrangler's local dev server at http://localhost:8787. It uses local KV simulation — you'll need to run a sync to populate data:

bash
curl -X POST http://localhost:8787/sync \
  -H "Content-Type: application/json" \
  -d '{"secret": "your-secret-key"}'

Generate Manifest

After adding or modifying component variants:

bash
bun run manifest

This scans all _manifest.json files and generates the root manifest.json.