Skip to content
/ cube Public

An AI-powered application that builds, previews, and codes Next.js websites from conversational prompts using Gemini, Inngest, and E2B sandboxes.

License

Notifications You must be signed in to change notification settings

r2adio/cube

Repository files navigation

Cube Logo

Cube

Create fully-functional web applications by chatting with an AI.

Deploy with Vercel

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.

Cube Application Demo

✨ Key Features

  • 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.

⚙️ How It Works

Cube's magic lies in its robust, event-driven architecture that coordinates multiple services to turn a prompt into a running web application.

  1. User Prompt: The user submits a request through the Next.js web interface.
  2. Orchestration Layer: An Inngest function picks up the request and begins a durable, long-running workflow.
  3. Secure Sandbox Creation: Inngest spins up a secure, isolated E2B cloud sandbox for the AI to work in.
  4. 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.
  5. 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.
  6. 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.

🚀 Tech Stack

🏁 Getting Started

Follow these instructions to set up and run the project on your local machine.

Prerequisites

1. Clone the Repository

git clone https://github.com/your-username/cube.git
cd cube

2. Install Dependencies

bun install

3. Set Up Environment Variables

Create a .env.local file in the root of the project by copying the example file:

cp .env.example .env.local

Now, 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=

4. Set Up the Database

Run the Prisma migrations to set up your database schema.

bunx prisma migrate dev

5. Run the Development Server

Now you can start the development server:

bun run dev

Open http://localhost:3000 with your browser to see the result.

🤝 Contributing

Pull requests are welcome! Feel free to fork this repo, open issues, and suggest enhancements.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

📬 Author

Gaurav Vashisth
Github | Email: gauravvashisth365@gmail.com

🫂 Contributors

Aryan Shandilya
Deepansh Sharwan

About

An AI-powered application that builds, previews, and codes Next.js websites from conversational prompts using Gemini, Inngest, and E2B sandboxes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages