Skip to content

AI Website Generator empowers users to create sophisticated websites through an intuitive AI-powered interface. Built with modern full-stack architecture, it demonstrates enterprise-level patterns for real-time generation, database management, and intelligent workflow automation.

License

Notifications You must be signed in to change notification settings

abhishekboadgurjar/Ai-Website-Generator

Repository files navigation

AI Website Generator

A production-ready platform for generating, customizing, and deploying websites through AI-powered automation and natural language processing


🎯 Project Overview

AI Website Generator empowers users to create sophisticated websites through an intuitive AI-powered interface. Built with modern full-stack architecture, it demonstrates enterprise-level patterns for real-time generation, database management, and intelligent workflow automation. Simply describe your vision in natural language, and watch as the AI transforms your ideas into fully functional, responsive web designs.

Author: Abhishek Gurjar β€” GitHub Profile | Portfolio


✨ Core Features

Intelligent Generation Engine

  • AI-Powered Design - Leverages OpenRouter (GPT-4o-mini) for natural language to code transformation
  • Interactive Chat Interface - Real-time conversation with the AI to refine and iterate on designs
  • Dynamic Preview - Instant visual feedback of generated code within the workspace
  • Context-Aware Generation - AI understands project context and maintains consistency across iterations

Project & Workflow Management

  • Workspace Organization - Manage multiple projects with dedicated workspaces
  • History & Versioning - Track chat history and design iterations for every project
  • Export Capabilities - Export generated code for external use and deployment
  • Project Dashboard - Centralized view of all your projects with quick access

Production Infrastructure

  • Secure Authentication - Via Clerk with robust user management and SSO support
  • Serverless Database - Powered by Neon for automatic scaling and zero-downtime
  • Type-Safe ORM - Drizzle ORM for reliable database interactions with full TypeScript support
  • Modern Styling - Tailwind CSS v4 for utility-first, responsive design
  • Real-time Updates - Instant synchronization across devices and sessions

Developer Experience

  • Hot Reload Preview - See changes instantly as you interact with the AI
  • Code Syntax Highlighting - Clear, readable code display with proper formatting
  • Responsive Interface - Optimized for desktop and tablet workflows
  • Error Handling - Graceful error messages and recovery suggestions

πŸ› οΈ Technical Architecture

Frontend Stack

Next.js 16 (App Router) β†’ SSR/SSG hybrid rendering React 19 β†’ Modern concurrent features TypeScript 5 β†’ Type safety across codebase Tailwind CSS 4 β†’ Utility-first styling Lucide React β†’ Consistent icon system Recharts β†’ Data visualization 

Backend & Services

Next.js API Routes β†’ Serverless functions Neon Database β†’ Serverless Postgres Drizzle ORM β†’ TypeScript-first ORM Clerk β†’ Authentication & user management OpenRouter β†’ LLM-powered intelligence (GPT-4o-mini) 

Key Architectural Decisions

Why Next.js App Router? Leverages React Server Components for optimal performance, streaming SSR for faster Time to First Byte (TTFB), and simplified data fetching patterns that reduce client-side JavaScript bundle size.

Why Neon & Drizzle? Neon provides a serverless Postgres experience that scales to zero with automatic connection pooling, while Drizzle offers best-in-class type safety and developer experience without the overhead of traditional ORMs like Prisma or TypeORM.

Why Clerk? Production-ready authentication with zero backend code required, built-in UI components for sign-in/sign-up flows, and seamless JWT integration with our serverless architecture.

Why OpenRouter? Provides access to cutting-edge AI models with a unified API, allowing easy model switching and cost optimization without vendor lock-in.


πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Client Layer β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Workspace β”‚ β”‚ Dashboard UI β”‚ β”‚ Auth Pages β”‚ β”‚ β”‚ β”‚ (Playground) β”‚ β”‚ (Projects) β”‚ β”‚ (Clerk) β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ HTTP/JSON β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Next.js API Layer β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ AI Chat β”‚ β”‚ Projects β”‚ β”‚ Users β”‚ β”‚ β”‚ β”‚ Route β”‚ β”‚ Route β”‚ β”‚ Route β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Neon Database β”‚ β”‚ External APIs β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Users Table β”‚ β”‚ β”‚ β”‚ OpenRouter API β”‚ β”‚ β”‚ β”‚ Projects Table β”‚ β”‚ β”‚ β”‚ (GPT-4o-mini) β”‚ β”‚ β”‚ β”‚ Chats Table β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 

