Skip to main content
The backend is a Next.js 15 application that handles API requests, stores data in Convex, and runs background jobs through Inngest. This guide walks you through getting all three services running locally and building for production.

Prerequisites

  • Node.js 20+ and npm
  • Accounts and API keys for the required services below
The following environment variables are required. The backend will not function without them.
VariableWhere to get it
ANTHROPIC_API_KEYconsole.anthropic.com
E2B_API_KEYe2b.dev
CONVEX_DEPLOYMENTconvex.dev dashboard
NEXT_PUBLIC_CONVEX_URLconvex.dev dashboard
CLERK_SECRET_KEYclerk.com dashboard
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYclerk.com dashboard
Stripe and RevenueCat keys are optional — only needed if you want payment processing.

Local development setup

1

Clone the repository

Clone the repo with all submodules. The mobile app and Expo template are git submodules, so --recurse-submodules is required.
git clone --recurse-submodules https://github.com/sa4hnd/vibra-code.git
cd vibra-code/vibracode-backend
2

Install dependencies

npm install
3

Configure environment variables

Copy the example file and fill in your API keys:
cp .env.example .env.local
Open .env.local and fill in at minimum the six required variables listed above. See the environment variables reference for the full list.
4

Deploy the Convex schema

This pushes your database schema to your Convex deployment. Run this once on first setup, and again any time you change convex/schema.ts.
npx convex deploy
5

Start the Inngest dev server

Inngest handles background jobs — spawning sandboxes and running the AI agent. Start it in a separate terminal:
npx inngest-cli@latest dev
The Inngest dashboard is available at http://localhost:8288. Make sure INNGEST_DEV=true is set in your .env.local.
6

Start the Next.js dev server

In another terminal, start the Next.js server:
npm run dev
The backend runs at http://localhost:3000.Alternatively, use npm run start to start both Next.js and Inngest together with a single command.

Production build

To build a production-optimized bundle:
npm run build
Then start the production server:
npm start
In production, set INNGEST_DEV=false (or remove the variable) and configure Inngest to use a real event key from your Inngest dashboard.

Updating the Convex schema

Whenever you change convex/schema.ts or any file in the convex/ directory, re-deploy your Convex functions:
npx convex deploy

Next steps

Once the backend is running, build the E2B sandbox template so the AI agent has an environment to run in:

Build docs developers (and LLMs) love