A production-ready one-page website builder with AI-powered design features.
- Next.js + TypeScript - Modern React framework with type safety
- Tailwind CSS - Utility-first styling
- Supabase Integration - Authentication & database (or localStorage fallback)
- Multiple Templates - Business card, portfolio, resume, and more
- AI Visual Builder - ChatGPT-like design commands, screenshot analysis, style transfer
- Smart Suggestions - Expert UX/UI improvements with WCAG compliance
- Voice Commands - Design with your voice
- Before/After Comparison - Compare and restore AI changes
- Keyboard Shortcuts - Power user friendly
- Export Options - HTML, React, Vue, Angular, Svelte
npm installCreate .env.local in project root:
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
OPENAI_API_KEY=your-openai-api-keynpm run devOpen http://localhost:3000 to see your app!
pages/
βββ index.tsx # Landing page
βββ editor.tsx # Main editor workspace
βββ dashboard.tsx # User dashboard
βββ templates.tsx # Template gallery
βββ api/ # API routes
βββ ai/ # AI features
βββ visual-builder.ts # Main AI router (67 lines)
βββ helpers/ # Modular helpers
βββ prompts.ts # AI prompts
βββ design-audit.ts # WCAG checks
βββ screenshot-analyzer.ts # Image analysis
βββ style-transfer.ts # Style transfer
βββ natural-command.ts # Command processing
βββ smart-suggestions.ts # UX suggestions
src/
βββ components/
β βββ editor/
β β βββ VisualAIBuilder.tsx # Main AI component (438 lines)
β β βββ AIAssistant.tsx # AI chat assistant
β β βββ ImageSuggestions.tsx # Image recommendations
β β βββ ai-builder/ # Mode components
β β βββ NaturalCommandMode.tsx
β β βββ ScreenshotMode.tsx
β β βββ StyleTransferMode.tsx
β β βββ SmartSuggestionsMode.tsx
β β βββ BeforeAfterComparison.tsx
β βββ templates/ # Template components
β βββ ui/ # Reusable UI components
βββ hooks/ # Custom React hooks
β βββ useVoiceCommand.ts
β βββ useCommandHistory.ts
β βββ useSnapshot.ts
β βββ useKeyboardShortcuts.ts
βββ lib/ # Utilities
βββ types/ # TypeScript types
βββ config/ # Configuration files
- ARCHITECTURE.md - System architecture and data flow diagrams
The AI Visual Builder provides 4 powerful modes:
"Make it blue"
"Change hero title to 'Welcome to my portfolio'"
"Remove the about section"
"Reorder sections: hero, projects, contact"
- Upload any website screenshot
- AI extracts colors, fonts, layout patterns
- One-click apply to your design
- Cost: ~$0.01 per screenshot (GPT-4o-mini vision)
- Upload a reference design
- Choose what to transfer (colors, fonts, layout, spacing)
- AI adapts style to your template
- Works with ANY website screenshot
- AI analyzes your design
- WCAG compliance checks (contrast, readability)
- Expert UX/UI improvements
- One-click apply suggestions
- Cost: ~$0.002 per analysis (GPT-3.5-turbo)
All modes include:
- βͺ Before/After comparison with restore
- π€ Voice commands (browser-supported)
- π Command history and favorites
- β‘ Real-time preview updates
Before deploying, test these core features:
- Create new site from template
- Edit content in panels
- Use natural command: "Make it blue"
- Upload screenshot and analyze
- Transfer style from reference
- Generate smart suggestions
- Compare before/after and restore
- Test voice commands (Chrome/Safari)
- Export to HTML/React/Vue
- Publish site and view preview
Main Editor:
pages/editor.tsx- Editor workspace and layoutsrc/components/editor/VisualAIBuilder.tsx- AI builder orchestrator
Templates:
src/components/templates/- All template componentssrc/config/templates.ts- Template registry
API Routes:
pages/api/ai/visual-builder.ts- Main AI routerpages/api/ai/helpers/- Modular AI helpers
Custom Hooks:
src/hooks/useVoiceCommand.ts- Voice inputsrc/hooks/useCommandHistory.ts- History managementsrc/hooks/useSnapshot.ts- Before/after snapshots
-
Create Template Component:
// src/components/templates/my-template/index.tsx export const MyTemplate = ({ data, colors, fonts }) => { return <div>...</div> }
-
Register Template:
// src/config/templates.ts export const templates = [ { id: 'my-template', name: 'My Template', description: 'Description here', category: 'business', component: MyTemplate } ]
-
Add Template Purpose (for AI):
// pages/api/ai/helpers/prompts.ts export function getTemplatePurpose(templateType: string): string { switch (templateType) { case 'my-template': return 'A professional template for XYZ with sections: hero, about, services' // ... } }
-
Done! All AI modes automatically work with your new template.
-
Create Mode Component:
// src/components/editor/ai-builder/MyNewMode.tsx interface MyNewModeProps { isProcessing: boolean onGenerate: () => void // ... other props } export const MyNewMode: React.FC<MyNewModeProps> = ({ ... }) => { return <div>Mode UI here</div> }
-
Add to Main Component:
// src/components/editor/VisualAIBuilder.tsx // Add to mode type type BuilderMode = 'screenshot' | 'style-transfer' | 'natural-command' | 'suggestions' | 'my-mode' // Add to mode selector { id: 'my-mode', label: 'π My Mode', desc: 'Does cool stuff' } // Add to mode content {mode === 'my-mode' && <MyNewMode {...props} />}
-
Add API Handler:
// pages/api/ai/helpers/my-feature.ts export async function processMyFeature(params: any) { // Your logic here }
-
Update Router:
// pages/api/ai/visual-builder.ts case 'my-feature': return await processMyFeature(body)
- Push code to GitHub
- Import project in Vercel
- Add environment variables
- Deploy!
Works with any Next.js hosting:
- Netlify
- AWS Amplify
- Railway
- Render
Contributions welcome! Please read the documentation first to understand the architecture.
MIT License - feel free to use for personal or commercial projects.
Built with β€οΈ using Next.js, TypeScript, Tailwind CSS, and OpenAI