The complete playbook for building a Google Lighthouseโoptimized, animated website from scratch using AI โ from keyword research to live deployment in one session.
Every tool in this stack is chosen because they integrate natively with GPT 5.6 Codex. The goal: never leave the GPT application to build, optimize, and deploy.
Follow the dedicated setup video (linked in original video description). This gives Codex access to real keyword data โ search volume, CPC, competition metrics.
In the GPT app โ Plugins โ search "Cloudflare" โ install the official Cloudflare plugin. Grant all required permissions so it can manage DNS, Pages, and deployments. Works with free Cloudflare tier.
Go to 21st.dev โ Setup โ CLI & MCP โ select Codex. Copy the full configuration prompt. Paste it into a new Codex conversation and run. This gives your AI direct access to browse and import UI components and scroll animations.
Add credits at fal.ai (pay-as-you-go, ~$8 covers a full project). Install as a plugin in the GPT app. All generated media is saved to your FAL dashboard for reuse.
GSAP and Astro are installed as project dependencies by Codex during the build. You just tell it to use them โ it handles the rest via npm.
This is the most important phase. A beautiful website that targets the wrong keywords is worthless. You need to extract every transactional keyword the business can claim.
Business owners describe their services in industry jargon, but customers search using completely different language.
In the GPT app, go to Projects โ click + โ name it after the business (e.g., "Dog Training Business"). This keeps all context, files, and conversations organized.
Place the 4 provided MD files into the project folder. Tell Codex: "Understand all these documents. Don't act on them. Save them in this folder for reference."
Open the "103 Copy-Paste Prompt" MD file. Either fill it out manually or ask GPT to help. This captures: services offered, service areas, target customers, unique selling points, and desired call-to-action.
After filling the brief, Codex will produce:
Codex will recommend a structure like:
/ โ Homepage
/services/ev-charger-installation/
/services/tesla-wall-connector/
/services/level-2-charger/
/areas/austin/
/areas/dallas/
/guides/ev-charger-cost-guide/
/guides/best-home-ev-chargers/
Each URL is driven by a real keyword cluster with search volume data backing it up.
With keyword research complete, Codex auto-generates the site architecture. Every page exists because there's a keyword cluster justifying it.
/services/ev-charger-installation/)/areas/austin/)/guides/ev-charger-cost-guide/)You don't design every page individually. You build 3 core templates:
Before any design work, review the planned structure. Don't let Codex run unsupervised on strategy.
Service schema. Guides get Article schema. FAQ sections get FAQPage schema.Now for the fun part. This is where you decide the visual identity and whether to include scroll-triggered video animations.
Use GPT's image generator (or your preferred tool) to explore visual directions:
For scroll-triggered animations (like a video of someone plugging in an EV charger that plays as you scroll), you need video clips.
AI video generators work best when you give them keyframes, not blank prompts:
Create still images of the key moments: (1) hand reaching for charger, (2) charger lifted, (3) charger being moved toward car, (4) charger plugged in.
Upload the keyframes and ask FAL to generate a smooth video interpolating between them. Test multiple models โ Kling 3 works best for realistic motion.
Once you have a video you like, export every frame as individual images. These get attached to GSAP scroll triggers so the video plays forward/backward as the user scrolls.
Give Codex the frame sequence and tell it to wire up GSAP ScrollTrigger to play the frames based on scroll position.
As you browse 21st.dev for inspiration:
"Import the saved aurora background component from 21st Dev"The actual construction. This is where everything comes together โ SEO structure, visual design, animations, and content.
| Feature | Astro | Plain HTML |
|---|---|---|
| SEO Sitemap | Auto-generated plugin | Manual creation |
| Meta Tags | Built-in head management | Hand-code every tag |
| Structured Data | Easy integration | Manual JSON-LD |
| Performance | Zero JS by default | Varies |
| Static Output | Pre-rendered HTML | Already static |
localhost:4321, Codex may have built it in plain HTML instead. The MD instructions should prevent this, but double-check.
For any section where you want motion, describe the animation and tell Codex to use GSAP:
For the hero section, add a GSAP ScrollTrigger animation where the heading fades in and slides up from 30px below when it enters the viewport. Use a 0.8s duration with an ease of "power2.out".
Every service page should have:
Service schema with name, description, area served, providerFAQPage schema for the FAQ sectionLocalBusiness schema on the homepageBreadcrumbList schema on all interior pagesapplication/ld+json. Or use Google's Rich Results Test after deployment.
In the GPT desktop app, you can preview the local site and use the Annotate feature:
"Generate a different hero image" or "Change this heading to..."This isn't as fast as editing code directly, but it's great for quick visual tweaks without leaving the app.
Before deploying, you must hit 99-100% on every Lighthouse category while still on localhost.
Three dots (โฎ) โ More Tools โ Developer Tools. Click the Lighthouse tab (you may need to click >> to find it).
Select Desktop mode. Check Performance, Accessibility, Best Practices, and SEO. Click "Analyze page load".
You need 99-100 across all categories. If anything is below 80%, it needs fixing before deploy.
If scores are low, copy the entire Lighthouse results and use this prompt:
This was the result of the Google Lighthouse test: [PASTE FULL RESULTS]
We need to make sure everything is at least at 99-100% before we publish. Please fix all issues.
IMPORTANT: Do NOT change any design elements, remove images, or alter the visual appearance just to improve performance scores. Optimize the code and loading strategy, but keep the design exactly as it is.
You've tested locally, you're happy with the scores. Time to go live.
Cloudflare Registrar โ search for your domain โ purchase. Domains are typically ~$10/year at cost price (no markup).
If you bought elsewhere, go to Cloudflare โ Overview โ Add a Site โ follow the nameserver transfer instructions.
Once the domain is active in Cloudflare, go back to your Codex conversation and say:
Send this to Cloudflare and attach it to the domain [yourdomain.com]
Codex will:
yourdomain.com/sitemap.xmlWithout these, you're flying blind. Install both before doing any ongoing SEO work.
Google Analytics โ Admin dropdown โ Create โ New Property. Name it, set the reporting timezone and currency.
Select "Web" platform โ enter your domain URL โ name the stream โ Create. You'll get a Measurement ID (G-XXXXXXXXXX).
In your Codex conversation, say:
Install the GA4 tag with measurement ID G-XXXXXXXXXX on the live site. Deploy the change to Cloudflare.
Install the Google Tag Assistant Chrome extension. Visit your live site โ click the extension โ confirm the GA4 tag fires correctly.
Tell Codex to track key actions as conversions:
Set up conversion tracking for form submissions on the contact page. When a user submits the form, fire a GA4 event called "generate_lead" with the form type as a parameter.
Search Console โ Add Property โ enter your domain โ Continue.
If you're logged into both Google Search Console and Cloudflare with the same browser, it will automatically verify domain ownership. This is a Cloudflare integration benefit โ no DNS TXT record needed.
In Search Console โ Sitemaps โ enter sitemap.xml โ Submit. This tells Google exactly which pages to crawl and index.
The final steps to ensure Google can find, crawl, and rank your new site.
Ask Codex: "What is the sitemap URL?" โ it should return something like:
https://yourdomain.com/sitemap.xml
Open it in your browser to verify:
Beyond Google, you need to optimize for AI search engines (ChatGPT, Perplexity, etc.). This requires:
These are the key prompts used throughout the process. Customize the bracketed sections for your project.
I'm building a website for a [BUSINESS TYPE] in [LOCATION].
Services: [LIST ALL SERVICES]
Target customers: [DESCRIBE IDEAL CUSTOMER]
USP: [WHAT MAKES THEM DIFFERENT]
CTA: [WHAT ACTION DO YOU WANT - call, form, booking]
Using the attached MD files as reference, please:
1. Research transactional keywords for each service
2. Group them into keyword clusters
3. Recommend a sitemap structure based on search volume
4. Create a CSV of keyword data with volume, CPC, and competition
Generate a style guide for the [BUSINESS] website. I want:
- A modern, premium look that doesn't feel AI-generated
- Color palette: [dark/light] theme with [ACCENT COLOR]
- Typography: clean, professional sans-serif
- Generate 3 hero image options using the GPT image generator
Save the winning style as a reference for all future pages.
Build the website in Astro using the sitemap we planned.
Requirements:
- Use GSAP for scroll animations on the hero and key sections
- Each service page needs: Service schema, FAQPage schema, BreadcrumbList schema
- Location pages need LocalBusiness schema
- Auto-generate sitemap.xml and robots.txt
- Mobile-first responsive design
- All images must have descriptive alt text
Start with the homepage template, then the service page template.
[PASTE FULL LIGHTHOUSE RESULTS]
Fix all issues to get 99-100% on every category.
CRITICAL: Do NOT remove images, animations, or change any visual design elements. Optimize code, loading strategy, and performance โ but keep the design exactly as it is.
Deploy the site to Cloudflare Pages and attach it to [yourdomain.com]. Make sure SSL is configured and the sitemap is accessible at /sitemap.xml.
Install the GA4 measurement tag (G-XXXXXXXXXX) on the live site. Also set up conversion tracking for form submissions as "generate_lead" events. Deploy the changes.
Run through this before going live. Check at minimum the homepage and 2-3 service pages.