← All posts

Post

Build a Business Website With Claude, Hosted Free on Cloudflare

How I built my wife's business website with Claude Code and host it free on Cloudflare Pages: the setup, the checks, what broke, and how to copy it.

19 min read

Copy this article

Clipboard access is unavailable. Select the Markdown and copy it, then paste it into your chat.

I built a small business website with Claude Code and host it on Cloudflare Pages for free. It’s for my wife’s business, Phan of Sleep, a pediatric sleep consulting practice in Calgary, and it’s meant to replace her WordPress site. Claude Code wrote most of it, GitHub builds it and Cloudflare serves it.

I’m describing how the repo is set up and what its history shows. I don’t have traffic, rankings or lead numbers I can stand behind, so you won’t get any. The site isn’t a success story yet. It’s a build story.

Quick answer

The stack is static HTML templates and JSON files, one Node script that builds everything into a dist folder, GitHub Actions for checks and deploys, and Cloudflare Pages for hosting. Pages hosting, preview deployments and static requests are free. The domain name isn’t, and neither are third-party tools like the booking system and the email sender. The repo shows a build script, page templates, check scripts and a deploy workflow, with Claude named as co-author on seven commits, and a person still has to review all of it. The catch is that there’s no admin screen, so edits happen in text files.

Cloudflare and GitHub change their docs and limits. I checked everything below on 2026-10-21, so look at the linked pages before you rely on a number.

Why a static site instead of WordPress

The old site ran on WordPress with Elementor. The repo’s audit notes list what was wrong with it. Most images had empty alt text. There was no social preview image and no structured data. The homepage was very long, with a 16 question FAQ inline. The mobile viewport blocked pinch zoom. The footer still said 2023. The blog had two posts, and two pages (Client Portal and Resources) went nowhere.

Some of that is WordPress and some is neglect. A plugin or two would’ve fixed several items. But the site has one job on every page: get a tired parent to book a free discovery call. That takes a handful of pages, a booking embed, a contact form and a free PDF guide. No database, no login. A static site fits that, and it’s fast, cheap and has very little to patch.

The tradeoff is real, though. WordPress gives a non-technical owner a screen to click around in. A static site doesn’t. More on that near the end.

How I used Claude Code, and what the repo shows

I built the site with Claude Code. That part is mine to state. The repo backs up a few things:

  • The git history has 13 commits between 2026-10-10 and 2026-10-15. Seven carry a Co-Authored-By line naming a Claude model.
  • There’s no CLAUDE.md or AGENTS.md. The README and two docs files (a design brief and a site audit) told the AI what to build. If you want to set up instructions properly, I wrote about AGENTS.md best practices, and the Claude Code Projects guide covers running bigger jobs.
  • The README says how to run, check and deploy the site, so a fresh Claude session (or a person) can pick the project up cold.

Start with a brief

The design brief is about 1,100 words. It covers the client, the audience, the one goal, the palette, the fonts, spacing, button sizes and how to recreate the logo as text. The audit file is about 670 words and lists the old site’s pages, its brand colors and its SEO problems.

A brief makes the output checkable. You can open a page and ask whether the buttons are pill shaped and at least 44 pixels tall, because the brief said so. Without one you’re arguing about taste.

Some images are AI-generated

Several images on the site are AI-generated, and the repo documents it. The package cards (newborn, baby, toddler, preschooler) are generated. So are the portraits of Jenna, which were made from her supplied photos. The credits file says she approved their use and plans to swap in real photos when they’re available. The prompts are saved in the repo too.

The credits file also explains why. The old site’s stock-looking photos had unknown licenses, and some looked like another consultant’s brand photography. Those were downloaded for reference and left out. Generated images sidestep the licensing question but raise another: are you comfortable showing synthetic photos of a real person and her kid? Here the person approved. Check the same for yours. The file also notes the safe sleep details were checked (babies on their backs in bare cribs). That matters for a sleep business, and an AI can get it wrong without anyone noticing.

Project structure

The README’s layout is simple:

src/pages/        one file per page
src/partials/     header, footer, call to action band
src/data/         site settings, packages, FAQs, reviews (JSON)
src/css, src/js   one stylesheet, one small script
build.mjs         the generator
scripts/          image, font, review and QA helpers
functions/        Cloudflare Pages Functions

Each page is a small front matter block plus HTML. The header, footer and call to action live in shared partials, so they can’t drift apart between pages. Change the footer once and every page gets it.

build.mjs does the rest. It assembles the pages and writes the files people forget: the sitemap, robots.txt, a _redirects file, a _headers file with security headers and a Content Security Policy, and the JSON-LD structured data for each page. It runs about 590 lines with no framework. That’s a choice. A framework like Astro (this blog uses one) would’ve been fine too. But one script is easy to read in a single sitting, which helps when the AI is editing it.

The dev loop is short. npm run dev builds and previews locally. npm run check builds, then runs the checks.

The checks that make AI code easier to trust

I’d copy this part first. An AI can produce a lot of HTML quickly, so you want a machine to tell you when something’s off.

npm run check runs the build, then a custom script, then an HTML validator. The script reads the built pages and flags:

  • broken internal links, images and #anchors
  • leftover template tags
  • anything other than exactly one <h1> per page
  • images with missing or empty alt text, alt text over 125 characters, or no width and height
  • page titles over 65 characters and descriptions outside 70 to 160
  • a missing canonical tag or JSON-LD block
  • header or footer markup that differs between pages

Then html-validate checks that the HTML itself is valid. GitHub runs the same command on every push, so a broken page can’t deploy by accident.

A passing check means no broken links and valid markup. It doesn’t tell you the alt text is good, the copy persuades or the page works for everyone. Someone still has to open the site on a phone and read it.

Hosting on Cloudflare Pages: what’s free

Pages is where the built dist folder goes. I checked Cloudflare’s Pages limits page and its Pages Functions pricing page today. On the Free plan you get:

  • 500 builds per month and one build at a time
  • 100 custom domains per project
  • 20,000 files per site, and 25 MiB per file
  • up to 100 Pages projects per account
  • a _redirects file with 2,000 static and 100 dynamic redirects, and 100 rules in _headers
  • free, unlimited requests for static assets

The limits page doesn’t list a bandwidth cap, and I’m not going to invent one. If it matters to you, ask Cloudflare or read their current terms.

There’s one wrinkle. Requests that run a Pages Function are billed as Workers requests, and on the free plan they count against the Workers Free quota. Workers limits put that at 100,000 requests per day for a free account. A contact form on a small business site won’t come close. Video served through a Function is another story, and I’ll get to it.

What isn’t free

The domain name isn’t. Cloudflare Pages doesn’t hand you phanofsleep.com, so you pay a registrar for that.

Booking isn’t either. The discovery call scheduler, the package sign up forms and the client portal come from Dubsado, embedded in iframes, on its own plan.

Email has limits too. The contact form emails Jenna through Resend. I opened Resend’s pricing page today, and it shows a free plan with 3,000 emails per month and a 100 per day limit. That page could change.

And then there’s your time, plus Claude. Claude Code needs a Claude subscription or an Anthropic Console account, per the Claude Code docs.

I’m leaving dollar amounts out. I haven’t verified current prices for the paid pieces, and the repo doesn’t contain any.

CI/CD with GitHub Actions and preview deployments

I used Direct Upload instead of Cloudflare’s Git integration. In Cloudflare’s Direct Upload docs, you build locally or in CI and upload the output folder with Wrangler. One catch from those docs: you can’t switch a Direct Upload project to Git integration later. You’d make a new project, so decide before you start.

The repo’s workflow file is about 80 lines and follows Cloudflare’s guide for deploying Pages from GitHub Actions. On every push to main, every pull request and every manual run, it:

  1. checks out the code and installs dependencies
  2. runs npm run check
  3. looks for Cloudflare credentials, and if they’re missing it stops after the checks instead of failing
  4. deploys the dist folder with Cloudflare’s wrangler-action
  5. on a pull request, posts the preview link as a comment

A push to main becomes a production deployment. Anything else becomes a preview. The README says previews live at <branch>.<project>.pages.dev. Cloudflare’s preview deployment docs call that a branch alias, built from the branch name, lowercased, with non-alphanumeric characters turned into hyphens. It isn’t a pr-123 style address. Those docs don’t cover Direct Upload projects specifically, so check a real preview yourself. Previews are public by default, and you can add access protection through Cloudflare Access in the project settings.

The workflow also has a guard against indexing, which I cover in the going live section. For background, GitHub Actions is YAML workflows in your repo that run on events like a push.

The repo also has a Dependabot config. It opens update pull requests weekly for npm packages and monthly for Actions versions.

Pages Functions: the form and the video

Most of the site is static, but two things need a little server code, and Pages Functions handles both. Cloudflare’s routing docs explain that your functions folder structure becomes your routes.

The contact form and guide sign up go through functions/api/contact.js and guide.js. They receive a form post, email the details to Jenna through Resend, and redirect to a thank you page. The guide form fails open, so the PDF download still works if the notification email fails. The secret key lives in Cloudflare’s secret store and never in the repo. Keep it that way, and never paste API keys into a prompt or a file you’ll commit.

The video is the other one. The site has a self-hosted intro video, and the git log says it was changed to support byte ranges (a 206 response) after the first version. The function’s own comment gives the reason: the static asset serving it hit ignored the Range header, and Safari on iOS won’t play an mp4 without a 206 response. So a small function at functions/assets/video answers range requests itself.

There’s a limit visible in the code. The function reads the whole file into memory and slices it. That’s fine for a short clip. For anything big, or lots of viewers, I’d put video somewhere built for it. Each video request also invokes a Function, so it counts toward that free quota.

Redirecting the old WordPress URLs

If you replace an existing site, old URLs matter. The generator writes a _redirects file that sends the old WordPress pages, feeds and sitemap URLs to their new homes with 301s. The README says these were verified against the old site’s own sitemaps. I haven’t re-run that check myself, so I’m reporting the claim, not confirming it.

The trailing slash bug

This one’s in the git log. The second commit fixes old URL redirects on Cloudflare Pages, specifically trailing slashes and the package pages. WordPress used a trailing slash. The generator now writes two lines for each old URL, one with the slash and one without, because Pages matches the exact path (a code comment says so). A single rule would silently miss half the traffic.

The old package URLs go somewhere with a #fragment, such as the baby package section. The repo handles those with tiny Functions that return a 301, with a comment saying the _redirects file can’t carry a fragment. Cloudflare’s redirects docs say fragments in the source aren’t evaluated but a destination can include one, so a simple redirect line may well have worked. The Functions do work, but try the simpler route first if you’re doing this yourself. The docs also say _redirects rules don’t apply to requests a Function handles.

Testing redirects

Don’t trust the file. Test it after deploy:

curl -sI https://your-site.example/old-page/ | head -n 5

Look for a 301 status and the right location header. Check the old URL with and without the trailing slash. Then check the sitemap redirects, since Google will try those URLs first.

Going live: the preview guard and DNS

The repo’s README spells out two lessons here.

First, keep search engines out until you’re ready. While the site lives on pages.dev, the build runs in preview mode. Every page gets noindex, robots.txt disallows everything, there’s no sitemap and a noindex header goes out. Only the main branch can become indexable, and only when two repo variables are set. The audit commit on 2026-10-12 added this guard. Cloudflare’s docs say preview deployments already carry a noindex header, but a production deployment on pages.dev isn’t a preview, so an explicit guard is worth having.

Second, leave alone the DNS records that aren’t yours to change. The domain’s DNS was already on Cloudflare. The README tells whoever goes live to leave the mail routing records, the email authentication records and the booking subdomain alone. Only the root and www records that pointed to WordPress get replaced. Break the mail records and her email stops. Break the booking subdomain and the booking page breaks. I won’t repeat the actual record values here, and you shouldn’t publish yours either.

The README’s go live order is:

  1. Add the custom domain in the Pages project. When the zone is on Cloudflare, it swaps the two DNS records for you. See Cloudflare’s custom domains docs, which also warn that adding a CNAME by hand without registering the domain in Pages gives visitors a 522 error.
  2. Set the site URL and indexable variables in GitHub, then re-run the workflow on main.
  3. Redirect www to the root domain, so Google sees one site.
  4. Verify the sending domain with your email provider.
  5. Submit the sitemap in Google Search Console.
  6. Smoke test the real domain.

Where things stand: the README’s “Before launch” checklist still has unchecked items, including prices, analytics and the privacy policy review. So this post is a build log, and the site hasn’t had its launch announcement.

The Bot Fight Mode snag

After the site was on Cloudflare, a third-party SEO checker couldn’t read it. Cloudflare’s Bot Fight Mode was challenging the checker, and the checker saw a 403. I turned Bot Fight Mode off for that site and the checker passed. I wrote that up separately, including how to confirm it in Security Events: Cloudflare Bot Fight Mode and SEO. If AI crawlers are your concern, Cloudflare AI Labyrinth explained covers a different feature.

What to check before launch

This list comes from this project, and it isn’t complete.

  • Run npm run check and read what it says, not just whether it passed.
  • Open every page on a phone. A mobile horizontal scroll bug in the reviews row shipped in the early commits and had to be fixed.
  • Click every booking and form path, and submit a real test message.
  • Test the old URLs, with and without trailing slashes.
  • Look at the response headers on production. You want no noindex on the live domain and a noindex on previews.
  • Confirm email still arrives.
  • Read the privacy page against what the site really does. The README itself says it isn’t legal advice.

How to build this yourself

