Open Lovable is an open source project that allows users to quickly generate React application code by chatting with AI. The project is developed by MendableAI and hosted on GitHub. It integrates the E2B sandbox environment and the Firecrawl web crawler tool, and supports multiple AI models (such as Anthropic, OpenAI or Groq) to generate code. Users can quickly start the development environment locally by simply cloning the code, configuring API keys and running the project.Open Lovable Ideal for developers looking to accelerate React development through natural language interaction, the project is under the MIT license and is free and open for use.
Function List
- AI chat generates code: Quickly generate React components, pages, or full application code by talking to AI through natural language.
- Support for multiple AI models: Compatible with Anthropic, OpenAI, and Groq APIs for flexible choice of AI providers.
- E2B sandbox environment: Provide a secure code runtime environment that ensures isolation of code testing and execution.
- Firecrawl: Support for extracting data from web pages to assist in generating dynamic content or referencing external resources.
- Local Development Support: By means of a simple
npm run dev
command to quickly start the local development server. - Open source and free: Based on the MIT license, which allows users to freely use, modify and distribute the code.
Using Help
Installation process
To get started with Open Lovable, you'll need to complete the following steps to set up your development environment. The whole process is straightforward and suitable for developers familiar with Node.js and React.
1. Clone the project and install dependencies
First, you need to clone the Open Lovable codebase from GitHub and install the necessary dependencies. Open a terminal and execute the following command:
git clone https://github.com/mendableai/open-lovable.git
cd open-lovable
npm install
git clone
: Download the project code locally from GitHub.cd open-lovable
: Enter the project catalog.npm install
: Install project dependencies, including necessary libraries such as React, Node.js, etc. Make sure you have Node.js installed on your computer (recommended version 16 or above).
2. Configuring environment variables
Open Lovable relies on an external API service, you need to create a.env.local
file and add the following API key:
# 必须配置
E2B_API_KEY=your_e2b_api_key # 从 https://e2b.dev 获取,用于沙箱环境
FIRECRAWL_API_KEY=your_firecrawl_api_key # 从 https://firecrawl.dev 获取,用于网页抓取
# 可选配置(至少选择一个AI提供商)
ANTHROPIC_API_KEY=your_anthropic_api_key # 从 https://console.anthropic.com 获取
OPENAI_API_KEY=your_openai_api_key # 从 https://platform.openai.com 获取
GROQ_API_KEY=your_groq_api_key # 从 https://console.groq.com 获取,推荐Kimi K2模型
- Getting the API key::
- E2B_API_KEY: Access
https://e2b.dev
, register and get an API key for the sandbox environment to run and test code. - FIRECRAWL_API_KEY: Access
https://firecrawl.dev
If you want to get the API key for web crawling, you can use it to extract data from external web pages. - AI Provider Key: You can choose any of the AI services from Anthropic, OpenAI or Groq. Visit the corresponding website to register and get an API key. Configure at least one AI key, recommend using Groq's Kimi K2 model for faster inference.
- E2B_API_KEY: Access
- establish
.env.local
file: Use a text editor (e.g. VS Code) in the project root directory to create the.env.local
file, copy the above template and fill in your key. After saving, the project will automatically load these configurations.
3. Running the project
After the configuration is complete, run the following command to start the development server:
npm run dev
- After the command is executed, the project is started locally by accessing the
http://localhost:3000
You can access the Open Lovable interface. - Make sure port 3000 is not occupied. If there is a port conflict, change the port in the project configuration file.
Main Functions
AI Chat Generates React Code
Open Lovable's core function is to generate React code via AI chat. Openhttp://localhost:3000
, you will see a chat screen. Here's how it works:
- input requirement: Enter your development requirements in the chat box, such as "Create a React component with buttons" or "Generate a page that displays a list of users".
- AI Response: AI will generate React code snippets (e.g. JSX, CSS or full component code) based on your description. The generated code will be displayed in the interface and you can copy it directly to your project to use it.
- Adjustment requirementsIf the result is not as expected, you can continue to talk to the AI to add or modify requirements, such as "add a click event" or "change the button to blue".
- Supported AI models: Depending on the API key you configure, the AI will call models from Anthropic, OpenAI, or Groq. Groq's Kimi K2 model is recommended for its speed.
Using the E2B sandbox environment
The E2B Sandbox provides a secure and isolated environment for code execution. After generating the code, you can select the "Run" or "Test" option in the interface and the code will be automatically executed in the E2B sandbox:
- code testing: AI-generated code is run in a sandbox and you can view the results (e.g. component rendering effects).
- error debugging: If there is an error in the code, the sandbox will return an error message and you can follow the prompts to continue talking to the AI to optimize the code.
- safety: The E2B sandbox ensures that code runs without affecting the local environment and is suitable for testing complex logic.
web crawler
Firecrawl's integrated web crawling feature allows you to extract data from external websites to assist in generating dynamic content:
- operating method: Enter commands like "Get headlines and images from a website" or "Grab a list of the latest news" into the chat interface.
- Results processing: Firecrawl returns structured data (e.g., titles, links, or image URLs in JSON format), and AI generates the appropriate React components based on this data.
- typical exampleInput "Crawl a list of articles from a blog site and generate a React component", AI will call Firecrawl to crawl the data and then generate a React list component that displays the titles of the articles.
caveat
- API Key Security: Don't put
.env.local
The file is uploaded to GitHub or another public platform to avoid leaking the key. - network connection: Make sure your computer is connected to the Internet, as AI model calls and web crawls require access to external APIs.
- performance optimization: If the AI response is slow when generating complex components, try choosing Groq's Kimi K2 model for speed.
- Project Extension: You can modify Open Lovable's code based on the MIT license, add custom features or integrate other tools.
application scenario
- Rapid Prototyping
Developers can prototype React applications in minutes with AI. For example, typing "create a login page" generates a React component with input boxes, buttons, and styles, perfect for quickly validating a product idea. - Learning React Development
Beginners can learn to write React code by talking to the AI, which generates clear code and optimizes it step-by-step according to the requirements, helping users understand the structure and logic of React components. - Dynamic content generation
Combined with Firecrawl's web crawling capabilities, developers can quickly generate React components based on external data, such as dynamic pages displaying news, product listings, or social media content. - Teamwork
Development teams can utilize Open Lovable to quickly generate code snippets and reduce manual coding time. The generated code can be directly integrated into existing React projects, improving collaboration efficiency.
QA
- What AI models does Open Lovable support?
API support for Anthropic, OpenAI, and Groq. you will need to add a new API in the.env.local
Configure at least one AI provider's key in. It is recommended to use Groq's Kimi K2 model for faster code generation. - How to get API keys for E2B and Firecrawl?
interviewshttps://e2b.dev
Register to get the E2B Sandbox API key; visit thehttps://firecrawl.dev
Sign up for a web crawler API key. The registration process is simple and usually requires email verification. - What if there is an error in the code generated by the AI?
Describe the error in the chat interface or ask the AI to optimize the code, e.g., "Fix button clicks that don't work." The AI analyzes the problem and provides the corrected code. - Can Open Lovable be used offline?
No. Open Lovable relies on external AI models and web crawling APIs and requires a stable internet connection. - Is there a fee for the program?
Open Lovable itself is free (MIT license), but external APIs used (e.g., E2B, Firecrawl, or AI models) may require a fee, depending on the service provider's pricing.