An intelligent system that generates complete, functional websites from natural language intents using Claude AI. The system analyzes user requirements, extracts website details, filters relevant data, generates multi-page websites with custom branding, and deploys them automatically to Vercel.
- Natural Language Processing: Understands user intents and requirements
- Website Details Extraction: Automatically extracts website name, tagline, and description from user intent
- Smart Modal System: Prompts users for website details when not found in intent
- Multi-Data Source Support: Works with movies, companies, products, actors, directors, testimonials
- Intelligent Page Generation: Creates pages only when explicitly requested (simple, moderate, or complex requests)
- AI-Powered Validation: Automatically validates and fixes generated code
- Automatic Deployment: Deploys websites to Vercel and returns live URLs
- Real-Time Logging: Provides live updates during generation (200ms polling)
- Model Selection: Supports both OpenRouter (Sonnet 4.5) and Anthropic (Haiku)
- Custom Branding: Uses extracted or user-provided website name, tagline, and description throughout generated sites
- Design Customization: Detects color preferences from user intent (blue, red, green, dark, light, minimal, etc.)
flowchart TD
Start([User Opens Frontend]) --> Load[Page LoadsModal Hidden]
Load --> Input[User Enters Intent]
Input --> Validate{Intent Valid?}
Validate -->|No| Error[Show Error<br/>Hide Modal]
Error --> Input
Validate -->|Yes| Extract[Extract Website Details<br/>POST /api/extract-website-details]
Extract --> CheckDetails{Website Name<br/>Found?}
CheckDetails -->|No| Modal[Show Modal<br/>Collect Details]
CheckDetails -->|Yes| Generate[Start Generation]
Modal --> UserInput[User Fills Form<br/>or Skips]
UserInput --> Generate
Generate -->|POST /api/generate-website| Backend[Backend: Express Server]
Backend --> Rephrase[Intent Rephraser<br/>Claude API Call #1<br/>Rephrases intent]
Rephrase --> Analyze[Intent Analyzer<br/>Claude API Call #2<br/>Extracts: dataSource, filters, limit]
Analyze --> Verify[Data Source Verifier<br/>Claude API Call #3<br/>Double-checks data source]
Verify --> Filter[Data Filter<br/>Loads data/{source}.json<br/>Applies filters & limit]
Filter --> Plan[Architecture Planner<br/>Claude API Call #4<br/>Plans pages based on intent complexity]
Plan --> FileGen[File Generator Loop<br/>For each file in architecture]
FileGen --> GenFile[Generate File<br/>Claude API Call #5, #6, #7...<br/>Uses websiteDetails for branding]
GenFile --> Validate[Website Validator<br/>Claude API Call #N+1<br/>Validates all files]
Validate --> Fix{Issues Found?}
Fix -->|Yes| FixFile[Fix Issues<br/>Claude API Call #N+2, #N+3...]
FixFile --> Validate
Fix -->|No| Save[Save Files<br/>Create data.json<br/>Create vercel.json]
Save --> Deploy[Vercel Deployer<br/>Deploy to Vercel CLI]
Deploy --> Status[Update Status<br/>Store in memory]
Status --> Poll[Frontend Polls<br/>GET /api/logs/:projectId<br/>Every 200ms]
Poll --> Display[Display Logs<br/>Real-time updates]
Display --> Complete{Status<br/>Complete?}
Complete -->|No| Poll
Complete -->|Yes| URL[Show Deployed URL<br/>https://project-xxx.vercel.app]
URL --> End([User Receives Live Website])
style Start fill:#f9f,stroke:#333,stroke-width:2px,color:#000
style End fill:#9f9,stroke:#333,stroke-width:2px,color:#000
style Load fill:#eef,stroke:#333,stroke-width:2px,color:#000
style Extract fill:#bbf,stroke:#333,stroke-width:2px,color:#000
style Modal fill:#fbf,stroke:#333,stroke-width:2px,color:#000
style Generate fill:#bfb,stroke:#333,stroke-width:2px,color:#000
style Rephrase fill:#bbf,stroke:#333,stroke-width:2px,color:#000
style Analyze fill:#bbf,stroke:#333,stroke-width:2px,color:#000
style Verify fill:#bbf,stroke:#333,stroke-width:2px,color:#000
style Filter fill:#fbf,stroke:#333,stroke-width:2px,color:#000
style Plan fill:#bbf,stroke:#333,stroke-width:2px,color:#000
style GenFile fill:#bfb,stroke:#333,stroke-width:2px,color:#000
style Validate fill:#fbb,stroke:#333,stroke-width:2px,color:#000
style Deploy fill:#fbf,stroke:#333,stroke-width:2px,color:#000
style URL fill:#9f9,stroke:#333,stroke-width:2px,color:#000
Page Load β Modal Hidden (multiple safeguards)
β User Interface Ready
User β Enters Intent β Clicks "Generate Website"
β
Validate Intent (not empty)
β
If empty β Show Error, Hide Modal
β
If valid β Proceed
Valid Intent β POST /api/extract-website-details
β Website Details Extractor (Claude API Call #0)
β Extracts: websiteName, tagline, description
β
Check if websiteName exists
β
If missing β Show Modal
If found β Proceed to generation
Modal Shown β User fills form (websiteName, tagline, description)
β OR User clicks "Skip"
β Modal Hidden
β Proceed with collected details (or null)
Intent + Website Details β POST /api/generate-website
β Intent Rephraser (Claude API Call #1)
β Rephrases into clear, structured format
β Returns: Rephrased intent
Rephrased Intent β Intent Analyzer (Claude API Call #2)
β Detects data source (movies/companies/products/etc.)
β Extracts filters (year, genre, location, category, etc.)
β Determines limit (default: 100, adjusts for "all")
β Returns: { dataSource, filters, limit }
Analysis Result β Data Source Verifier (Claude API Call #3)
β Double-checks data source selection
β Confirms or corrects if wrong
β Returns: Verified data source
Verified Source + Filters β Data Filter
β Loads data from data/{source}.json
β Applies filters (location, category, genre, year, etc.)
β Applies limit
β Returns: Filtered data array
β If 0 results, returns all data (with warning)
Intent + Filtered Data β Architecture Planner (Claude API Call #4)
β Analyzes intent complexity:
* SIMPLE: Just index.html + app.js
* MODERATE: index.html + one requested page + app.js
* COMPLEX: index.html + all mentioned pages + app.js
β Returns: { files: [{ fileName, purpose, kind }] }
For each file in architecture:
File Generator (Claude API Call #5, #6, #7, ...)
- Uses websiteDetails for branding (name, tagline, description)
- Generates HTML with embedded Tailwind CSS
- Generates JavaScript for interactivity
- Includes filtered data context
- Detects color preferences from intent
- Returns: Raw file content
Generated Files β Website Validator (Claude API Call #N+1)
β Checks for markdown code fences
β Validates syntax
β Identifies issues (truncation, broken tags, etc.)
β Fixes problems (Claude API Call #N+2, #N+3, ...)
β Returns: Validated files
Validated Files β File System
β Creates project folder: generated-sites/project-{timestamp}/
β Saves all HTML/JS files
β Creates data.json with filtered data
β Creates vercel.json for deployment
Project Folder β Vercel Deployer
β Runs: vercel deploy --prod --yes
β Parses deployment URL from CLI output
β Returns: Deployed URL (https://project-xxx.vercel.app)
Backend β Log Store (In-Memory)
β Captures all console.log/error/warn
β Stores per project ID
β
Frontend β Polls GET /api/logs/:projectId (every 200ms)
β Displays real-time logs with color coding
β Shows progress updates
β Displays final URL when complete
dynamic_site_generator/
βββ frontend/
β βββ index.html # User interface with modal system
βββ backend/
β βββ src/
β β βββ server.ts # Express server & API endpoints
β β βββ intent-rephraser.ts # Step 4: Rephrase intent
β β βββ intent-analyzer.ts # Step 5: Analyze intent
β β βββ data-source-verifier.ts # Step 6: Verify data source
β β βββ data-filter.ts # Step 7: Filter data
β β βββ architecture-planner.ts # Step 8: Plan structure
β β βββ website-generator.ts # Step 9: Orchestrate generation
β β βββ file-generator.ts # Step 9: Generate individual files
β β βββ website-validator.ts # Step 10: Validate & fix
β β βββ vercel-deployer.ts # Step 12: Deploy to Vercel
β β βββ website-details-extractor.ts # NEW: Extract website details
β β βββ anthropic-client.ts # API client wrapper (OpenRouter + Anthropic)
β βββ package.json
β βββ tsconfig.json
βββ data/
β βββ movies.json
β βββ companies.json
β βββ products.json
β βββ actors.json
β βββ directors.json
β βββ testimonials.json
βββ generated-sites/ # Generated websites stored here
β βββ project-{timestamp}/
β βββ index.html
β βββ about.html # (if requested)
β βββ browse.html # (if requested)
β βββ details.html # (if requested)
β βββ contact.html # (if requested)
β βββ app.js
β βββ data.json
β βββ vercel.json
βββ .env # Environment variables (not in repo)
βββ README.md
Extracts website details (name, tagline, description) from user intent.
Request:
{
"intent": "I want a company website for TechCorp",
"provider": "openrouter" | "anthropic"
}Response:
{
"websiteName": "TechCorp",
"tagline": "Your Trusted Partner",
"description": "Leading technology solutions provider"
}Generates a complete website from user intent.
Request:
{
"intent": "I want a company website with about and products pages",
"provider": "openrouter" | "anthropic",
"websiteDetails": {
"websiteName": "TechCorp",
"tagline": "Your Trusted Partner",
"description": "Leading technology solutions provider"
}
}Response:
{
"projectId": "project-1234567890",
"status": "in_progress",
"message": "Generation started"
}Retrieves real-time logs for a project.
Response:
{
"logs": [
{
"timestamp": 1234567890,
"level": "info",
"message": "Starting generation..."
}
],
"projectId": "project-1234567890"
}Gets the current status of a project.
Response:
{
"status": "completed",
"deployedUrl": "https://project-123.vercel.app",
"projectPath": "generated-sites/project-1234567890",
"publicUrl": "/generated-sites/project-1234567890/index.html"
}Analyzes user intent and returns data source, filters, and limit.
Generates a dynamic page for an existing project.
- Node.js 18+
- npm or yarn
- Vercel CLI (for deployment) - installed via
npxautomatically - API keys:
- OpenRouter API key (for Sonnet 4.5)
- Anthropic API key (for Haiku)
- Vercel token (optional, for deployment)
- Clone the repository
git clone <repository-url>
cd dynamic_site_generator- Install backend dependencies
cd backend
npm install- Set up environment variables
Create
.envin the root directory:
# OpenRouter (for Sonnet 4.5)
OPENROUTER_API_KEY=sk-or-v1-...
OPENROUTER_MODEL=anthropic/claude-sonnet-4.5
# Anthropic (for Haiku)
ANTHROPIC_API_KEY=sk-ant-api03-...
ANTHROPIC_MODEL=claude-3-haiku-20240307
# Vercel (optional, for deployment)
VERCEL_TOKEN=...
# Server
PORT=3000- Build and start the backend
cd backend
npm run build
npm start- Open the frontend
Open
frontend/index.htmlin a browser or serve it with a local server.
-
User enters intent:
"I want a company website for TechCorp with an about page showing our mission and vision, and a products page to browse all our services" -
System processes:
- Extracts website details:
websiteName: "TechCorp"(found in intent) - Rephrases intent for clarity
- Detects data source:
companies - Filters companies data (all records, limit: 100)
- Plans architecture:
index.html,about.html,browse.html,app.js(complex request) - Generates each file with Claude, using "TechCorp" as website name
- Validates and fixes code
- Deploys to Vercel
- Extracts website details:
-
User receives:
- Real-time logs during generation (updates every 200ms)
- Final deployed URL:
https://project-123.vercel.app - Website with custom branding (TechCorp name, mission, vision, products)
If user intent doesn't include a website name:
User: "Show me all action movies from 2024"
β
System extracts: websiteName = null
β
Modal appears: "Please provide some details about your website"
β
User fills: websiteName = "MovieHub", tagline = "Discover Amazing Movies"
β
Generation proceeds with custom branding
- OpenRouter (Sonnet 4.5): Higher quality, more expensive, 3000 token limit for file generation
- Anthropic (Haiku): Faster, more cost-effective, 4000 token limit for file generation
- Token limits optimized per provider and operation type
- Extraction: Uses Claude to extract websiteName, tagline, description from intent
- Modal System: Shows modal only when:
- User has entered a valid intent
- User clicked "Generate Website"
- Extraction API succeeded
- Website name is missing
- Branding: Website details are passed to file generator and used throughout:
- Website name in titles, headers, navigation
- Tagline displayed prominently
- Description used in meta tags and about sections
- Default: "SkyThought" if no name provided
- Movies: year, genre, rating, director, actors, plot
- Companies: name, industry, location, mission, vision, people
- Products: name, category, personas, useCases, price, trialDays
- Actors: name, gender, location, about, bestFilms
- Directors: name, location, bestFilms, about
- Testimonials: name, role, company, location, rating, text
- Simple Requests: "show movies", "list products" β Only
index.html+app.js - Moderate Requests: "movies with about page" β
index.html+about.html+app.js - Complex Requests: "company website with mission and products" β All mentioned pages +
app.js - Pages only created when explicitly requested or implied by keywords
- One API call per file: Prevents token limit issues
- Multi-step validation: Ensures code quality
- Automatic fixing: Claude reviews and corrects generated code
- Smart page creation: Only creates pages when explicitly requested
- Design customization: Detects color preferences from intent
- Polling frequency: 200ms for near real-time updates
- Log storage: In-memory per project ID
- Log types: info, success, warning, error, step
- Auto-scroll: Logs container scrolls to latest entry
Automatically extracts website name, tagline, and description from user intent. If not found, prompts user via modal to provide these details. This ensures all generated websites have proper branding.
Smart modal that:
- Only appears when needed (website name missing)
- Validates intent before showing
- Allows user to provide details or skip
- Properly hidden on page load (multiple safeguards)
- Uses both
hiddenattribute anddisplay: nonestyle
Improves AI understanding by converting casual language into structured requirements.
Intelligent keyword matching with AI verification ensures correct data source selection. Handles edge cases like "company website" vs "products for businesses".
AI determines which pages to create based on user requirements:
- Simple: Just listing data β minimal pages
- Moderate: One specific page mentioned β that page + index
- Complex: Multiple pages or business terms β all relevant pages
In-memory log store captures all console output and streams to frontend via 200ms polling. Color-coded log types for better UX.
Uses Vercel CLI to deploy static sites and returns live URLs immediately. Handles Windows and Unix systems.
- Fixed: Modal now has multiple safeguards:
hiddenattribute in HTMLstyle="display: none"inline- JavaScript
hideModal()on page load - Event listeners on DOMContentLoaded and load
- Check if filters are too restrictive
- Verify data source is correct
- Check logs for filter details
- System now returns all data if filters result in 0 records (with warning)
- This is intentional for simple requests
- Ensure user explicitly requests pages (e.g., "with about page")
- Check logs for architecture planning response
- Complex requests (company website, portfolio) create all pages
- Verify Vercel token is set (optional, generation works without it)
- Check Vercel CLI is accessible via
npx - Ensure project folder has valid files
- Check logs for deployment error messages
- Ensure website details are provided (via extraction or modal)
- Check that extraction API succeeded
- Verify websiteDetails are passed to generateWebsite function
- β Website Details Extraction: New feature to extract and use website name, tagline, description
- β Modal System: Smart modal for collecting website details when not found in intent
- β Modal Visibility Fixes: Fixed modal appearing on page load (multiple safeguards)
- β Intent Validation: Enhanced validation before API calls
- β Error Handling: Improved error handling throughout the flow
- β Branding Support: Website details used throughout generated sites
- β Design Customization: Color preference detection from user intent
- β Architecture Intelligence: Smarter page creation based on intent complexity
- β Real-Time Logging: 200ms polling for near-instant updates
- β Data Filtering: Returns all data if filters result in 0 records (with warning)
[Your License Here]
[Contributing Guidelines Here]
Built with β€οΈ using Claude AI, Express, TypeScript, Tailwind CSS, and Vercel
SkyThought - Transform your ideas into websites in seconds