Skip to content

Codey is an AI Website Builder and AI-powered platform that lets users create and preview full websites just by chatting with an assistant. It supports multi-model AI code generation, sandboxed previews using Docker, and user authentication + billing via Clerk.

License

Notifications You must be signed in to change notification settings

HamzaAmir97/saas_ai_website_builder

Repository files navigation

🌟 Support the Project

Please Don't forget to support me with a ⭐ STAR β€” it really helps and motivates me to keep improving the system!


Banner

πŸš€ SaaS AI Website Builder

A powerful AI-powered SaaS platform that allows users to build websites simply by talking to an AI assistant. This project leverages multiple language models and cutting-edge technologies to generate production-ready Next.js code and preview it live in a secure sandbox.

πŸ’³ Billing is handled securely via Clerk Billing.
🎨 Theme colors follow the Twitter color scheme via tweakcn.
🐳 Docker is used to run generated projects inside a sandbox environment without compatibility issues.


πŸ“š Table of Contents


πŸ“Έ Screenshots

Screenshot 1
Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 5 Screenshot 5 Screenshot 5

🎯 Project Purpose

This platform serves as a bridge between non-technical users and web development by enabling them to:

  • Generate website projects using AI conversations
  • Create complete frontend code with no coding experience
  • Preview results instantly in a sandboxed environment
  • Manage multiple projects with real-time tracking

✨ Features

  • Conversational Website Creation: Build websites by simply describing your ideas to an AI assistant.
  • Production-Ready Code Generation: Instantly generate clean, production-grade Next.js code for your projects.
  • Live Preview in Sandbox: Safely preview and interact with your generated website in a secure, isolated environment.
  • Multi-Model AI Support: Leverage OpenAI, Anthropic, and Google Gemini for diverse and powerful code generation.
  • Project Management: Create, manage, and track multiple website projects with real-time updates.
  • Authentication & Billing: Secure sign-in, sign-up, and billing powered by Clerk.
  • Export & Deploy: Easily export your code or deploy directly to platforms like Vercel or Netlify.
  • Modern UI/UX: Enjoy a sleek, responsive interface built with Tailwind CSS and Radix UI components.
  • Background Jobs: Reliable background processing using Inngest for tasks like code compilation and deployment.
  • Database Integration: Robust data storage and management with Prisma and PostgreSQL.

πŸ› οΈ Technologies Used

Frontend

Next.js React Tailwind CSS Radix UI tRPC TanStack Query React Hook Form Clerk

Backend

Next.js API Routes Prisma PostgreSQL Inngest

AI Integration

OpenAI Anthropic Google Gemini E2B

🐳 Docker is used to run generated projects inside sandbox containers without compatibility issues.


πŸ“‚ Project Structure


saas\_ai\_website\_builder/
β”œβ”€β”€ prisma/               # Database schema
β”œβ”€β”€ public/               # Static assets
β”œβ”€β”€ sandbox-templates/    # Website templates
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/              # App Router pages
β”‚   β”œβ”€β”€ components/       # Reusable components
β”‚   β”œβ”€β”€ hooks/            # Custom hooks
β”‚   β”œβ”€β”€ inngest/          # Background jobs
β”‚   β”œβ”€β”€ lib/              # Utility functions
β”‚   β”œβ”€β”€ modules/          # Features modules
β”‚   β”œβ”€β”€ trpc/             # tRPC handlers
β”‚   β”œβ”€β”€ middleware.ts     # Auth middleware
β”‚   └── prompt.ts         # AI prompts
β”œβ”€β”€ .env                  # Environment variables
β”œβ”€β”€ next.config.ts        # Next.js configuration
β”œβ”€β”€ package.json          # Project dependencies
└── tsconfig.json         # TypeScript configuration


πŸ“ Key Files

  • schema.prisma: Data models
  • prompt.ts: AI prompt logic
  • middleware.ts: Auth and middleware logic
  • .env: API keys and secrets

πŸ” Environment Variables

To run this project, you need to set up the following environment variables in a .env file. You can use the .env.example as a template.

# Database
DATABASE_URL="YOUR_POSTGRESQL_URL"

# App URL
NEXT_PUBLIC_APP_URL="http://localhost:3000"

# AI Provider API Keys
GEMINI_API_KEY="YOUR_GEMINI_API_KEY"
OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
ANTHROPIC_API_KEY="YOUR_ANTHROPIC_API_KEY"

# E2B Sandbox API Key
E2B_API_KEY="YOUR_E2B_API_KEY"

# Clerk Authentication and Billing
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="YOUR_CLERK_PUBLISHABLE_KEY"
CLERK_SECRET_KEY="YOUR_CLERK_SECRET_KEY"
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/
NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL or Neon.tech
  • API keys (OpenAI, Anthropic, Gemini, E2B, Clerk)

Setup

git clone https://github.com/your-org/saas-ai-website-builder
cd saas-ai-website-builder

npm install

cp .env.example .env
# Fill in all API keys

npx prisma migrate dev

npm run dev

πŸ“ Important Notes

  • This version is experimental, expect occasional issues.
  • Results improve as you use it β€” context builds over time.
  • The project is fully open-source β€” feel free to fork, improve, or use with different models.
  • πŸ”§ Code is ready β€” just plug in your .env file and run it locally.
  • The system currently runs on Google Gemini API, which is powerful but can be unreliable or limited depending on usage.

πŸ’‘ Usage Flow

  1. Sign up using Clerk
  2. Create a new website project
  3. Describe your idea to the AI
  4. Review and edit generated code
  5. Preview in sandbox
  6. Export or deploy

🚒 Deployment

Deploy easily to Vercel, Netlify, etc.

npm run build
npm run start

🀝 Contributing

We welcome contributions β€” especially in AI prompt engineering, UI/UX improvements, and API integrations.

# Fork
git checkout -b feature/your-feature-name
# After changes
git commit -m "feat: improved something"
git push origin feature/your-feature

Open a Pull Request πŸš€


πŸ“„ License

Β© 2025 Hamzah Amir This code is licensed under the MIT License. Unauthorized commercial use without attribution is prohibited.

About

Codey is an AI Website Builder and AI-powered platform that lets users create and preview full websites just by chatting with an assistant. It supports multi-model AI code generation, sandboxed previews using Docker, and user authentication + billing via Clerk.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages