{"id":29245885,"url":"https://github.com/beam-cloud/lovable-clone","last_synced_at":"2025-08-01T04:17:57.054Z","repository":{"id":302339897,"uuid":"1012095281","full_name":"beam-cloud/lovable-clone","owner":"beam-cloud","description":"A simple clone of lovable.dev using BAML / FastMCP / Beam","archived":false,"fork":false,"pushed_at":"2025-07-01T20:30:30.000Z","size":19570,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-01T21:29:18.191Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beam-cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-01T20:01:19.000Z","updated_at":"2025-07-01T21:25:27.000Z","dependencies_parsed_at":"2025-07-01T21:40:19.163Z","dependency_job_id":null,"html_url":"https://github.com/beam-cloud/lovable-clone","commit_stats":null,"previous_names":["beam-cloud/lovable-clone"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beam-cloud/lovable-clone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-cloud%2Flovable-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-cloud%2Flovable-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-cloud%2Flovable-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-cloud%2Flovable-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beam-cloud","download_url":"https://codeload.github.com/beam-cloud/lovable-clone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-cloud%2Flovable-clone/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263415911,"owners_count":23463109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-03T22:38:25.726Z","updated_at":"2025-08-01T04:17:57.015Z","avatar_url":"https://github.com/beam-cloud.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Lovable Clone - AI-Powered Web App Builder\n\nA real-time AI-powered web application builder inspired by [lovable.dev](https://lovable.dev). This project demonstrates how to build a simple agent using sandboxed environments, MCP servers, and [BAML](https://github.com/BoundaryML/baml). It's hosted on [beam.cloud](https://beam.cloud).\n\n![Lovable Clone Demo](assets/lovable-demo.gif)\n\n\u003e To learn about the architecture in detail, read the full post [on our blog](https://www.beam.cloud/blog/agentic-apps).\n\n## ️ Architecture\n\nThe application consists of four main components:\n\n1. **Model Client** - BAML-based client to talk to LLM in an RPC-like way\n2. **Sandbox Environment** - Isolated compute sandbox for running preview environments (React app we're editing)\n3. **MCP Server** - Tools for managing the sandbox and code operations\n4. **WS-Based Agent** - Real-time server for communication between client and agent\n\n![Architecture Diagram](assets/arch.png)\n\n## 📋 Prerequisites\n\n- Python 3.12+\n- Node.js 20+\n- OpenAI API key\n- [Beam](https://beam.cloud) account for hosting ([sandboxes](https://docs.beam.cloud/v2/sandbox/overview), frontend, mcp server)\n\n## 🛠️ Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/beam-cloud/lovable-clone\n   cd lovable-clone\n   ```\n\n2. **Install Python dependencies**\n\n   ```bash\n   pip install -r requirements.txt\n   # or using uv\n   uv sync\n   ```\n\n3. **Install frontend dependencies**\n\n   ```bash\n   cd frontend\n   npm install\n   ```\n\n4. **Set up secrets**\n   ```bash\n   beam secret create OPENAI_API_KEY 'your-openai-api-key'\n   beam secret create LOVABLE_MCP_URL 'your-mcp-server-url'\n   ```\n\n## 🎯 Usage\n\n### Starting the MCP Server\n\nThe MCP server provides tools for managing sandboxed environments:\n\n```bash\nbeam serve src/tools.py:s\n```\n\nThis starts the FastMCP server with tools for:\n\n- `create_app_environment` - Spins up a new React sandbox\n- `load_code` - Retrieves code from the sandbox\n- `edit_code` - Updates code in the sandbox\n\n### Starting the Agent\n\nThe agent handles real-time communication with the client/frontend:\n\n```bash\nbeam serve src/agent.py:handler\n```\n\n### Running the Frontend\n\n```bash\ncd frontend\nnpm run dev\n```\n\n### End to end flow for iterating on the app:\n\n1. Start the frontend: `cd frontend \u0026\u0026 npm run dev`\n2. In a new terminal, start the MCP server: `beam serve src/tools.py:s` -\u003e copy URL displayed in terminal\n3. In a new terminal window, start the agent: `beam serve src/agent.py:handler` -\u003e modify the URL in src/agent.py to point to the above MCP server URL\n4. In the `frontend` directory, copy `.env.template` to `.env`, and replace the token with your `Beam` [token](https://platform.beam.cloud/settings/api-keys), and the URL with the websocket URL printed in the shell\n5. Start interacting with the app in your browser!\n6. If you want to change the prompt, edit `baml_src/build.baml` and run `make generate` to regenerate the BAML clients\n\n### BAML / Prompts\n\nPrompts are defined in `baml_src/build.baml`:\n\n- **EditCode Function** - Main function for code generation\n- **CodeChanges Schema** - Defines the structure of AI responses\n- **Test Cases** - Validate prompt behavior\n\n### Sandbox/MCP server config\n\nThe sandbox environment is configured in `src/tools.py`:\n\n- Node.js 20 base image\n- React + Vite + shadcn/ui template\n- Additional packages: React Router, Recharts, TanStack Query, etc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeam-cloud%2Flovable-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeam-cloud%2Flovable-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeam-cloud%2Flovable-clone/lists"}