Skip to content

About

AI website builder for hosting platforms: prompt -> live, branded EmDash site on Cloudflare Workers for Platforms (one isolated Worker + D1 per site).

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

EmDash AI Site Builder — on Cloudflare Workers for Platforms

An agent-native hosting experience: a control panel where a customer describes their business in one sentence and, seconds later, gets a real, branded, fully editable website — each running as its own isolated Worker with its own database.

It's the kind of product a hosting platform could ship to move from managing infrastructure to owning the web-experience layer — built entirely on Cloudflare Workers for Platforms and EmDash.

Deploy to Cloudflare

The button clones the repo and deploys the platform Worker + container into your account. This is an advanced, multi-service setup — Workers for Platforms, a dispatch namespace, a wildcard zone, and a couple of secrets are required. Follow Requirements and Setup to finish wiring it up. When connecting via the button / Workers Builds, set the build command to ./wfp/deployer/build-bundle.sh so the EmDash bundle is generated before deploy.


What it does

  1. Customer signs in (email only in this demo) and sees their site dashboard.
  2. They click New website, describe it, and hit generate.
  3. Workers AI writes the brand (name, accent color, copy, testimonials, hours) and picks a template from a registry that best fits the business.
  4. The site is provisioned deploy-only (no per-site build, ~30–45s): a per-site D1 database is created and the prebuilt EmDash bundle is deployed into a dispatch namespace as an isolated user Worker, seeded with the AI content and Unsplash imagery.
  5. It's served at https://<site>.sites.<yourdomain> and is a full CMS — editable by humans and AI agents (EmDash ships APIs + an MCP server).

Template registry

Templates live in src/templates.ts (id, label, description, keywords) with visual presets in wfp/deployer/template-overrides/themes.css — distinct font pairings, header layouts, hero styles, and shapes. The generator matches each prompt to the best template; grow the library over time by adding a registry entry + a style block (no per-site build).

Architecture & operational detail: see WORKERS-FOR-PLATFORMS.md.


Requirements

  • A Cloudflare account on a Workers Paid plan.
  • Workers for Platforms enabled (Enterprise add-on / paid feature). Without it, dispatch namespaces aren't available. Check: npx wrangler dispatch-namespace list.
  • A Cloudflare zone (a domain on your account) for the generated sites' wildcard subdomains, e.g. *.sites.yourdomain.com.
    • A two-level wildcard (*.sites.yourdomain.com) needs Advanced Certificate Manager (paid). A single-level wildcard (*.yourdomain.com) is covered by Universal SSL.
  • An API token (used by the deployer to create D1 + deploy sites) with: Workers Scripts:Edit, Workers for Platforms:Edit, D1:Edit, Workers KV Storage:Edit, Workers R2 Storage:Edit, Account Settings:Read (and, if you want the included wildcard DNS/ACM helper, Zone DNS:Edit + SSL:Edit).
  • Docker (for local wrangler deploy container image builds).
  • (Optional) an Unsplash API access key for topic-relevant imagery (falls back to keyword images with no key).

Setup

git clone https://github.com/scottbuscemi/emdash-platform-wfp
cd emdash-platform-wfp
npm install
  1. Create the resources and note the ids:
    npx wrangler dispatch-namespace create emdash-sites
    npx wrangler kv namespace create emdash-platform-wfp     # -> DEMO_KV id
    npx wrangler kv namespace create emdash-session          # -> SESSION_KV_ID
    npx wrangler r2 bucket create emdash-sites-media
  2. Fill in wrangler.jsonc — replace REPLACE_WITH_* (KV ids, account id) and set SITE_HOST_SUFFIX to your zone (e.g. sites.yourdomain.com).
  3. Set secrets:
    npx wrangler secret put CLOUDFLARE_API_TOKEN      # the deploy-scoped token above
    npx wrangler secret put UNSPLASH_ACCESS_KEY       # optional
  4. Build the EmDash bundle (the deployer image bakes it in):
    ./wfp/deployer/build-bundle.sh
    Generates wfp/deployer/emdash/dist with a fresh encryption key (git-ignored).
  5. Deploy the platform Worker (builds + pushes the deployer container image):
    npx wrangler deploy
  6. Deploy the dispatch router and point your wildcard at it:
    cd wfp/dispatch
    # edit wrangler.jsonc: set SITE_HOST_SUFFIX, the route pattern, and zone_name
    npx wrangler deploy
    Then add a proxied wildcard DNS record for *.sites.yourdomain.com and (for a two-level wildcard) order an ACM certificate covering it.
  7. Open the platform Worker's URL, sign in, and generate a site.

Rebuilding the template bundle: the EmDash bundle is pre-baked at wfp/deployer/emdash/dist. To change templates/fonts/homepage, edit wfp/deployer/template-overrides/*, run wfp/deployer/build-bundle.sh, then bump DEPLOYER in src/index.ts (so a fresh deployer container pulls the new image) and npx wrangler deploy.


Notes

  • EmDash build fix: the bundle applies emdash-cms/emdash#1613 (an Astro-7 compiler fix); remove the patch once it ships in a published release.
  • Behind a TLS-inspecting corporate proxy? Drop your proxy's root CA (*.crt) into wfp/deployer/certs/ before building the deployer image (it's git-ignored).
  • Demo scope: the control-panel "login" is email-only (no real auth); generated sites use EmDash's passkey setup on first admin visit. Harden both for production.

License

MIT

About

AI website builder for hosting platforms: prompt -> live, branded EmDash site on Cloudflare Workers for Platforms (one isolated Worker + D1 per site).

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages