A lightweight Lovable clone showcasing Mesa Code Storage and Vercel Sandbox.
- Create a project - Creates a new Git repository in Mesa
- Describe what you want - AI generates React code using Claude
- See it live - Code is saved to Mesa and previewed in a Vercel Sandbox
- Next.js - React framework
- Mesa - Programmatic Git hosting for AI agents
- Vercel Sandbox - Ephemeral Linux VMs for live previews
- Vercel AI SDK - Streaming AI responses with Anthropic Claude
- Tailwind CSS - Styling
- shadcn/ui - UI components
- Clone the repository:
git clone https://github.com/mesa-dot-dev/site-builder-example
cd site-builder-example- Install dependencies:
bun install- Link to Vercel and pull environment variables:
vercel link
vercel env pull .env.local- Add your API keys to
.env.local:
MESA_API_KEY=your_mesa_api_key
MESA_ORG=your_mesa_org
ANTHROPIC_API_KEY=your_anthropic_api_key- Run the development server:
bun run devMesa provides programmatic Git repositories without needing local clones. This example uses Mesa to:
- Create a new repository for each project (
POST /api/projects) - Save generated code as commits (
mesa.commits.create()) - Retrieve code history (
mesa.commits.list())
// Create a commit with the generated code
await mesa.commits.create({
org: "your-org",
repo: "project-abc123",
body: {
branch: "main",
message: "AI: Build a todo app",
author: { name: "AI Builder", email: "ai@example.com" },
files: [{ path: "App.tsx", content: code, action: "upsert" }],
},
});Vercel Sandbox provides ephemeral Linux VMs to run the generated code:
// Create a sandbox and start a dev server
const sandbox = await Sandbox.create({
runtime: "node24",
ports: [3000],
timeout: 5 * 60 * 1000,
});
await sandbox.writeFiles([{ path: "App.tsx", content: Buffer.from(code) }]);
await sandbox.runCommand("bun", ["install"]);
await sandbox.runCommand({ cmd: "bun", args: ["run", "dev"], detached: true });
const previewUrl = sandbox.domain(3000);POST /api/projects- Create a new Mesa repositoryPOST /api/generate- Stream AI code generation, save to Mesa, create sandbox preview
MIT