Installation
Clone & Install
bash
git clone https://github.com/mageaustralia/maho-storefront.git
cd maho-storefront
bun installConfigure 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"| Variable | Description |
|---|---|
MAHO_API_URL | Base URL of your Maho backend (no trailing slash) |
SYNC_SECRET | Shared 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.txtLocal Development
bash
bun run devThis 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 manifestThis scans all _manifest.json files and generates the root manifest.json.