Web_Builder-Z-ai

Web Builder Z-AI

A comprehensive website builder with 25+ built-in features, designed for Cloudflare deployment. Prisma-free architecture with centralized API client ready for Workers migration.

Features

Visual Builder

Tools & Panels

Export & Persistence

Mobile

Keyboard Shortcuts

Quick Start

npm install
npm run dev

Then visit http://localhost:3000

Pages

Route Description
/ Landing page with links to Dashboard and Builder
/dashboard Data management dashboard (users, posts)
/website-builder.html Full visual website builder
/api/health API health check
/api/users Users CRUD (GET, POST)
/api/users/[id] Single user (GET, PUT, DELETE)
/api/posts Posts CRUD (GET, POST)
/api/posts/[id] Single post (GET, PUT, DELETE)

Architecture

src/
  app/
    page.tsx              # Landing page
    layout.tsx            # Root layout
    globals.css           # Tailwind + theme
    dashboard/page.tsx    # Data dashboard (fetch-based)
    api/
      health/route.ts     # Health check endpoint
      users/route.ts      # Users list + create
      users/[id]/route.ts # User CRUD
      posts/route.ts      # Posts list + create
      posts/[id]/route.ts # Post CRUD
  lib/
    api.ts                # Centralized API client (fetch-based)
    mock-data.ts          # Mock data store (replace with Workers API)
  types/
    index.ts              # TypeScript interfaces
public/
  website-builder.html    # Single-file visual builder
  css/                    # Builder CSS modules
  js/                     # Builder JS modules (12 files)
dist/
  website-builder.html    # Standalone builder (no build tools needed)

Data Flow

Frontend Component
    ↓ fetch()
lib/api.ts (centralized client)
    ↓ HTTP request
Next.js API Routes (/api/*)
    ↓ currently reads from
lib/mock-data.ts (in-memory mock store)
    ↓ replace with
Cloudflare Workers (D1 / KV / R2) ← future migration

Cloudflare Migration

This project is designed for zero-friction migration to Cloudflare:

  1. API Routes (src/app/api/*) — Currently return mock data. Replace mock data calls with fetch() to your Cloudflare Workers URL.
  2. Frontend — Uses NEXT_PUBLIC_API_BASE env var. Set it to your Workers URL and all data flows through Workers.
  3. No Prisma — Zero database dependencies. Use Cloudflare D1, KV, or R2 as needed.
  4. Static Export — The builder (website-builder.html) is pure static and works on Cloudflare Pages out of the box.
# When ready to connect Cloudflare Workers:
NEXT_PUBLIC_API_BASE=https://your-workers.your-subdomain.workers.dev npm run dev

Tech Stack

License

MIT