An AI-powered website builder that allows users to quickly create and edit websites through drag-and-drop interface and AI-assisted content generation.
AI Web Builder is a modern web application that combines a visual editor with AI-powered content generation capabilities. Users can leverage simple prompts to have AI generate professional content and styles for various sections of their websites, similar to modern website builders like Wix.
- π¨ Visual Editor - Intuitive drag-and-drop interface for designing websites
- π€ AI Content Generation - Uses Google Gemini AI to intelligently generate website content and styles
- π± Responsive Preview - Supports three viewport modes: desktop, tablet, and mobile
- π― Element Management - Supports various website element types (navbar, hero, text, images, buttons, features, footer, etc.)
- βοΈ Property Editing - Real-time editing of element content and styles
- π User Authentication - JWT-based user authentication system
- πΎ Data Persistence - Uses Prisma ORM with SQLite database
- Framework: React 19.2
- Build Tool: Vite 6.2
- Language: TypeScript 5.8
- Dependencies:
- React DOM 19.2
- Google GenAI SDK 1.30
- Framework: Express 5.1
- Database: SQLite + Prisma ORM 5.22
- Authentication: JWT + bcryptjs
- Email Service: Nodemailer 7.0
- Utilities: Cookie Parser, CORS, UUID
ai-web-builder/
βββ App.tsx # Main application component
βββ index.tsx # Application entry point
βββ index.html # HTML template
βββ types.ts # TypeScript type definitions
βββ package.json # Frontend dependencies
βββ vite.config.ts # Vite configuration
βββ tsconfig.json # TypeScript configuration
βββ vercel.json # Vercel deployment config
βββ metadata.json # Project metadata
β
βββ components/ # React components
β βββ EditorCanvas.tsx # Editor canvas component
β βββ Sidebar.tsx # Sidebar (element selection)
β βββ PropertiesPanel.tsx # Properties editing panel
β βββ Icons.tsx # Icon components
β
βββ services/ # Service layer
β βββ geminiService.ts # Google Gemini AI service
β
βββ app/ # App-related files
βββ docs/ # Documentation files
β
βββ server/ # Backend service
βββ package.json # Backend dependencies
βββ tsconfig.json # TypeScript configuration
β
βββ src/
β βββ index.ts # Server entry point
β βββ jwt.ts # JWT utilities
β βββ mail.ts # Email service
β βββ prisma.ts # Prisma client config
β β
β βββ routes/
β βββ auth.ts # Authentication routes
β
βββ prisma/
βββ schema.prisma # Prisma database schema
βββ migrations/ # Database migration files
| Element Type | Description |
|---|---|
SECTION |
Generic container area |
HERO |
Hero section (large banner) |
TEXT_BLOCK |
Text block |
IMAGE |
Image element |
BUTTON |
Button element |
FEATURES |
Features list |
NAVBAR |
Navigation bar |
FOOTER |
Footer |
-
Install Dependencies
npm install
-
Start Development Server
npm run dev
The application will run at
http://localhost:5173 -
Build Production Version
npm run build
-
Preview Production Build
npm run preview
-
Navigate to Server Directory
cd server -
Install Dependencies
npm install
-
Configure Environment Variables Create a
.envfile with the following environment variables:DATABASE_URL="file:./dev.db" JWT_SECRET="your-secret-key" API_KEY="your-google-gemini-api-key" MAIL_USER="your-email@gmail.com" MAIL_PASS="your-app-password" -
Set Up Database
npm run prisma:migrate
-
Start Development Server
npm run dev
-
Open Prisma Studio (Visual Database Manager)
npm run prisma:studio
- Main canvas for website preview and editing
- Supports element selection, deletion, and drag-to-reorder
- Real-time style updates
- Provides selection of all available element types
- Supports AI prompt input
- Quick element addition
- Edit selected element's content and styles
- Supports basic CSS property modification
- Real-time preview of changes
- Integrates with Google Gemini 2.5 Flash model
- Generates professional website content based on user prompts
- Generates appropriate styles and color schemes
- User registration/login
- JWT token management
- Secure password storage (bcryptjs)
- Account verification emails
- Password reset emails
- Nodemailer integration
The project is configured for Vercel deployment using the vercel.json file.
Deployment Steps:
- Connect your GitHub repository to Vercel
- Environment variables will be read from Vercel dashboard
- Push to main branch to trigger automatic deployment
API_KEY- Google Gemini API key (get from https://ai.google.dev)
DATABASE_URL- SQLite database connection string
JWT_SECRET- JWT signing secret
MAIL_USER- Gmail accountMAIL_PASS- Gmail app password
- Package Manager: npm
- Code Language: TypeScript/TSX
- Formatting: Built-in Vite support
- Database Manager: Prisma Studio
- Add new type to
ElementTypeenum intypes.ts - Define default values in
getDefaultContent()andgetDefaultStyles()inApp.tsx - Add UI controls in
Sidebar.tsx - Add rendering logic in
EditorCanvas.tsx
- Edit
server/prisma/schema.prisma - Run
npm run prisma:migrate - Enter migration name
- Modify
systemInstructionand schema definition inservices/geminiService.ts
ISC
We welcome issue reports and pull requests!