Docs
Installation

Installation

Clone the repo, install dependencies, and run the dev server.

Prerequisites

Before you start, make sure you have:

Setup

Clone the repository

git clone <your-repo-url> my-app
cd my-app

Install dependencies

npm install

Configure environment variables

Copy the example env file and fill in your values:

cp .env.example .env

See the Environment Variables page for a complete reference of every variable.

Run the database migration

npm run db:generate
npm run db:migrate

This 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 dev

Visit 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

CommandDescription
npm run db:generateGenerate SQL migration files from schema changes
npm run db:migrateApply pending migration files
npm run db:studioOpen the visual database browser