Cube is a generative AI application that allows you to describe a web page or component in plain English and watch as it gets built and deployed in real-time. It leverages a sophisticated multi-agent system to interpret requests, write code, and run it in a secure cloud environment.
- From Idea to Live App, Instantly: Describe the web application you want, and our AI will build and deploy it for you in real-time.
- Live, Interactive Previews: See your generated website come to life in a real-time preview and interact with it as you build.
- Live & Secure Sandboxes (Powered by E2B): Each project is built in a dedicated cloud sandbox, providing a secure, instantly-deployed environment and a shareable live URL.
- Full Code Access & Transparency: Get complete access to the generated source code, with the ability to view and download it at any time.
Cube's magic lies in its robust, event-driven architecture that coordinates multiple services to turn a prompt into a running web application.
- User Prompt: The user submits a request through the Next.js web interface.
- Orchestration Layer: An Inngest function picks up the request and begins a durable, long-running workflow.
- Secure Sandbox Creation: Inngest spins up a secure, isolated E2B cloud sandbox for the AI to work in.
- AI Code Generation: A Google Gemini-powered AI agent is invoked inside the sandbox. It has access to a file system, a terminal, and other tools necessary to build a web application.
- Real-Time Deployment: As the agent works, it runs a development server inside the sandbox, which is exposed via a secure, public URL for the user to preview.
- Saving the Result: Once the build is complete, the final code is saved to the database via Prisma, and the user is presented with the final result.
- Framework: Next.js
- Language: TypeScript
- AI Orchestration: Inngest
- AI Sandboxing: E2B
- AI Model: Google Gemini
- Database: PostgreSQL via Prisma
- Authentication: Clerk
- UI: Tailwind CSS & Shadcn UI
- Deployment: Vercel
Follow these instructions to set up and run the project on your local machine.
- Node.js (v20.x or later)
- Bun
- Git
- PostgreSQL
git clone https://github.com/your-username/cube.git
cd cubebun installCreate a .env.local file in the root of the project by copying the example file:
cp .env.example .env.localNow, fill in the required values in .env.local:
# Prisma
DATABASE_URL="postgresql://user:password@host:port/database"
# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
# Inngest
INNGEST_EVENT_KEY=
INNGEST_SIGNING_KEY=
# E2B
E2B_API_KEY=
# Google Gemini
GOOGLE_API_KEY=Run the Prisma migrations to set up your database schema.
bunx prisma migrate devNow you can start the development server:
bun run devOpen http://localhost:3000 with your browser to see the result.
Pull requests are welcome! Feel free to fork this repo, open issues, and suggest enhancements.
This project is licensed under the MIT License. See the LICENSE file for details.
Gaurav Vashisth
Github | Email: gauravvashisth365@gmail.com
Aryan Shandilya
Deepansh Sharwan
