EdgeCart is a TypeScript commerce platform built for Cloudflare Workers. A single Worker serves the storefront, the admin console, and the API. Commerce data lives in D1, product images in R2, and background work (webhooks, email, plugin hooks) moves through a Cloudflare Queue.
Local development
Bootstrap the workspace, migrate D1, and run the app on localhost.
API reference
Browse the generated Storefront API reference.
Commerce modules
Understand the business domains behind the admin and the APIs.
Limitations
Current boundaries, including features that are API-only or not built yet.
What is in the repository
| Surface | What it does |
|---|---|
apps/edgecart |
Main Worker: storefront, admin, Hono API, Better Auth, D1 access. |
apps/edgecart-plugins |
Plugin kernel: installs, releases, and runs plugin bundles in Dynamic Workers. |
apps/edgecart-plugin-assets |
Serves plugin assets from R2 with strict content and framing rules. |
apps/edgecart/workers/outbox |
Queue consumer for webhooks, email, and plugin hooks. |
packages/commerce-* |
Narrow commerce packages: core, sales, catalog, cart, storefront, orders, payments, order changes, observability. |
packages/admin-api, storefront-api, contract |
Typed clients and the shared API contract. |
packages/plugin-* |
Plugin SDK, runtime, registry, blocks, and CLI. |
Explore the guide
- Local development — bootstrap D1 and run the storefront and admin on localhost.
- Architecture — Workers, bindings, and request flow.
- Configuration & secrets — environment variables and production secrets.
- Deploy to Cloudflare — D1, R2, queues, secrets, and the four Workers.
- Auth, roles & API keys — sessions, roles, publishable keys, and secret keys.
- Admin API guide — typed client for back-office automation.
- Storefront API guide — build a storefront on the public API.
- Webhooks & events — signatures, retries, and de-duplication.
- Event catalog — every outbox event and its plugin hook.
- Merchant rules DSL — the deterministic rule document and its API.
- Operations & observability — outbox worker, webhook delivery, email, and audit retention.
- Data model & migrations — D1 schema and Drizzle.
- Testing — unit, integration, and CLI suites.
- Package boundaries — how the commerce packages fit together.
- Troubleshooting — diagnose local setup, API, checkout, webhook, and plugin problems.
Building a plugin? The Plugin guide is a separate top-level section covering the sandbox runtime, manifest, hooks, admin UI, storefront slots, and publishing.
The API reference lists the current public operations, and API conventions explains authentication, errors, pagination, money, idempotency, and rate limits.