Back to Blog

Build your own website with AI: Lovable, Astro, and Cloudflare

From a Lovable design to your own domain on Cloudflare. Build an Astro website and maintain it with Claude Code or Codex: update services, add articles, and publish reviewed changes.

Sebastian Tekieli

Chief AI Agents Officer and software engineer

LinkedIn
ProductWeb development16 min read

You can design a business website in Lovable, refine it with Claude Code or Codex, and publish it on Cloudflare under your own domain. Later, the same AI agent can help update your services, add an article, improve a form, or prepare a second language.

This guide takes you from the first design to publication and ongoing updates. You keep the code in your own repository on GitHub, GitLab, or Bitbucket, work on it locally, and publish reviewed changes through automatic deployment. The workflow below uses GitHub, which Lovable integrates with directly; choosing another provider requires adapting the code export and deployment automation.

The workflow: Lovable → GitHub → Claude Code or Codex → Astro → Cloudflare → your own domain.

This setup suits a brochure site, portfolio, landing page, local business website, or blog. If you need a store, customer accounts, or bookings for available appointments, plan for an additional service to handle those features. Here, we build a website that shows content prepared in advance: text, photos, and your offer. When you change something, you publish a new version.

1. Prepare your materials and accounts

Before opening the generator, collect a few things:

  • your offer, audience, and the website’s goal, such as a call or enquiry;
  • copy, photos, a logo, and contact details;
  • a page list, such as home, services, about, blog, and contact;
  • the features you need: forms, a map, languages, and analytics;
  • Lovable, GitHub, and Cloudflare accounts, plus access to Claude Code or Codex;
  • your own domain or a name you want to register.

For local work, you need a computer, Git, and a Node.js environment. You do not have to write every component yourself, but you need to open the project folder, run a supplied command, and check the result in a browser. The agent can explain those steps as you go.

A clear offer saves more time than another button color change. First write down what you do, who you help, and what visitors should do next.

2. Create the design in Lovable

I recommend Lovable for the visual stage: section layout, typography, colors, and the mobile version. You can see a proposal and refine it immediately, without having to describe every spacing decision in advance.

Lovable offers a Free plan with 5 daily build credits, capped at 30 per month. More iterations may require a paid plan.

Start with this prompt, adding your own materials:

Design a responsive website for a local service business.
Audience: [who]. Offer: [what]. Location: [where].
Primary goal: a phone call or a consultation enquiry.
Sections: services, about, real reviews, questions, contact.
Create these pages: [list].
Use the supplied copy, photos, and colors.
Make the site readable on phones, with contrast and keyboard access.
Add subtle animations that respect prefers-reduced-motion.
For now, build the form interface without sending any data.
Do not add login, a database, or invented testimonials.

Check a phone, tablet, and desktop layout. Improve the headline, offer, and contact button before spending credits on decoration. You can also finish the whole design on a paid Lovable plan. The next steps provide a way to take control of its code and hosting.

What Lovable generates

According to the current Lovable FAQ, new projects created from 13 May 2026 use TanStack Start, while older projects use React and Vite. Enterprise workspaces had a later transition date. Astro is not a framework option inside the editor.

Treat the Lovable project as your starting point: layout, components, and styles. In the next stage, the agent rebuilds it in Astro while preserving the design. This is not a one-click Astro export.

3. Connect Lovable to GitHub

The github.com integration is available on the Free plan too. You need your own GitHub account. In Lovable:

  1. Open Project settings → Git → GitHub.
  2. Select Add connection, then Add account.
  3. In GitHub, choose the account or organization and the Lovable app’s repository access.
  4. Approve installation and authorization.
  5. Return to the project settings and select Connect beside your account.

Lovable creates a new repository, private by default. Check that it contains your project files. GitHub integration instructions.

Sync works in both directions. After migrating to Astro, use the local repository as your main place of work; further generation inside Lovable may conflict with the framework migration. You can end synchronization after making a copy. The connection model is explained in the Git sync documentation.

