Open-source version of Lovable - an AI agent that can make websites and apps through a chat interface.
For guidance on building app builders with AI, see the Freestyle guide on Building an App Builder.
- Chat interface for interacting with AI code assistants
- Patch-based code editing with user approval
- Git integration for version control
- Preview capabilities for code changes
- Node.js
- PostgreSQL database (Neon is easy and has a good free tier)
- Redis (for caching and session management)
- Anthropic API key
- Freestyle API key
- Morph API key (optional)
-
Clone the repository:
git clone https://github.com/freestyle-sh/adorable cd adorable
-
Install dependencies:
npm install
-
Get a Freestyle API key
Head to our API keys page to get yours. We're totally free to use right now!
-
Set up environment variables: Create a
.env
file in the root directory with the following variables:# Database DATABASE_URL=postgresql://username:password@localhost:5432/adorable # Anthropic API ANTHROPIC_API_KEY=your_anthropic_api_key # Freestyle API FREESTYLE_API_KEY=your_freestyle_api_key
-
Initialize the database:
npx drizzle-kit push
-
Set up Redis
The easiest way to run Redis locally is with Docker:
docker run --name adorable-redis -p 6379:6379 -d redis
This will start a Redis server on port 6379. If you already have Redis running, you can skip this step.
Add the following to your .env
file (if not already present):
REDIS_URL=redis://localhost:6379
- Set up Stack Auth
Go to the Stack Auth dashboard and create a new application. In Configuration > Domains, enable Allow all localhost callbacks for development
to be able to sign in locally.
You'll need to add the following environment variables to your .env
file:
NEXT_PUBLIC_STACK_PROJECT_ID=<your-project-id>
NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY=<your-publishable-client-key>
STACK_SECRET_SERVER_KEY=<your-secret-server-key>
- Add a Preview Domain (optional)
Go to the Freestyle dashboard and verify a new domain. Then follow the DNS Instructions to point your domain to Freestyle.
Finally, add the following environment variable to your .env
file:
PREVIEW_DOMAIN=<your-domain> # formatted like adorable.app
- Add Morph for Fast Apply (optional)
Get a Morph API key from morphllm.com and add it to your .env
file to enable the fast edit tool:
MORPH_API_KEY=<your-morph-api-key>
This automatically enables the Morph fast edit tool which provides faster code modifications.
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
- Forking Guide - Comprehensive guide for developers working with this codebase
For production deployment:
npm run build
npm run start
Or use the included deployment script:
./deploy.sh