Setup guide

Run EWD locally & go live

EWD runs in demo mode with no credentials (data in your browser, built-in AI engine). Add the keys below to switch on real accounts, Claude, publishing, domains and payments.

This environment
  • Database, auth & storage (Supabase)— on
  • Static preview build— off
1

Install & run

Requires Node 20+.

npm install
cp .env.example .env.local   # leave blank for demo mode
npm run dev                  # http://localhost:3000
2

Create the Supabase project

Create a project at supabase.com, then run supabase/migrations/0001_init.sql and 0002_business.sql, 0003_guests.sql and 0004_templates.sql in order (SQL editor → paste → Run). It creates every table, row-level-security policy, plan-limit trigger and the public media storage bucket.

To manage the template library, make yourself an administrator: update public.profiles set is_admin = true where email = 'you@example.com'; then open Template manager in the dashboard.

For guest mode (build first, sign up later) turn on Authentication → Allow anonymous sign-ins (leave CAPTCHA off until EWD adds Turnstile support — the app doesn't send CAPTCHA tokens yet). Guest projects are private, limited (1 site, 25 AI credits, 25 MB) and kept for 30 days. Add social sign-in by setting NEXT_PUBLIC_AUTH_PROVIDERS=google,github after configuring those providers in Supabase.

In Authentication → URL configuration, add {APP_URL}/auth/callback as a redirect URL.

3

Add your keys

VariableWherePurpose
NEXT_PUBLIC_SUPABASE_URLSupabase → Project settings → APISwitches the app from demo mode to live mode
NEXT_PUBLIC_SUPABASE_ANON_KEYSupabase → Project settings → APIPublic key; safe in the browser (RLS protects data)
SUPABASE_SERVICE_ROLE_KEYSupabase → Project settings → APIServer only — publishing, forms, webhooks
ANTHROPIC_API_KEYconsole.anthropic.comClaude for site generation & AI editing
ANTHROPIC_MODELoptionalDefaults to claude-sonnet-5-5
NEXT_PUBLIC_ROOT_DOMAINyour domaine.g. ewdmarketing.co.za — sites live at slug.ewdmarketing.co.za
NEXT_PUBLIC_APP_URLyour domaine.g. https://app.ewdmarketing.co.za
STRIPE_SECRET_KEY / STRIPE_WEBHOOK_SECRETdashboard.stripe.comCard subscriptions + store checkout
STRIPE_PRICE_STARTER / _PRO / _BUSINESSStripe → ProductsRecurring price IDs for each plan
PAYFAST_MERCHANT_ID / _KEY / _PASSPHRASEpayfast.co.za → SettingsZAR subscriptions; set PAYFAST_SANDBOX=1 to test
VERCEL_TOKEN / VERCEL_PROJECT_ID / VERCEL_TEAM_IDvercel.com → Settings → TokensAdds custom domains & provisions SSL automatically
RESEND_API_KEY / EMAIL_FROMresend.com → API keysSends receipts, booking confirmations, campaigns & automations
TWILIO_* or BULKSMS_TOKEN_*twilio.com or bulksms.comSMS booking reminders and SMS automation steps
MEMBER_SESSION_SECRETany long random stringSigns site-member (customer) sessions
CRON_SECRETany long random stringProtects /api/cron (automation waits, cart recovery, reminders)
4

Payments

Stripe: create three recurring prices, set the price IDs, and point a webhook at /api/billing/stripe/webhook (events: checkout.session.completed, customer.subscription.updated, customer.subscription.deleted).

PayFast: set merchant ID/key/passphrase. The ITN (notify) URL /api/billing/payfast/itn is sent automatically with each checkout and is signature- and server-validated.

5

Business tools: email, SMS & scheduled jobs

Orders, bookings, RSVPs, campaigns and automations run on the server engine (/api/site/action, /api/biz). Without an email/SMS provider, messages are logged as “not configured” in each site’s Message log — nothing fails silently.

Automation waits, abandoned-cart recovery and 24-hour booking reminders run from /api/cron. vercel.json schedules it every 15 minutes; set CRON_SECRET in Vercel.

Shop orders, booking deposits and paid tickets use Stripe Checkout when STRIPE_SECRET_KEY is set, otherwise PayFast. Payments currently settle to the platform account; per-merchant payouts (Stripe Connect / per-site PayFast) are the next step for multi-merchant use.

6

Deploy to Vercel with subdomains & custom domains

vercel deploy --prod
# Domains: add  app.ewdmarketing.co.za  and  *.ewdmarketing.co.za  (wildcard)
# DNS: *.ewdmarketing.co.za  CNAME  cname.vercel-dns.com

The middleware routes {slug}.ewdmarketing.co.za and any verified custom domain to the published site. With VERCEL_TOKEN set, connecting a domain registers it on your Vercel project, and SSL is issued automatically once DNS verifies.