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.
- Database, auth & storage (Supabase)— on
- Static preview build— off
Install & run
Requires Node 20+.
npm install cp .env.example .env.local # leave blank for demo mode npm run dev # http://localhost:3000
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.
Add your keys
| Variable | Where | Purpose |
|---|---|---|
| NEXT_PUBLIC_SUPABASE_URL | Supabase → Project settings → API | Switches the app from demo mode to live mode |
| NEXT_PUBLIC_SUPABASE_ANON_KEY | Supabase → Project settings → API | Public key; safe in the browser (RLS protects data) |
| SUPABASE_SERVICE_ROLE_KEY | Supabase → Project settings → API | Server only — publishing, forms, webhooks |
| ANTHROPIC_API_KEY | console.anthropic.com | Claude for site generation & AI editing |
| ANTHROPIC_MODEL | optional | Defaults to claude-sonnet-5-5 |
| NEXT_PUBLIC_ROOT_DOMAIN | your domain | e.g. ewdmarketing.co.za — sites live at slug.ewdmarketing.co.za |
| NEXT_PUBLIC_APP_URL | your domain | e.g. https://app.ewdmarketing.co.za |
| STRIPE_SECRET_KEY / STRIPE_WEBHOOK_SECRET | dashboard.stripe.com | Card subscriptions + store checkout |
| STRIPE_PRICE_STARTER / _PRO / _BUSINESS | Stripe → Products | Recurring price IDs for each plan |
| PAYFAST_MERCHANT_ID / _KEY / _PASSPHRASE | payfast.co.za → Settings | ZAR subscriptions; set PAYFAST_SANDBOX=1 to test |
| VERCEL_TOKEN / VERCEL_PROJECT_ID / VERCEL_TEAM_ID | vercel.com → Settings → Tokens | Adds custom domains & provisions SSL automatically |
| RESEND_API_KEY / EMAIL_FROM | resend.com → API keys | Sends receipts, booking confirmations, campaigns & automations |
| TWILIO_* or BULKSMS_TOKEN_* | twilio.com or bulksms.com | SMS booking reminders and SMS automation steps |
| MEMBER_SESSION_SECRET | any long random string | Signs site-member (customer) sessions |
| CRON_SECRET | any long random string | Protects /api/cron (automation waits, cart recovery, reminders) |
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.
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.
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.