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

Install dependencies

3

Configure environment variables

Copy the example file and fill in your API keys:
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.
5

Start the Inngest dev server

Inngest handles background jobs — spawning sandboxes and running the AI agent. Start it in a separate terminal:
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:
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:
Then start the production server:
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:

Next steps

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