A code copy does not automatically move the database, users, or secrets from Lovable Cloud or Supabase. Plan how to keep those services working if your draft uses them. A local copy may still connect to the production database.

4. Download the code and open it with an AI agent

Install Git and the Node.js version required by the project. On GitHub, copy the repository URL from Code. Run these commands in your terminal, replacing the example URL with your own:

git clone https://github.com/YOUR-ACCOUNT/YOUR-SITE.git
cd YOUR-SITE
git switch -c feat/astro-website

Install your chosen tool using the Claude Code or Codex CLI instructions. Run claude or codex in the project directory and sign in. In a desktop app or editor extension, open that same directory.

The agent needs to work with the actual project files. First ask it to inspect package.json, the lockfile, and configuration, then install dependencies with the project’s package manager. Do not mix npm, Bun, and pnpm in the same project. Also ask it to start a local preview and provide the address to open in your browser.

Here is a prompt to prepare the Astro website:

Analyze this project exported from Lovable.
Migrate the website to Astro while preserving design, copy, and URLs.
Start by listing routes, integrations, and interactive components.
Generate service pages and articles statically at build time.
Keep Tailwind. Use React only where needed.
Add client:* only to components that require interaction.
Create an Astro content collection for Markdown articles.
Require a title, description, date, and author.
Set readable page URLs and internal links.
Separate form processing from the static website.
Run a build and check every route and the mobile layout.
Show the changes and decisions that need review before publication.

Astro prepares finished pages before publication. When someone opens your services page, the hosting service sends it to their browser without assembling it again for each visit. That is what “static website” means. It can have animations, dropdown menus, and forms; “static” describes how the content is prepared, not how the website looks.

Technically, these finished pages are HTML and CSS files, which the browser reads to display the content and design. Astro can add JavaScript only to elements that need it, such as a calculator. It calls these interactive parts islands.

Preparing the finished version of a project is called a build. In this guide, that is when service pages and articles are created. Astro can also prepare content when someone visits, but that approach needs a different hosting configuration.

Ask the agent to organize the content. For example: pages in src/pages, articles in src/content/blog, and images in public/images. This is a suggested structure for this website. An article collection with a schema helps catch missing data during the build. See the Astro content collections documentation.

5. Refine contact features, design, and discoverability

You can change fonts and add animations, maps, and forms without installing a plugin for each feature. Every addition should still solve a specific customer problem.

Consider loading the map after interaction while keeping the address and directions link available as text. Resize photos appropriately. Avoid downloading a background video on a phone if a still image works. Animations should not block content or ignore reduced motion preferences.

Contact forms with Resend

I recommend Resend for sending emails from your contact form. Its Free plan includes 3,000 emails per month, with a daily limit of 100, at no cost. For more enquiries, Pro offers 50,000 emails for USD 20 per month, with no daily limit.

The form passes the enquiry to a small program running on Cloudflare, which asks Resend to email it to you. The customer fills in the form on your website, and you receive the enquiry in your inbox. Claude Code or Codex can prepare this Cloudflare Workers integration.

Create a Resend account, add and verify your domain, then generate an access key for sending emails, called an API key. The agent can guide you through the setup. You can give it this prompt:

Connect the contact form to Resend through a Cloudflare Worker.
Send enquiries to my address: [email address].
Use a sender address on my verified domain.
Store the Resend key as a Cloudflare secret, outside the website code.
Validate the submitted details and add spam protection.
Show the customer a confirmation or a clear error message.
Prepare a preview and instructions for checking email delivery.

Before publishing, submit a test enquiry and check that it reaches your inbox. Also check what the customer sees if sending fails. Resend counts emails: if one enquiry sends an email to you and a separate confirmation to the customer, it uses two emails.

SEO and discoverability

Ask the agent for a specific review:

