β‘ Transform ideas into stunning websites in seconds with AI
Features β’ Tech Stack β’ Getting Started β’ Deployment β’ API Documentation
Zen is a cutting-edge AI-powered website builder that transforms simple text descriptions into beautiful, fully functional websites in seconds. Built with modern technologies and best practices, Zen combines the power of artificial intelligence with an intuitive visual editor to make professional web development accessible to everyone - no coding knowledge required.
- π€ AI-Powered Generation: Uses OpenAI to convert natural language into production-ready HTML/CSS/JS
- β‘ Real-time Preview: Instant visual feedback with live code preview
- π¨ Visual Editor: Drag-and-drop interface with element-level customization
- π Version Control: Track changes with full version history and rollback capability
- π³ Integrated Payments: Seamless Stripe integration for credit purchases
- π Secure Authentication: Powered by Better Auth with email/password support
- π One-Click Publishing: Share your creations with public URLs
- π± Fully Responsive: Works seamlessly across all devices
- Natural Language Processing: Describe your website in plain English
- Intelligent Prompt Enhancement: AI optimizes your prompts for better results
- Tailwind CSS Integration: Modern, responsive designs using utility-first CSS
- Interactive Elements: Automatically includes JavaScript functionality
- Visual Element Editor: Modify text, colors, spacing, and styles
- Direct Code Editing: For advanced users who prefer code
- Real-time Updates: See changes instantly in the preview pane
- Undo/Redo Support: Non-destructive editing workflow
- Unlimited Projects: Create and manage multiple websites
- Project Dashboard: Overview of all your creations
- Search & Filter: Quickly find specific projects
- Bulk Operations: Delete or export multiple projects
- Automatic Versioning: Every AI revision creates a new version
- Version History: Browse all previous iterations
- One-Click Rollback: Restore any previous version
- Version Comparison: (Coming soon)
- Free Credits: 20 credits on signup
- Project Creation: 5 credits per new website
- Revisions: 5 credits per AI modification
- Flexible Pricing: Multiple credit packages available
- Secure Payments: PCI-compliant Stripe integration
- Public URLs: Share your websites with anyone
- Custom Domains: (Coming soon)
- Download HTML: Export complete website code
- Embed Options: (Coming soon)
| Technology | Purpose | Version |
|---|---|---|
| React | UI Framework | 19.2.0 |
| TypeScript | Type Safety | 5.9.3 |
| Vite | Build Tool | 7.2.4 |
| React Router | Navigation | 7.12.0 |
| Axios | HTTP Client | 1.13.2 |
| Tailwind CSS | Styling | 4.1.18 |
| Better Auth UI | Authentication Components | 3.3.15 |
| Sonner | Toast Notifications | 2.0.7 |
| Lucide React | Icons | 0.562.0 |
| Technology | Purpose | Version |
|---|---|---|
| Node.js | Runtime | ES2020 |
| Express | Web Framework | 5.2.1 |
| TypeScript | Type Safety | 5.9.3 |
| Prisma | ORM | 7.2.0 |
| PostgreSQL | Database | (via Neon) |
| Better Auth | Authentication | 1.4.16 |
| OpenAI SDK | AI Integration | 6.16.0 |
| Stripe | Payment Processing | 20.2.0 |
- Database: Neon PostgreSQL (Serverless)
- Hosting: Vercel (Frontend & Backend)
- Authentication: Better Auth (Session-based)
- Payments: Stripe (Webhook integration)
- AI: OpenRouter (Mistral Devstral)
Before you begin, ensure you have the following installed:
- Node.js: v18.0.0 or higher
- npm: v9.0.0 or higher (or yarn/pnpm)
- Git: Latest version
- PostgreSQL: Or a Neon account (recommended)
You'll need accounts and API keys for:
- Neon (Database): console.neon.tech
- OpenRouter (AI): openrouter.ai
- Stripe (Payments): dashboard.stripe.com
git clone https://github.com/notramm/Zen---AI-website-builder.git
cd zen---ai-website-buildercd backend
npm installcd frontend
npm installCreate backend/.env:
# Database
DATABASE_URL="postgresql://user:password@host:port/database?sslmode=require"
# Authentication
BETTER_AUTH_SECRET="your-random-secret-key-min-32-chars"
BETTER_AUTH_URL="http://localhost:3000"
# CORS
TRUSTED_ORIGINS="http://localhost:5173"
# Environment
NODE_ENV="development"
# AI
AI_API_KEY="your-openrouter-api-key"
# Payments
STRIPE_SECRET_KEY="sk_test_your_stripe_secret_key"
STRIPE_WEBHOOK_SECRET="whsec_your_webhook_secret"Generate Secrets:
# Generate BETTER_AUTH_SECRET
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Create frontend/.env:
VITE_BASEURL="http://localhost:3000"cd backend
# Generate Prisma Client
npx prisma generate
# Run migrations
npx prisma migrate dev
# (Optional) Seed database
npx prisma db seedBackend (Terminal 1):
cd backend
npm run dev
# Server runs on http://localhost:3000Frontend (Terminal 2):
cd frontend
npm run dev
# App runs on http://localhost:5173Visit http://localhost:5173 in your browser.
zen-ai-website-builder/
βββ backend/
β βββ configs/ # Configuration files
β β βββ openai.ts # OpenAI client setup
β βββ controllers/ # Request handlers
β β βββ ProjectController.ts
β β βββ userController.ts
β β βββ stripeWebhook.ts
β βββ generated/ # Prisma generated client
β βββ lib/ # Utility libraries
β β βββ auth.ts # Better Auth configuration
β β βββ prisma.ts # Prisma client instance
β βββ middlewares/ # Express middlewares
β β βββ auth.ts # Authentication middleware
β βββ prisma/ # Database schema & migrations
β β βββ schema.prisma # Database models
β β βββ migrations/ # Migration history
β βββ routes/ # API routes
β β βββ userRoutes.ts
β β βββ projectRoutes.ts
β βββ types/ # TypeScript type definitions
β β βββ express.d.ts
β βββ server.ts # Express app entry point
β βββ package.json
β βββ tsconfig.json
β βββ vercel.json # Vercel deployment config
β
βββ frontend/
β βββ public/ # Static assets
β βββ src/
β β βββ assets/ # Images, fonts, etc.
β β βββ components/ # React components
β β β βββ Navbar.tsx
β β β βββ Sidebar.tsx
β β β βββ EditorPanel.tsx
β β β βββ ProjectPreview.tsx
β β β βββ ...
β β βββ configs/ # Configuration
β β β βββ axios.ts # HTTP client setup
β β βββ lib/ # Utilities
β β β βββ auth-client.ts
β β β βββ utils.ts
β β βββ pages/ # Route pages
β β β βββ Home.tsx
β β β βββ Projects.tsx
β β β βββ MyProjects.tsx
β β β βββ Pricing.tsx
β β β βββ ...
β β βββ types/ # TypeScript types
β β β βββ index.ts
β β βββ App.tsx # Main app component
β β βββ main.tsx # Entry point
β β βββ index.css # Global styles
β βββ package.json
β βββ tsconfig.json
β βββ vite.config.ts
β βββ vercel.json
β
βββ .gitignore
βββ README.md
All authentication is handled through Better Auth:
POST /api/auth/sign-up # Create account
POST /api/auth/sign-in # Login
POST /api/auth/sign-out # Logout
GET /api/auth/session # Get current session
All user endpoints require authentication.
GET /api/user/creditsResponse:
{
"credits": 15
}POST /api/user/project
Content-Type: application/json
{
"initial_prompt": "Create a modern landing page for a SaaS product"
}Response:
{
"projectId": "uuid-here"
}GET /api/user/project/:projectIdResponse:
{
"project": {
"id": "uuid",
"name": "Project Name",
"current_code": "<html>...</html>",
"conversation": [...],
"versions": [...],
"isPublished": false
}
}GET /api/user/projectsGET /api/user/publish-toggle/:projectIdPOST /api/user/purchase-credits
Content-Type: application/json
{
"planId": "basic" | "pro" | "enterprice"
}Response:
{
"url": "https://checkout.stripe.com/..."
}All project endpoints require authentication.
POST /api/project/revision/:projectId
Content-Type: application/json
{
"message": "Make the header blue and add a contact form"
}PUT /api/project/save/:projectId
Content-Type: application/json
{
"code": "<html>...</html>"
}GET /api/project/rollback/:projectId/:versionIdDELETE /api/project/:projectIdGET /api/project/preview/:projectIdGET /api/project/publishedGET /api/project/published/:projectIdPOST /api/stripe
Content-Type: application/json
Stripe-Signature: <signature>model User {
id String
email String
name String
totalCreation Int @default(0)
credits Int @default(20)
emailVerified Boolean @default(false)
projects WebsiteProject[]
sessions Session[]
accounts Account[]
transactions Transaction[]
}
model WebsiteProject {
id String
name String
initial_prompt String
current_code String?
current_version_index String @default("")
userId String
isPublished Boolean @default(false)
conversation Conversation[]
versions Version[]
user User
}
model Conversation {
id String
role Role (user | assistant)
content String
timestamp DateTime @default(now())
projectId String
project WebsiteProject
}
model Version {
id String
code String
description String?
timestamp DateTime @default(now())
projectId String
project WebsiteProject
}
model Transaction {
id String
isPaid Boolean @default(false)
planId String
amount Float
credits Int
userId String
user User
}- GitHub account with your code pushed
- Vercel account
- Production database (Neon recommended)
-
Go to vercel.com/new
-
Import your GitHub repository
-
Configure:
- Framework: Other
- Root Directory:
backend - Build Command: (leave empty)
- Output Directory: (leave empty)
-
Add Environment Variables:
DATABASE_URL=<your-neon-production-url> BETTER_AUTH_SECRET=<generate-new-secret> BETTER_AUTH_URL=https://your-backend.vercel.app TRUSTED_ORIGINS=https://your-frontend.vercel.app NODE_ENV=production AI_API_KEY=<your-openrouter-key> STRIPE_SECRET_KEY=<your-stripe-key> STRIPE_WEBHOOK_SECRET=<your-webhook-secret> -
Click Deploy
-
Add new project in Vercel
-
Import same repository
-
Configure:
- Framework: Vite
- Root Directory:
frontend - Build Command:
npm run build - Output Directory:
dist
-
Add Environment Variable:
VITE_BASEURL=https://your-backend.vercel.app -
Click Deploy
After both deployments:
- Go to backend project settings
- Update
TRUSTED_ORIGINSwith actual frontend URL - Update
BETTER_AUTH_URLwith actual backend URL - Redeploy backend
- Go to Stripe Dashboard β Webhooks
- Add endpoint:
https://your-backend.vercel.app/api/stripe - Select events:
payment_intent.succeeded - Copy signing secret
- Update
STRIPE_WEBHOOK_SECRETin Vercel - Redeploy backend
Run migrations on production database:
# Set production database URL
DATABASE_URL="your-production-url" npx prisma migrate deploy# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm test- Sign up / Sign in
- Create new project
- AI generates website
- Make revision
- Save changes
- Rollback to version
- Publish/unpublish
- Download code
- Purchase credits
- Credits added after payment
- β Authentication: Session-based with httpOnly cookies
- β Authorization: All protected endpoints verify user identity
- β CORS: Restricted to trusted origins
- β Environment Variables: Secrets never committed to Git
- β SQL Injection: Protected by Prisma ORM
- β XSS Protection: React automatic escaping
- β Webhook Verification: Stripe signature validation
- β HTTPS: Required in production
- β Rate Limiting: (Recommended for production)
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow TypeScript best practices
- Write meaningful commit messages
- Update documentation for new features
- Ensure all tests pass before submitting PR
This project is licensed under the ISC License.
Ram Muduli
- GitHub: @notramm
- Repository: Zen AI Website Builder
- Better Auth - Authentication solution
- Prisma - Next-generation ORM
- Vercel - Deployment platform
- Neon - Serverless PostgreSQL
- OpenRouter - AI API gateway
- Stripe - Payment processing
- Tailwind CSS - Utility-first CSS
If you have any questions or need help, please:
- Check the documentation
- Search existing issues
- Open a new issue if needed
- Custom Domains: Connect your own domain
- Templates Library: Pre-built website templates
- Component Library: Reusable UI components
- Team Collaboration: Share projects with team members
- Version Comparison: Visual diff between versions
- Export Options: PDF, PNG screenshots
- AI Models: Support for multiple AI models
- Code Editor: In-browser IDE with syntax highlighting
- SEO Tools: Meta tags, sitemap generation
- Analytics: Track website performance
β‘ Zen - Built with β€οΈ using React, Node.js, PostgreSQL, and AI
Transforming ideas into reality, one prompt at a time.