Prerequisites
- Node.js 18 or later
- PostgreSQL database (local or hosted, e.g. Neon)
- pnpm package manager
Installation
Configure environment variables
Copy the example below into a See Environment variables for a full description of each variable.
.env file at the project root and fill in your values:Run database migrations
Project, Message, and CodeFragment tables.Environment variable reference
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string |
UPLOADTHING_TOKEN | Yes | UploadThing API token for file uploads |
OPENAI_API_KEY | Yes | OpenAI API key (required for the code agent) |
ANTHROPIC_API_KEY | No | Anthropic API key (for future model routing) |
GEMINI_API_KEY | No | Google Gemini API key (for future model routing) |
E2B_API_KEY | Yes | E2B Sandbox API key for code execution |
UNSPLASH_API_KEY | Yes | Unsplash access key for image search |
UNSPLASH_SECRET | Yes | Unsplash secret key |
CLERK_PUBLISHABLE_KEY | Yes | Clerk publishable key (server-side) |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | Yes | Clerk publishable key (client-side) |
CLERK_SECRET_KEY | Yes | Clerk secret key |
NEXT_PUBLIC_CLERK_SIGN_IN_URL | Yes | Path for the sign-in page (e.g. /sign-in) |
NEXT_PUBLIC_CLERK_SIGN_UP_URL | Yes | Path for the sign-up page (e.g. /sign-up) |
NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL | Yes | Redirect path after sign-in (e.g. /) |
NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL | Yes | Redirect path after sign-up (e.g. /) |
Next steps
Environment variables
Full reference for every configuration option.
Database setup
Configure and manage your PostgreSQL database with Prisma.
Auth & billing
Set up Clerk authentication and subscription plans.
E2B Sandbox
Create and configure the E2B sandbox template for code execution.