Review SEO and accessibility across all public pages.
Prepare unique titles and descriptions, and correct canonical URLs.
Add sitemap.xml, robots.txt, Open Graph, and a real 404 page.
Check headings, image descriptions, form labels, and keyboard access.
For two languages, add reciprocal hreflang links.
Match structured data to the real business and visible content.
Check internal links and page URLs.
Identify oversized images, fonts, and unnecessary JavaScript.
Do not invent ratings, testimonials, or business details.

SEO helps search engines discover and understand your content. AEO, or Answer Engine Optimization, and GEO, or Generative Engine Optimization, refer to visibility in answers and generative systems. In practice, I would start with a clear offer, author information, location, examples, and answers to customer questions.

Google says its AI features use the foundations of SEO and do not require a special llms.txt file or separate “GEO schema.” Adding one file does not promise citations from AI. Google’s guidance on generative features.

What about Lighthouse scores?

After publishing, run PageSpeed Insights on the homepage and several other pages. Use its performance, accessibility, best practices, and SEO scores to identify improvements to that version of the website.

Astro helps reduce JavaScript, but a heavy image, map, or external widget can still lower the score. Test multiple pages on mobile. Four perfect scores do not establish complete accessibility or high Google rankings.

6. Prepare a static build for Cloudflare

This example assumes the agent has prepared a static Astro project without a server adapter, and npm run build produces the dist directory. If the project uses Bun or pnpm, use the corresponding commands from its configuration.

Add Wrangler as a development dependency:

npm install --save-dev wrangler
npm run build

Create wrangler.jsonc in the project root:

{
  "$schema": "node_modules/wrangler/config-schema.json",
  "name": "my-website",
  "compatibility_date": "2026-10-21",
  "assets": {
    "directory": "./dist"
  }
}

Replace the example name with your project name and use the current date when creating the configuration. This publishes files; it does not include a form backend. Check that dist contains the page HTML. On-demand rendering requires a different configuration and an adapter. Both are covered in the Astro deployment guide for Cloudflare.

Review the changed files. Check that .gitignore excludes secrets, node_modules, and build output. Commit the reviewed changes:

git diff
git add .
git commit -m "Build website with Astro"
git push -u origin feat/astro-website

On GitHub, use Compare & pull request to open a PR from feat/astro-website to main. Review the changes and build result, then merge the accepted version. You will configure the first Cloudflare preview in the next step. For subsequent changes, check the preview before merging.

7. Connect Cloudflare Workers to the repository

In the Cloudflare dashboard:

  1. Open Workers & Pages and create an application.
  2. Choose GitHub, authorize access, and select the repository.
  3. Match the Worker name to name in wrangler.jsonc.
  4. Set the build command to npm run build and deployment command to npx wrangler deploy.
  5. Save the configuration and run the first deployment.

Check the site at its assigned workers.dev address. For an existing Worker, connect the repository in its build settings. Workers Builds instructions.

In branch settings, choose main or master as your production branch. A push to that branch, including a merged pull request, updates production. Opening a PR alone does not publish changes on your domain. Enable previews for other branches. Build and preview branch behavior.

Your ongoing workflow becomes: local change → verification → push → PR preview → merge → automatic deployment.

8. Connect your domain

The domain can stay with its current registrar. Move DNS management to Cloudflare:

  1. Add the domain to Cloudflare and select the Free plan.
  2. Check imported records, especially mail-related MX and TXT records.
  3. If DNSSEC is enabled, follow its migration procedure before changing nameservers.
  4. At the registrar, set the two nameservers assigned by Cloudflare.
  5. Wait for the zone to activate; configure DNSSEC again after migration.

See the DNS setup instructions. Moving website hosting does not require changing your email provider.

Once the preview works, open the Worker’s Settings → Domains & Routes → Add → Custom Domain and enter the hostname. Cloudflare configures the connection and certificate. An existing CNAME for that hostname may need removal during the switch. Configure the redirect between www and the root domain separately. Custom domain instructions.

