---
title: "Developer guide"
description: "Run EdgeCart locally, deploy it on Cloudflare, and build on its commerce APIs."
---

> Documentation Index
> Fetch the complete documentation index at: https://edgecart.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Developer guide

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**](https://edgecart.dev/developers/local-development) — Bootstrap the workspace, migrate D1, and run the app on localhost.
- [**API reference**](https://edgecart.dev/api) — Browse the generated Storefront API reference.
- [**Commerce modules**](https://edgecart.dev/modules/) — Understand the business domains behind the admin and the APIs.
- [**Limitations**](https://edgecart.dev/reference/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](https://edgecart.dev/developers/local-development) — bootstrap D1 and run
  the storefront and admin on localhost.
- [Architecture](https://edgecart.dev/developers/architecture) — Workers, bindings, and request
  flow.
- [Configuration & secrets](https://edgecart.dev/developers/configuration) — environment variables
  and production secrets.
- [Deploy to Cloudflare](https://edgecart.dev/developers/deployment) — D1, R2, queues, secrets,
  and the four Workers.
- [Auth, roles & API keys](https://edgecart.dev/developers/auth) — sessions, roles, publishable
  keys, and secret keys.
- [Admin API guide](https://edgecart.dev/developers/admin-api) — typed client for back-office
  automation.
- [Storefront API guide](https://edgecart.dev/developers/storefront-api) — build a storefront on the
  public API.
- [Webhooks & events](https://edgecart.dev/developers/webhooks) — signatures, retries, and
  de-duplication.
- [Event catalog](https://edgecart.dev/reference/events) — every outbox event and its plugin hook.
- [Merchant rules DSL](https://edgecart.dev/developers/merchant-rules) — the deterministic rule
  document and its API.
- [Operations & observability](https://edgecart.dev/developers/operations) — outbox worker,
  webhook delivery, email, and audit retention.
- [Data model & migrations](https://edgecart.dev/developers/data-model) — D1 schema and Drizzle.
- [Testing](https://edgecart.dev/developers/testing) — unit, integration, and CLI suites.
- [Package boundaries](https://edgecart.dev/developers/packages) — how the commerce packages fit
  together.
- [Troubleshooting](https://edgecart.dev/developers/troubleshooting) — diagnose local setup, API,
  checkout, webhook, and plugin problems.

Building a plugin? The [Plugin guide](https://edgecart.dev/plugins/) is a separate top-level
section covering the sandbox runtime, manifest, hooks, admin UI, storefront
slots, and publishing.

The [API reference](https://edgecart.dev/api) lists the current public operations, and
[API conventions](https://edgecart.dev/reference/api-conventions) explains authentication, errors,
pagination, money, idempotency, and rate limits.

> **Single-store deployment**
>
> The admin is single-store: the first signed-in user to open `/admin` owns the
> deployment's store. The data model is still multi-store scoped (`store_id`,
> `x-store-id`), but there is no store picker in the admin.

Source: https://edgecart.dev/developers/index.mdx