πŸš€ Full-Stack Skills Demonstrated

Frontend Engineering

  • Modern React Patterns - Server components, client components, and streaming
  • Advanced State Management - React Context, custom hooks, and optimistic updates
  • Performance Optimization - Code splitting, lazy loading, and bundle optimization
  • Responsive Design - Mobile-first approach with Tailwind's responsive utilities

Backend Development

  • Serverless API Design - RESTful endpoints with Next.js API routes
  • Database Schema Design - Normalized tables with proper relationships
  • ORM Integration - Drizzle for type-safe database queries
  • Third-party API Integration - OpenRouter for AI capabilities

DevOps & Infrastructure

  • Environment Management - Proper configuration for dev, staging, and production
  • Database Migrations - Version-controlled schema changes with Drizzle Kit
  • Security Best Practices - Environment variable handling, API key protection
  • Deployment Automation - CI/CD with Vercel for zero-downtime deployments

Software Engineering Practices

  • Type Safety - End-to-end TypeScript coverage for reliability
  • Clean Code - Modular architecture with separation of concerns
  • Documentation - Comprehensive inline comments and README
  • Version Control - Semantic commits and feature branching

πŸ“‚ Project Structure

ai-website-generator/ β”œβ”€β”€ app/ β”‚ β”œβ”€β”€ (auth)/ # Authentication routes (sign-in, sign-up) β”‚ β”‚ β”œβ”€β”€ sign-in/ β”‚ β”‚ └── sign-up/ β”‚ β”œβ”€β”€ api/ # Backend API routes β”‚ β”‚ β”œβ”€β”€ chat/ # AI chat endpoint β”‚ β”‚ β”œβ”€β”€ projects/ # Project CRUD operations β”‚ β”‚ └── users/ # User management β”‚ β”œβ”€β”€ dashboard/ # User dashboard with project list β”‚ β”œβ”€β”€ workspace/ # Main editing interface β”‚ β”‚ └── [projectId]/ # Dynamic project workspace β”‚ β”œβ”€β”€ layout.tsx # Root layout with providers β”‚ β”œβ”€β”€ page.tsx # Landing page β”‚ └── globals.css # Global styles β”œβ”€β”€ components/ # Reusable UI components β”‚ β”œβ”€β”€ ui/ # Base UI components β”‚ β”œβ”€β”€ workspace/ # Workspace-specific components β”‚ └── dashboard/ # Dashboard components β”œβ”€β”€ config/ # Configuration files β”‚ └── schema.ts # Drizzle schema definitions β”œβ”€β”€ drizzle/ # Database migrations β”‚ └── migrations/ β”œβ”€β”€ lib/ # Utility functions β”‚ β”œβ”€β”€ db.ts # Database connection β”‚ β”œβ”€β”€ auth.ts # Authentication helpers β”‚ └── utils.ts # General utilities β”œβ”€β”€ public/ # Static assets β”‚ β”œβ”€β”€ images/ β”‚ └── icons/ β”œβ”€β”€ types/ # TypeScript type definitions β”œβ”€β”€ .env.example # Environment variable template β”œβ”€β”€ drizzle.config.ts # Drizzle configuration β”œβ”€β”€ next.config.js # Next.js configuration β”œβ”€β”€ tailwind.config.ts # Tailwind configuration β”œβ”€β”€ tsconfig.json # TypeScript configuration └── package.json # Dependencies and scripts 

πŸ”§ Local Development Setup

Prerequisites

  • Node.js 18.17 or later
  • npm, yarn, or pnpm
  • Git

Installation Steps

  1. Clone the repository

    git clone https://github.com/abhishekboadgurjar/ai-website-generator.git cd ai-website-generator
  2. Install dependencies

    npm install # or yarn install # or pnpm install
  3. Setup environment variables

    Create a .env.local file in the root directory:

    # Clerk Authentication NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_... CLERK_SECRET_KEY=sk_test_... NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard # Database (Neon) DATABASE_URL=postgresql://user:password@host.neon.tech/dbname?sslmode=require # OpenRouter AI OPENROUTER_API_KEY=sk-or-... NEXT_PUBLIC_OPENROUTER_MODEL=openai/gpt-4o-mini
  4. Run database migrations

    npm run db:push # or npx drizzle-kit push:pg
  5. Start the development server

    npm run dev # or yarn dev # or pnpm dev
  6. Open your browser

    Navigate to http://localhost:3000

Additional Commands

# Generate database migrations npm run db:generate # Open Drizzle Studio (database GUI) npm run db:studio # Build for production npm run build # Start production server npm run start # Run TypeScript type checking npm run type-check # Lint code npm run lint

🌐 Deployment Guide

Deploy to Vercel (Recommended)

  1. Push your code to GitHub

    git add . git commit -m "Initial commit" git push origin main
  2. Connect to Vercel

    • Go to vercel.com
    • Click "New Project"
    • Import your GitHub repository
    • Vercel will auto-detect Next.js
  3. Configure environment variables

    • Add all variables from your .env.local file
    • Ensure DATABASE_URL points to your production Neon database
  4. Deploy

    • Click "Deploy"
    • Vercel will build and deploy your application
    • Future commits to main will trigger automatic deployments

Neon Database Setup

  1. Create a Neon account at neon.tech
  2. Create a new project
  3. Copy the connection string
  4. Add it to your environment variables as DATABASE_URL
  5. Run migrations: npm run db:push

Environment Configuration

Ensure these environment variables are set in production:

  • All Clerk keys for authentication
  • DATABASE_URL for Neon connection
  • OPENROUTER_API_KEY for AI functionality

🎨 Usage Guide

Creating Your First Website

  1. Sign In - Authenticate using Clerk (supports email, Google, GitHub)
  2. Create Project - Click "New Project" on the dashboard
  3. Describe Your Vision - Use natural language to describe your website
    • Example: "Create a modern portfolio website with a hero section, project gallery, and contact form"
  4. Refine & Iterate - Continue chatting with the AI to make adjustments
    • "Make the hero section full-screen"
    • "Add a dark mode toggle"
    • "Use a blue and white color scheme"
  5. Preview & Export - View your website in real-time and export the code

Best Practices

  • Be Specific - Provide clear details about layout, colors, and functionality
  • Iterate Gradually - Make one change at a time for better results
  • Use Examples - Reference existing websites or design patterns
  • Test Responsiveness - Check how your design looks on different screen sizes

🀝 Contributing

Contributions are welcome! This project follows standard open-source contribution guidelines.

How to Contribute

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Commit with clear messages
    git commit -m "Add amazing feature"
  5. Push to your fork
    git push origin feature/amazing-feature
  6. Open a Pull Request

Development Guidelines

  • Follow existing code style and conventions
  • Write meaningful commit messages
  • Add tests for new features when applicable
  • Update documentation for significant changes
  • Ensure TypeScript types are properly defined

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License Summary

Permission is granted to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, subject to including the copyright notice and permission notice in all copies.


πŸ“¬ Contact & Support

Abhishek Gurjar

Get Help


πŸ™ Acknowledgments

  • OpenRouter - For providing access to cutting-edge AI models
  • Vercel - For seamless deployment and hosting
  • Neon - For serverless Postgres infrastructure
  • Clerk - For authentication infrastructure
  • Next.js Team - For an incredible framework

⬆ Back to Top

Made with ❀️ by Abhishek Gurjar

If you find this project helpful, please consider giving it a ⭐️

About

AI Website Generator empowers users to create sophisticated websites through an intuitive AI-powered interface. Built with modern full-stack architecture, it demonstrates enterprise-level patterns for real-time generation, database management, and intelligent workflow automation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published