
You can build a complete, SEO-optimized local business website in under 15 minutes using Claude Code, Astro, and Cloudflare. The result scores 98% on PageSpeed Insights, has valid schema markup, and deploys to a live URL automatically. This is not a drag-and-drop builder. This is a framework-based approach that produces sites designed to rank.
Why Astro Is the Best Framework for SEO Websites
Astro is a web framework built specifically for content-driven websites that generates clean, crawlable HTML search engines love. It ships zero JavaScript by default, meaning pages load incredibly fast.
Here's why Astro stands out:
- Built for speed. Astro ships zero JavaScript by default, meaning your pages load incredibly fast.
- SEO powerhouse. The framework generates clean, crawlable HTML that search engines love.
- Content-first architecture. Every design decision in Astro prioritizes content delivery, which is exactly what Google rewards.
I've built websites on lovable.dev, bolt.ai, and plenty of other AI builders. This approach with Astro and Claude Code is 100 times better. Trust me.
The reason? When you give Claude Code a proper framework like Astro as the foundation, it doesn't go off the rails and do its own thing. It follows the framework's conventions, which means you get consistent, high-quality output every time.
The Tech Stack: Claude Code + Astro + Cloudflare
Let me break down why each piece of this stack matters:
- Astro handles the framework layer. It's designed for speed and SEO, generating static HTML that loads in milliseconds.
- Claude Code does the heavy lifting. Whether you use Opus or Sonnet, both models are more than capable for building SEO websites. We're not doing rocket science here, we're doing SEO.
- Cloudflare handles hosting and deployment. It's free, it's fast, and Claude Code can push directly to Cloudflare Pages without you touching a dashboard.
The beauty of this setup is that Claude Code can build the site on your computer and publish it to Cloudflare automatically. The whole pipeline, from prompt to live website, happens in one terminal session.
The Project: Rebuilding a Page 2 Website
For this build, I took a real website called Texas Plumbing Solutions. It was sitting on page 2 of Google for "plumbers in Texas." The site looked outdated, had no service area pages, and was missing basic SEO elements.
Perfect candidate for a rebuild.
The problems with the original site were obvious:
- No location-specific service area pages
- Slow loading speed
- Missing structured data (schema markup)
- Outdated design with weak calls to action
- Generic copy that didn't target specific keywords
The Build Process: From Prompt to Live Site
Step 1: Set Up the Project
I created a new folder on my desktop, opened a terminal, and started Claude Code. That's it for setup. No installing packages manually, no configuring build tools, no boilerplate.
Step 2: Give Claude Code the Prompt
The prompt is the key to this whole process. I gave Claude Code:
- The URL of the existing Texas Plumbing Solutions website
- Instructions to rebuild it using the Astro framework
- A link to the Astro documentation
- Specific instructions on how I wanted the site built (service pages, location pages, schema markup, etc.)
Claude Code started by analyzing the existing site to understand the content and context. Then it created a multi-phase build plan:
- Phase 1: Scaffold the Astro project
- Phase 2: Create all configuration files
- Phase 3: Build the layout and core components
- Phase 4: Generate all page templates and blog content
- Phase 5: Create and optimize images
Step 3: Watch It Build (and Approve a Few Things)
Claude Code worked through each phase autonomously. The impressive part is that even 15 minutes into the build, it still had full context of the project and was executing its plan step by step.
One particularly clever thing it did: it generated images using Nano Banana Pro (Google's image generation model), then automatically ran a Python script to convert all PNGs to WebP format. WebP files are significantly smaller without losing image quality, which is perfect for page speed and SEO.
Step 4: Review the Site Locally
Once the build finished, Claude Code suggested running npm run dev to preview the site locally. Here's what the rebuilt site included:
- Professional homepage with a clear value proposition
- Service area pages for each location with location-specific content
- Service-location combination pages (e.g., "Leak Repair in Belleville, Texas")
- Strong calls to action with click-to-call functionality
- FAQ sections on every page
- Subtle animations for a polished, professional feel
Compared to the original site, this was night and day. More pages, better content, stronger SEO foundations, and a design that actually looked professional.
Step 5: Iterate and Improve
Building a website with Claude Code isn't a one-shot deal. You can keep refining it in the same conversation. I asked it to:
- Add a review strip above the "Areas We Service" section on the homepage
- Add a "How We Work" section below the plumbing services, complete with a step-by-step guide and interactive sliding banner
Each change took just a couple of minutes. The key is that Claude Code maintains full context of the project, so every modification fits seamlessly into the existing site architecture.
Step 6: Deploy to Cloudflare
With one simple prompt, Claude Code:
- Authenticated with Cloudflare
- Created the project
- Built and deployed the site
- Returned a live staging URL on pages.dev
The entire deployment took seconds. The site was live and shareable immediately.
The SEO Results: 98% PageSpeed Score
Here's where it gets exciting. I ran the live site through three different tests:
PageSpeed Insights
- Desktop: 98% (blazingly fast)
- Mobile: Could use some minor fixes, but still loading extremely quickly
GTmetrix
- Top-tier performance scores across the board
- Fast loading times thanks to Astro's static HTML output and WebP images
Schema Validation
- Local Business schema: Valid
- Service schema: Valid
- Breadcrumb schema: Valid
- FAQ schema: Valid
- Only minor non-critical issues detected
Proper schema markup doesn't just help with traditional Google rankings. It also helps your site appear correctly in AI search engines, which is becoming increasingly important.
Why This Beats Every AI Website Builder (And Why It's Safer)
The difference between this approach and tools like Bolt or Lovable comes down to two things: the foundation and the security.
Speed and convenience mean nothing if the site you build is leaking your client's data. And that's exactly what's been happening with popular AI website builders.
The Lovable Security Disaster
In March 2025, security researcher Matt Palmer discovered a critical vulnerability in Lovable (now tracked as CVE-2025-48757). The issue? Lovable apps were being deployed with missing or misconfigured Row-Level Security (RLS) policies on their databases. That means anyone could read or write to the database of a live Lovable app without any authentication at all.
How bad was it? Researchers scanned 1,645 Lovable projects and found 170+ apps with 303 vulnerable endpoints, roughly 10% of everything on Lovable's showcase platform. The exposed data included full names, email addresses, home addresses, personal debt amounts, financial transactions, Google Maps API tokens, Gemini API keys, and eBay authentication tokens.
A Palantir engineer independently found the same flaw and publicly demonstrated it by extracting real user data from live apps. Lovable's fix? A security scan feature that checks whether an RLS policy exists on a table, but doesn't actually test whether the policy works. After a 45-day disclosure window passed with no meaningful fix, Palmer published the full CVE.
On top of the database vulnerability, Guardio Labs found that Lovable scored just 1.8 out of 10 on phishing resistance. Attackers could create convincing phishing pages and host them directly on Lovable subdomains.
The Broader "Vibe Coding" Security Crisis
Lovable isn't an isolated case. Research from Escape.tech analyzed over 5,600 apps built with AI builders (including Lovable, Bolt, and Base44) and found over 2,000 vulnerabilities, 400+ exposed secrets, and 175 instances of leaked personal data including medical records, bank account numbers, and phone numbers.
According to Bright Security's analysis, 45% of apps built with these platforms still contain classic OWASP Top-10 vulnerabilities. One in five sites built on popular AI builders are leaking code secrets like API keys bundled into the client-side code.
And it's not just theoretical. The startup Enrichlead, whose founder publicly claimed 100% of the platform was written by AI with "zero hand-written code," was found to be full of basic security flaws just days after launch. Anyone could access paid features or alter data.
Why the Claude Code + Astro Approach Is Different
When you build with Claude Code and Astro, you avoid these problems entirely:
- Static HTML output. Astro generates plain HTML files. There's no exposed database, no client-side API calls to intercept, no RLS policies to misconfigure. Your site is just files on a CDN.
- No secrets in the client. Because Astro builds static pages at compile time, there are no API keys, database credentials, or tokens shipped to the browser.
- Clean, semantic HTML that search engines can easily parse.
- Zero unnecessary JavaScript bloating your page load times.
- Proper site architecture with service pages, location pages, and internal linking.
- Structured data that's actually valid and complete.
- Full code ownership. The code lives on your machine and deploys to your Cloudflare account. You control every file. No third-party platform sitting between you and your website.
This isn't just faster and better for SEO. It's fundamentally more secure. You're not trusting a platform to handle security for you (and hoping they get it right). You're building on a stack where the architecture itself eliminates entire categories of vulnerabilities.
What You Need to Get Started
Here's the full list of what you need:
- Claude Code (with a Claude Pro or API subscription)
- A Cloudflare account (free tier works perfectly)
- A terminal (Mac Terminal, Windows PowerShell, or any command line)
- The prompt template (linked in the resources below)
That's it. No web development experience required. Claude Code handles the framework setup, the coding, the image optimization, and the deployment.
Taking It Further: The Local Business Builder Agent
If you want an even more streamlined version of this process, I've built a dedicated Claude Code plugin (available inside the AI Ranking community) that acts as a local business builder agent.
This agent can:
- Generate websites with 80 to 100+ pages in minutes
- Follow SEO best practices automatically
- Ask you interactive questions to customize the build
- Handle all the technical setup, configuration, and deployment
It comes with full installation guides and all the parameters pre-configured. If building SEO websites for local businesses is something you want to offer as a service (or use for your own sites), this is the fastest way to do it.
The Bottom Line
In under 15 minutes, using Claude Code, Astro, and Cloudflare, I built a website that:
- Scores 98% on Google PageSpeed Insights
- Has valid schema markup for local business, services, breadcrumbs, and FAQs
- Includes location-specific service pages that target real keywords
- Loads blazingly fast on both desktop and mobile
- Is deployed and live on Cloudflare Pages
- Looks significantly more professional than the original page 2 site it replaced
The original Texas Plumbing Solutions site was stuck on page 2 of Google. This rebuilt version has every technical SEO advantage it needs to climb to page 1.
If you're building websites for clients or for your own business, this is the stack to use. Stop fighting with drag-and-drop builders. Start building on a framework that was made to rank.
Want hands-on help building SEO websites with AI? Inside the AI Ranking community, we share the exact prompts, plugins, and workflows that are working right now. Join 470+ members at AI Ranking



.webp)

.webp)