Here’s the short version, matched to the README and the Cloudflare docs I linked.

  1. Write the brief. Goal of the site, audience, pages, palette, fonts, voice. Add an audit of any old site you’re replacing.
  2. Create a GitHub repo and open it in Claude Code. Ask for a static generator with pages, shared partials and a build script that writes the sitemap, robots, redirects and headers. Ask for a check script too, and read what it writes.
  3. Build locally. Run the build, preview it, fix what looks wrong.
  4. Create the Pages project as a Direct Upload project. The repo’s README uses npx wrangler pages project create <name> --production-branch main.
  5. Make a scoped API token in Cloudflare with Account, Cloudflare Pages, Edit permission and nothing more. Find your account ID in the dashboard.
  6. Add both as GitHub secrets, never in the code. The workflow needs two, CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID.
  7. Add the workflow that builds, runs your checks, then deploys. Open a pull request first to see the preview comment.
  8. Push to main and check the production deployment on pages.dev. Keep it noindex.
  9. Add the custom domain after reading the DNS section above, and only then allow indexing.

On prompts, ask Claude for small pieces and a check for each one. It’s the same habit I describe in How to Ship Small AI Projects.

Limits of this approach

  • No editing screen. Changing a price or a paragraph means editing a text file and pushing. Jenna won’t do that on her own without setup. A Git based CMS could fix it, but that’s more to configure and maintain, and I haven’t set one up.
  • Someone has to maintain it. The README expects whoever runs it to know Node and Git. Dependabot opens the update pull requests, but a person merges them.
  • AI written code needs review. The red team commit on 2026-10-15 fixed small things a review caught: photo alignment beside open forms, an ugly line break in “15 minute”, a missing visible placeholder in a form. None were dramatic, but nobody sees them until they look.
  • Vendor lock in is mild but real. The output is plain HTML, so it moves anywhere. The Pages Functions, the _headers and _redirects files and the Direct Upload project don’t.
  • Third-party embeds carry the weight. The booking system, the email sender and the review data all live outside this repo. If one changes, the site still builds but a feature may break.

FAQ

Can you really host a business website on Cloudflare for free?

Mostly, yes. As checked on 2026-10-21, Cloudflare Pages on the Free plan includes 500 builds per month, 20,000 files per site, 25 MiB per file and free, unlimited requests for static assets. The domain name, the booking system (Dubsado) and the email sender (Resend) aren’t free, and Claude Code needs a Claude subscription or an Anthropic Console account. Cloudflare changes its limits, so read the linked pages before you rely on a number.

How do I get started building a site like this with Claude Code?

Write a short brief first: the goal, audience, pages, palette, fonts and voice. Then create a GitHub repo, open it in Claude Code and ask for a static generator with a check script. Create a Direct Upload Pages project, save a scoped Cloudflare API token and your account ID as GitHub secrets, and add a workflow that builds, checks and deploys. Push to main, confirm the site on pages.dev with noindex on, and add the custom domain last.

Can a non-technical owner edit the site?

Not without setup. There’s no admin screen, so changing a price or a paragraph means editing a text file and pushing it. The README expects whoever runs the site to know Node and Git. A Git based CMS could fix that, but it’s more to configure and maintain, and I haven’t set one up.

What are the risks of letting AI write the code for a business site?

The code needs human review. The check script catches things like broken links, missing alt text and invalid HTML, but a passing check doesn’t tell you the alt text is good, the copy persuades or the page works for everyone. A review pass on this project still found small problems, such as photo alignment beside open forms and a missing visible placeholder in a form. Some images here are AI-generated, so confirm anyone shown in them approves, and check details like safe sleep guidance yourself.

What happens to the old WordPress URLs?

They need redirects, and you should test them. The generator writes a _redirects file that sends old WordPress pages, feeds and sitemap URLs to their new homes with 301s. It writes two lines per old URL, with and without the trailing slash, because Pages matches the exact path. The README says these were verified against the old site’s sitemaps, and I haven’t re-run that check myself. After deploy, run curl -sI on the old URLs and look for a 301 and the right location header.

Can Bot Fight Mode block an SEO checker?

It did here. After the site moved to Cloudflare, a third party SEO checker saw a 403 because Bot Fight Mode was challenging it. I turned Bot Fight Mode off for that site and the checker passed. Confirm the cause in Security Events before you change anything.

Where to go next

Start with Cloudflare Bot Fight Mode: Does It Hurt SEO and AI Crawlers? before you point an SEO tool at your new site. To give Claude standing instructions, read AGENTS.md best practices, then run bigger builds with the Claude Code Projects guide. For current limits and install steps, the Cloudflare Pages docs and the Claude Code overview are the places to look.

  • #claude-code
  • #cloudflare-pages
  • #static-site
  • #small-business