EnderShop is a TanStack Start monorepo configured for Cloudflare Workers.
It now uses:
@cloudflare/vite-pluginfor Workers-compatible local development and build output- Cloudflare D1 for persistence
- Drizzle ORM for schema and query access
- Better Auth with anonymous guest sessions and email/password accounts
- Stripe Checkout for one-time and subscription rank products
- EnderDash console execution for fulfillment
- shadcn/ui on the Base UI primitive layer with Tailwind CSS v4 and RTL support
apps/web: the storefront, Worker config, auth routes, Stripe handlers, D1 access, and fulfillment codepackages/ui: shared Base UI / shadcn components and global styles
- Copy
apps/web/.dev.vars.exampletoapps/web/.dev.vars. - Replace the placeholder Stripe, EnderDash, and legal/company values.
- Install dependencies:
bun install- Generate Cloudflare Worker types:
bun run --cwd apps/web cf-typegen- Start local development:
bun run devThe app runs through Vite in the Workers runtime via the Cloudflare Vite plugin.
apps/web/src/routes/api/auth/$mounts Better Auth for TanStack Start.apps/web/src/routes/api/shop/checkoutcreates Stripe Checkout Sessions.apps/web/src/routes/api/stripe/webhookhandles Stripe webhooks and updates entitlements.apps/web/src/lib/server/enderdash.tssends console execution requests to EnderDash over its tRPC HTTP API using an API key.apps/web/src/lib/server/product-config.tsmaps shop products to Stripe price IDs and command templates.apps/web/src/lib/server/schema.tsdefines the Drizzle schema used on D1.apps/web/wrangler.jsoncdefines the Worker runtime and D1 binding.
DB: Cloudflare D1 database bindingBETTER_AUTH_URL: public URL of EnderShopBETTER_AUTH_SECRET: Better Auth secretSTRIPE_SECRET_KEY: Stripe secret keySTRIPE_WEBHOOK_SECRET: Stripe webhook signing secretSTRIPE_PRICE_*: Stripe price IDs for the sample productsENDERDASH_BASE_URL: EnderDash app base URLENDERDASH_API_KEY: EnderDash API key sent asx-api-keyENDERDASH_ORGANIZATION_ID: EnderDash organization scope for fulfillmentENDERDASH_SERVER_ID: EnderDash server scope for fulfillmentSHOP_COMPANY_*: provider details used by the legal pages
Public shop metadata lives in:
apps/web/src/lib/shop/catalog.ts
Stripe and EnderDash fulfillment mapping lives in:
apps/web/src/lib/server/product-config.ts
If you want different rank names or command templates, update that server config file.
The Drizzle schema lives in:
apps/web/src/lib/server/schema.ts
The Drizzle config lives in:
apps/web/drizzle.config.ts
Generate future migrations with:
bun run --cwd apps/web db:generateThe current scaffold also bootstraps its tables at runtime so a fresh D1 database can come up during early development without a separate migration step.
Deploy from the app workspace:
bun run --cwd apps/web deployBefore production deployment, replace the placeholder values in wrangler.jsonc and move sensitive values to real Wrangler secrets where appropriate.
The storefront includes:
/legal/terms/legal/privacy/legal/cookies/legal/imprint