AI Website Builder SaaS PHP Script — Free Download (SiteZip)
SiteZip: customers describe a site, an agentic AI builds it live — 6 designer templates with real photos, click-to-edit, one-click publish, plans & credits, PayPal + bank, PDF invoices, referrals and a full admin panel.
What it is
You run the business side from a single admin panel: plans and monthly credit allowances, pay-as-you-go credit packs, PayPal checkout and manual bank transfers with admin approval, PDF invoices generated without any library, a referral program that converts commissions into credits, support tickets, email templates, languages (RTL included — Arabic ships in the box), a drag-and-drop landing page editor, per-user impersonation for support, and a revenue/builds dashboard.
The AI layer is provider-agnostic: OpenAI, Anthropic, Grok, DeepSeek, ZhipuAI, Ollama Cloud or any OpenAI-compatible endpoint — one setting, one key. Enterprise plans can allow BYOK, where customers plug in their own key and their builds cost you nothing. Every generated site is validated (HTML parse, CSS brace balance, JS syntax, broken-reference checks) and the agent gets up to two automatic repair rounds before a build is accepted. Structure and style are decoupled: a platform-managed design system file lets anyone re-theme a whole site in one click without touching the AI.
It is pure PHP 8.1 + PDO MySQL — no framework, no Composer, no build step. Generated sites are static files only, so customer code can never execute on your server. Installer included; five minutes from upload to first build.
New in 1.1 — a design overhaul. Six designer templates ship in the box (bakery & café, studio & portfolio, coffee & product, florist & boutique, restaurant, makers & classes): complete multi-section sites with real photography, each paired with its own design system. Seven design systems now carry their own typography, palette and radius, so one click re-themes any site. The generated gradient placeholders are gone — a 34-photo CC0 stock library replaces them. And the whole interface was rebuilt in the style of the fastest-growing AI builders: a warm, light UI, a prompt-first landing page with a live template showcase, and a visual template picker on the Create page.
SiteZip vs hosted AI website builders
Hosted AI site builders (Wix, Framer, 10Web, Durable and similar) charge per site, per month, forever — and your customers are their customers. SiteZip flips the model: you pay once for a server and an AI API key, and you sell the subscriptions.
| Feature | SiteZip (self-hosted) | Hosted AI builders |
|---|---|---|
| Who collects the subscription revenue | You — your plans, your prices, your PayPal/bank account | The platform |
| Cost per additional website | Zero — sites are static files on your disk | Typically a new per-site plan |
| AI provider | Any — OpenAI, Anthropic, Grok, DeepSeek, ZhipuAI, Ollama Cloud, or any OpenAI-compatible endpoint; customers can BYOK | Locked to the platform's model |
| Source code & data | Full PHP source on your server; customers download their sites as zips | Closed platform, export varies |
| White-label | ✓ — your brand, your landing page (drag-and-drop editor included) | Rare, usually enterprise-only |
| Click-to-edit + instant no-AI restyle | ✓ — element picker sends context to the agent; quick styles apply free of credits | Varies |
| Undo/redo, revision history, publish snapshots | ✓ — every build checkpointed, rollback any time | Varies |
| Billing building blocks | Subscriptions, credit packs, PayPal + bank transfer, PDF invoices, referrals — all included | N/A — you are the one being billed |
| Runs on shared/VPS hosting | ✓ — PHP 8.1 + MySQL, no build step | — |
Server requirements & dependencies
- PHP 8.1 or newer (pdo_mysql, curl, gd, zip, openssl)
- MySQL 5.7+ / MariaDB 10.3+
- Apache with mod_rewrite (or nginx with an equivalent rewrite)
- An API key for one AI provider (OpenAI, Anthropic, Grok, DeepSeek, ZhipuAI, Ollama Cloud, or any OpenAI-compatible endpoint)
- Optional: Node.js on the server improves JS validation of generated sites
- Optional: a wildcard DNS record + vhost if you want customer sites on real subdomains instead of /s/{slug}/ paths
How to install
2. Open https://yourdomain/install/ and fill in the database and admin details. The installer creates the schema, seeds plans, email templates, two languages (English + Arabic), a design system, a starter template and a small stock-image set, then drops you at the login page.
3. Admin → AI Settings: pick a provider and paste your API key. That is the only external requirement — builds work immediately.
4. Optional, all from Admin → Settings: PayPal client/secret or bank details, SMTP, Turnstile/reCAPTCHA, Google/GitHub login, credit pack pricing, and the landing-page block editor.
5. Optional wildcard publishing: set Settings → Wildcard publish domain (e.g. sites.yourdomain.com), add a *.sites.yourdomain.com DNS record and a vhost that routes every host to public/site-router.php. Custom domains resolve through the same router; put it behind Cloudflare or Caddy for automatic SSL.
The prompt — build it yourself
Paste this into Claude and you'll get this product. This is the actual spec that produced the code above.
Architecture first: no framework, no Composer. A 130-line core (env, PDO helpers, settings with AES-256-GCM secret encryption, auth, CSRF, translations, view engine, SMTP-over-socket mail) plus a flat route table. The agent speaks a strict file protocol —
<<<FILE path>>> … <<<END>>> and <<<DELETE path>>> — and only .html/.css/.js/.json/.svg/.txt/.md paths are accepted, so customer projects can never contain executable server code. Every build passes a validator (DOM parse, CSS brace balance, node --check, broken href/src references) with up to two automatic repair rounds. Revisions are full-workspace zips in the database with a pointer for undo/redo; the invoice PDF writer emits raw PDF 1.4 objects in ~60 lines rather than pulling in a library.What testing actually caught, in order:
1. The installer died with "Column count doesn't match" — the seeded Free/Pro plan rows had 16 values against 17 columns.
2. Every redirect grew a phantom
/public — the installer had guessed app_url from the install path; corrected the stored setting and the URL guesser.3. The editor's code panel covered the whole preview on load:
.ed-code { display:flex } silently defeats the HTML hidden attribute. One [hidden]{display:none!important} line fixed the class of bug for good.4. The chat history, page selector and file list were all dead in the browser while the same endpoints answered curl perfectly. Cause:
WB.base ended with a slash and every JS call added another, and //project/1/status doesn't match any route. Emitted the base trimmed instead.5. Stock images 404'd in preview: the route compiler replaced the greedy
{rest} placeholder *after* the generic {param} regex had already consumed it, so preview/{id}/{rest} never matched paths with slashes. Swapping the two preg_replace calls fixed image serving everywhere.6. End-to-end money test on a throwaway DB: referral signup → bank-transfer subscription → admin approval → plan + credits + 20% commission + PDF invoice, then a mocked PayPal capture with server-side amount verification. The mock AI deliberately omitted a file on the first pass to prove the validator's repair loop fires — it did, and billed exactly one credit.
7. Deploying the public demo caught one more: PHP's DOMDocument still parses as HTML4, so every
<header>, <nav> and <section> raised "Tag invalid" at error level and the validator burned its repair rounds on false positives — every single build paid for a wasted second AI call. Filtered libxml error 801 (unknown tag).Demo mode, added post-launch:
DEMO_MODE=1 in .env turns any install into a safe public demo — one-click sample customer/admin logins, the AI chat and editor stay fully usable through a canned zero-cost mock provider, and every other write is politely blocked; subdirectory installs work because the APP_URL path is now stripped from routes automatically. The product was also renamed from its working title after a marketplace collision check.Verification: 84 files, ~4.4k lines, every PHP file linted, every admin page smoke-tested, RTL Arabic rendered, SSE stream delivering badge counts, and headless-browser screenshots of the real editor building a real (mock-AI) bakery site.
v1.1 — design revision (Claude Opus 5.5): the brief was blunt — "the demo design is too basic and bad; study the most successful SaaS products and rebuild it in that structure — and the site in the demo looks broken."
Root cause of the broken demo site: the demo's canned AI replied to the first build by writing a four-line styles.css, which overwrote the template's entire stylesheet — so the header, nav and hero lost all styling, and the only image was a GD-generated gradient blob. The mock now emits a full, designed site; follow-up requests append a tasteful variation to the stylesheet instead of replacing it.
Reference: Lovable — the fastest-growing product in the category — sets the pattern: a prompt box as the hero, suggestion chips, a soft gradient glow, and a showcase of real sites underneath. SiteZip's landing follows that structure; the UI moved from a generic dark-purple SaaS look to a warm light theme with Instrument Serif display type and near-black primary buttons.
Templates & photos: 34 CC0 photographs were pulled from Openverse (only licence=cc0, so no attribution is legally required — credits ship anyway), picked from contact sheets per theme (a batch of 1920s archive photos was rejected for the yoga theme, which became a pottery studio). Six templates were written with genuinely different layouts — split hero with a floating badge, oversized-type architecture grid, dark full-bleed roastery, arched florist imagery, a restaurant menu with dotted leaders, an editorial pottery schedule — all built only on design-system tokens so re-theming works.
Bugs found on the way (fix → proof):
- Publish copied stock photos only when referenced from HTML; CSS background-image photos never reached the live site. Now .css is scanned too — verified on a fresh install where the roastery hero (CSS-only) was copied on publish.
- The AI was told stock paths as absolute
/assets/stock/…, which resolve to the domain root on /s/{slug}/ sites and in the editor preview. Paths are now relative.- The validator treated HTML5 bare ampersands ("Kiln & Co.") as errors via libxml's HTML4 parser, burning a repair round — and a credit — on almost every build. That false positive is now skipped.
- A shared iframe thumbnail on the dashboard rendered a cropped half-site; thumbnails now render a true 1440×900 desktop scaled to the card.
Verification: fresh install from the zip on an empty database (7 design systems, 7 templates, 34 photos, 6 landing blocks seeded) → register with a landing prompt (it carried through sign-up to the Create page) → Auto template picked the roastery from tags, design matched to Noir → build → publish → live site 200 with all images.
Reviews
Used AI Website Builder SaaS PHP Script — Free Download (SiteZip)? A star rating takes two seconds and helps others.
More builds
License: MIT — free for personal and commercial use, no warranty. Software is provided as is; review the code before running it in production (it's short enough to actually read).