A full-stack web application that allows users to generate websites using AI, similar to v0.
- Modern Frontend: React + TypeScript + Tailwind CSS + Vite
- AI-Powered Generation: Uses Google Gemini for website generation
- Live Preview: Real-time preview of generated websites in sandboxed environments
- Code Editor: Monaco editor with syntax highlighting
- Streaming Responses: Real-time streaming of AI responses
- Responsive Design: Works on desktop, tablet, and mobile
├── backend/ # Express.js backend with AI integration
│ ├── src/
│ │ ├── index.ts # Main server file
│ │ ├── prompt.ts # AI system prompts
│ │ └── tools/ # AI tools for file operations
│ └── package.json
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API service layer
│ │ └── types/ # TypeScript type definitions
│ └── package.json
└── README.md
- Node.js (v18 or higher)
- npm or yarn
- E2B API key (for sandboxed environments)
- Google AI API key (for Gemini)
-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
-
Create a
.envfile with your API keys:E2B_API_KEY=your_e2b_api_key_here GOOGLE_API_KEY=your_google_api_key_here PORT=3003
-
Start the backend server:
npm run dev
The backend will be running on
http://localhost:3003
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
The frontend will be running on
http://localhost:5173
POST /prompt- Generate a website from a text promptGET /sandboxes- List all active sandboxesDELETE /sandbox/:sandboxId- Delete a specific sandbox
- Home Page: Enter a prompt describing the website you want to build
- Dashboard:
- Chat with AI in the left panel
- View and edit generated code in the center panel
- Preview the live website in the right panel
- Switch between desktop, tablet, and mobile views
- Express.js
- Google Gemini AI
- E2B Code Interpreter
- TypeScript
- CORS enabled
- React 18
- TypeScript
- Tailwind CSS
- Vite
- React Router
- Monaco Editor
- Lucide React Icons
cd backend
npm run dev # Starts with TypeScript compilation and nodemoncd frontend
npm run dev # Starts Vite dev server with hot reloadBackend:
cd backend
npm run build:prodFrontend:
cd frontend
npm run buildCreate a .env file in the backend directory with:
# E2B API key for sandboxed environments
E2B_API_KEY=your_e2b_api_key_here
# Google AI API key for Gemini
GOOGLE_API_KEY=your_google_api_key_here
# Server port (optional, defaults to 3003)
PORT=3003