This guide takes you from a clean checkout to a running storefront and admin on
http://localhost:3000.
Before you start
- Node.js 22+ and pnpm 10+.
- A Cloudflare account if you want to create the remote D1 database now. A local-only setup can skip remote D1 creation.
- macOS/Linux shell (the bootstrap script is Bash).
Steps
Clone the repository
git clone <your-edgecart-repository> edgecart cd edgecartBootstrap the workspace
For a local-only setup that does not create a remote D1 database:
SKIP_D1_CREATE=1 pnpm bootstrapTo create the Cloudflare D1 database now, sign in first and run the default bootstrap:
pnpm --filter edgecart exec wrangler login pnpm bootstrappnpm bootstrapinstalls dependencies, creates the D1 database when thedatabase_idis still the all-zero placeholder, and applies migrations locally. It is safe to re-run.Create the local environment file
cp apps/edgecart/.dev.vars.example apps/edgecart/.dev.varsSet
BETTER_AUTH_SECRETto a random value:openssl rand -base64 32Keep the default local values for
BETTER_AUTH_URLandTRUSTED_ORIGINS:BETTER_AUTH_SECRET=<generated-value> BETTER_AUTH_URL=http://localhost:3000 TRUSTED_ORIGINS=http://localhost:3000Start the app
pnpm devOpen
http://localhost:3000. The storefront is at/, the admin at/admin.Create the first account
Open
/signupand create an account. WithSMTP_HOSTempty, auth email is skipped and logged in the dev server output instead of being sent.Then open
/admin. The first signed-in user becomes the owner of the deployment’s store, created as My Store.
Optional: test payments
The storefront checkout needs Stripe test keys in .dev.vars:
STRIPE_SECRET_KEY=sk_test_...
STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...Use the Stripe CLI to forward webhook events:
pnpm stripe:listenWithout Stripe keys, you can still build the catalog and test zero-total carts; paid checkout is blocked by the payment gate.
Verify
pnpm devstarts without migration errors.http://localhost:3000renders the storefront./adminopens and shows the dashboard for your store.
Troubleshooting
Bootstrap fails creating D1. You are not logged in to Cloudflare, or the
database already exists. Run pnpm --filter edgecart exec wrangler login and
retry, or use SKIP_D1_CREATE=1 pnpm bootstrap for local-only work.
Missing BETTER_AUTH_SECRET. The app reads apps/edgecart/.dev.vars; make
sure you copied the example and replaced the secret.
Changes do not appear in D1. Apply local migrations with
pnpm db:migrate:local.