A browser-based IDE where users describe a website, and an AI agent plans, creates files, verifies, and shows a live preview.
- AI-Powered Planning: Describe your website in natural language, get a detailed implementation plan
- In-Memory Filesystem: All files stored in memory, with export/import as ZIP
- Monaco Editor: Professional code editing experience
- Live Preview: See your changes in real-time
- Incremental Building: Step-by-step implementation with verification
- Surgical Edits: Smart code modifications that preserve existing work
- No Auth, No DB: Simple, focused MVP with minimal dependencies
- Next.js 15+ (App Router, TypeScript)
- Monaco Editor for code editing
- OpenAI API for AI assistance
- Tailwind CSS for styling
- esbuild for bundling (planned)
- Node.js 18+
- OpenAI API key
- Clone the repository:
git clone <your-repo-url>
cd lovable2- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.localEdit .env.local and add your OpenAI API key:
OPENAI_API_KEY=sk-your-key-here
- Start the development server:
npm run dev- Open http://localhost:3000 in your browser
Click "New Plan" and describe the website you want to build. The AI will:
- Derive a detailed specification
- Create an implementation plan
- Break it down into actionable steps
Click "Build" to execute the current step. The AI will:
- Generate necessary files
- Make surgical edits to existing files
- Update the file tree
Click "Verify" to check for syntax errors and common issues.
Click "Preview" to see your website in action (simplified preview in current version).
Click "Refine" to make changes. Describe what you want to change, and the AI will:
- Search for relevant code
- Make minimal, targeted edits
- Preserve existing functionality
- Export: Download your project as a ZIP file
- Import: Upload a ZIP file to restore a project
/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ │ ├── agent/ # AI agent endpoints
│ │ └── fs/ # File system operations
│ ├── layout.tsx
│ └── page.tsx # Main IDE interface
├── components/ # React components
│ ├── Editor.tsx # Monaco editor
│ ├── Preview.tsx # Live preview iframe
│ ├── Logs.tsx # Activity logs
│ ├── Todos.tsx # Implementation plan
│ └── CommandBar.tsx # Action buttons
├── lib/
│ ├── agent/ # AI orchestration
│ │ ├── orchestrator.ts
│ │ ├── policies.ts
│ │ └── openai.ts
│ ├── runner/ # File operations
│ │ ├── fsMemory.ts
│ │ ├── fsOps.ts
│ │ ├── bundler.ts
│ │ └── verify.ts
│ └── util/ # Utilities
│ ├── z.ts # Zod schemas
│ ├── logger.ts
│ └── zip.ts
└── styles/
└── globals.css
- INTENT: User describes desired website
- PLAN: AI creates detailed spec and implementation plan
- SCAFFOLD/EDIT: AI generates or modifies files
- VERIFY: Basic syntax and structure checks
- PREVIEW: Live rendering in iframe
- ITERATE: User refinements trigger targeted edits
Generated websites include:
- Hero: Compelling headline and CTA
- Features: Key features grid
- Use Cases: Real-world applications
- Testimonials: Social proof
- FAQ: Common questions
- Footer: Links and copyright
All sections are:
- Fully responsive (mobile-first)
- Accessible (ARIA labels, semantic HTML)
- Modern design (2xl radii, soft shadows)
- Animated (Framer Motion)
GET /api/fs/list- Get file treeGET /api/fs/read?path=<path>- Read filePOST /api/fs/write- Write filePOST /api/fs/edit- Edit file (surgical)GET /api/fs/export- Export as ZIPPOST /api/fs/import- Import ZIP
POST /api/agent/plan- Create implementation planPOST /api/agent/run- Execute step (BUILD/VERIFY/PREVIEW/REFINE)
OPENAI_API_KEY- Required for AI featuresOPENAI_MODEL- Optional (default: gpt-4o)- Recommended:
gpt-4o(128k context, 16k max output) - Alternative:
gpt-4-turbo(128k context, 4k max output) - Alternative:
gpt-4(8k context, 8k max output)
- Recommended:
npm run build
npm start- Preview uses simplified HTML (full esbuild bundling coming soon)
- In-memory only (no persistence between sessions without export/import)
- Single user (no collaboration features)
- No authentication or billing
- OpenAI API required (no offline mode)
- Full esbuild-wasm bundling for preview
- Multi-file editing with tabs
- Git integration
- Component library browser
- Template marketplace
- Real-time collaboration
- Deployment integration
This is an MVP. Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT
For issues or questions, please open an issue on GitHub.
Built with ❤️ using Next.js, OpenAI, and modern web technologies.