Docs
Installation
Installation
Clone the repo, install dependencies, and run the dev server.
Prerequisites
Before you start, make sure you have:
- Node.js 20+ and npm
- A PostgreSQL database (Neon is recommended for serverless deployments)
- Accounts at: OpenAI, Resend, Supabase, Stripe, Upstash
Setup
Clone the repository
git clone <your-repo-url> my-app
cd my-appInstall dependencies
npm installConfigure environment variables
Copy the example env file and fill in your values:
cp .env.example .envSee the Environment Variables page for a complete reference of every variable.
Run the database migration
npm run db:generate
npm run db:migrateThis creates all 14 tables across the three schema files (account.ts, chat.ts, agent.ts) in your PostgreSQL database.
Start the dev server
npm run devVisit http://localhost:3000 to see the app.
After you sign up for the first time, a team is created automatically. This is handled by the databaseHooks.user.create.after hook in lib/auth.ts — no manual setup needed.
Database Commands Reference
| Command | Description |
|---|---|
npm run db:generate | Generate SQL migration files from schema changes |
npm run db:migrate | Apply pending migration files |
npm run db:studio | Open the visual database browser |