After connecting the domain, check HTTPS, page routes, the sitemap, and the form. Submit the sitemap to Search Console. Open the site on a phone and perform the same task as a customer: find the offer and send an enquiry.

9. Maintain the website with Claude Code or Codex

After launch, you do not need to return to the generator for every copy change. Open the repository with your agent and describe a specific result: a new price, another article, a different photo, or an improved phone layout.

Write down the project rules

Codex uses an AGENTS.md file. For Claude Code, you can use CLAUDE.md. If you use both tools, keep shared rules in AGENTS.md and import them from CLAUDE.md with @AGENTS.md. See the Codex instruction guide and Claude Code project memory documentation.

Ask the agent to prepare these files to match the actual project structure. Here is an example of what the instructions can cover:

This is an Astro business website. Keep content statically generated.
Articles are in src/content/blog and images are in public/images.
Use the package manager and commands recorded in package.json.
Check Git status first and preserve unrelated changes.
Work on a separate branch. Avoid unnecessary URL changes.
Keep the website's style. Do not invent reviews or business details.
Run the build and relevant checks after making a change.
Provide a preview URL and explain what I need to check.
Do not merge the PR or publish without my approval.

These are working instructions, not a technical restriction. To enforce review, configure protection for the production branch on GitHub. Set the agent’s own permissions in its tool.

Change one thing at a time

Sync your local copy before starting another task. If you have uncommitted changes, first ask the agent to help organize them. For a project with main as its production branch, a new change can start like this:

git switch main
git pull --ff-only
git switch -c content/update-offer

Then describe the change with concrete information:

Change the consultation price to PLN 250 everywhere on the website.
Keep the rest of the offer and layout unchanged.
Check page copy, FAQs, and structured data.
Run the build and list the changed files.
Provide a preview for review without publishing.

You can ask for a new article in the same way:

Add the attached article to the existing blog collection.
Keep the template, author, date, and style of other posts.
Use the supplied image and prepare its alternative description.
Add an SEO description and a link from the relevant service page.
Check the article, blog listing, and sitemap after building.
Prepare a preview for approval.

Other tasks include translating a selected page into English with language links, improving the mobile menu, or adding a form field. For a form change, ask the agent to check the entire journey from submission to receiving the message.

Review the preview and publish the update

Check the content and changed feature on desktop and mobile. A successful build confirms that the project can be built; it cannot judge whether your price or offer is correct.

Ask the agent to commit the accepted changes, push the branch, and prepare a PR. Open the Cloudflare preview. Once approved, merge the PR into main to trigger the deployment configured earlier. Check the changed page on your domain too.

If an update turns out to be wrong, ask the agent to undo the specific commit with git revert on a new branch. Review the preview and publish the correction through the same process. Both changes remain in the history. Reverting code does not recall sent messages or reverse changes in external services.

Review dependencies and website behavior regularly

Schedule periodic checks of Astro, Wrangler, and other dependencies. The agent can prepare updates in a separate PR, run checks, and show you the result. Address urgent security fixes as they arise.

Test the contact form regularly, keep track of domain renewal, and review Search Console notices. AI reduces the work involved; you still decide whether the content is correct and the website serves its purpose.

What it costs and how long it takes

For a month of intensive building, I recommend a USD 100 AI plan. For later, smaller updates, I would start with a USD 20 monthly plan. Choose one tool: Claude Code or Codex. You do not need both subscriptions.

Subscription prices below use monthly billing without an annual commitment. Domain prices include Polish VAT. Amounts are rounded. Applicable taxes may be added to USD prices. For a simple comparison, I use an illustrative USD 1 = PLN 4: USD 100 is about PLN 400, and USD 20 is about PLN 80, before any applicable tax. Your final charge depends on the billing currency and payment terms.

ItemSpecific priceWhat it means in practice
A .pl domain at OVHcloudAbout PLN 21 including VAT for the first year, then about PLN 73 including VAT per renewal year.This is your website address. You can buy just the domain and host the website on Cloudflare.
Design in LovableFree: USD 0. The smallest Pro plan: USD 25/month, about PLN 100, for 100 monthly credits.Free provides 5 daily credits, capped at 30 per month. Pro allows more design revisions. Credit use depends on the task.
AI agent for the building month: Claude or CodexUSD 100/month, about PLN 400: Claude Max 5x or the USD 100 ChatGPT Pro tier.My choice for intensive work on layout, content, and features. Spending this amount is not a requirement for launching a simple website.
AI agent for later updatesUSD 20/month, about PLN 80: Claude Pro or ChatGPT Plus with Codex.I would start here for price changes, photos, and new articles. Larger additions may need a higher allowance.
Serving finished pages, images, and styles on CloudflareUSD 0, with no limit on requests to those files.Even a million requests for finished files do not increase this charge. This applies to direct asset serving without executing Worker code.
A Cloudflare Worker, such as the form handlerFree: USD 0, 100,000 invocations per day. Paid: from USD 5/month, about PLN 20.Free: up to 10 ms of processor time per invocation. Paid includes 10 million invocations and 30 million processor milliseconds per month.
Automatically preparing a new website version with Workers BuildsFree: USD 0 for 3,000 minutes/month. Workers Paid: 6,000 minutes, then the equivalent of USD 5 per 1,000 extra minutes.At 2 minutes per run, that is 1,500 builds per month. At 5 minutes: 600.
Contact form emails with ResendFree: USD 0, 3,000 emails/month, up to 100 per day. Pro: USD 20/month, about PLN 80, for 50,000 emails with no daily limit.At two emails per enquiry, Free covers 1,500 enquiries/month, up to 50 per day. Pro: 25,000 enquiries/month.

Workers Paid for form processing and builds refers to the same subscription starting at USD 5, not two separate charges. Cloudflare allowances are shared across the account.

Lovable offers larger credit packages and Business and Enterprise plans. For this workflow, I recommend Free or one month of the smallest Pro plan: prepare the design, download the code, and continue working locally. After that stage, you can stop paying for Lovable if you no longer use its paid services.

3,000 build minutes means 50 hours per month. Preparing a new version uses those minutes; reader visits do not. A preview and subsequent publication can trigger two builds. At 2 minutes each, the allowance covers 750 such pairs per month, about 25 per day. The 2- and 5-minute durations are calculation assumptions; check your actual duration in Cloudflare.

For heavy traffic, code execution has a concrete example too: 15 million Worker invocations per month averaging 7 ms of processor time each cost USD 8, about PLN 32. This Cloudflare pricing example includes the subscription and overages, excluding other services. Longer code execution increases the cost.

An example budget for launch and later updates

With Lovable Free, one month of an AI agent at USD 100, and a new .pl domain from the table, the starting cost is about PLN 420. Add one month of Lovable Pro and it becomes about PLN 520. These calculations assume PLN 4 per dollar, before any applicable taxes on USD services; the domain already includes VAT.

After building, you can move to USD 20 for a month of agent use, plus annual domain renewal. Hosting, builds, and form emails can remain free within the allowances above. The agent subscription pays for working on the website; cancelling it does not take your Cloudflare website offline.

If you already have a paid AI plan, use it first. Upgrade when the limits start getting in the way of your work.

You can budget 10-15 minutes for a first draft of a small website, especially with copy and images ready. Publication still needs content review, functioning forms, URL checks, DNS, and SEO. A larger website takes longer.

Once the website is live, use the same process for each update: describe the task to the agent, check the preview, and publish the accepted version. Content, design, and change history stay in your repository.

Want to discuss this topic?

Let us turn the idea into a practical architecture and implementation plan.

Book a Consultation