> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keinsaas.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install dependencies and prepare a local KeinSaaS Navigator workspace.

Navigator is a Next.js application managed with `pnpm`.

## Requirements

* Node.js 20 or newer
* pnpm
* PostgreSQL, either local or Docker-managed
* At least one model provider key
* Supabase project if you want avatars, chat attachments, generated images, or knowledge-base uploads

## Install packages

```bash theme={null}
pnpm i
```

## Generate an auth secret

Navigator uses Better Auth. Generate a strong secret and add it to `.env`.

```bash theme={null}
npx @better-auth/cli@latest secret
```

```dotenv theme={null}
BETTER_AUTH_SECRET=your-generated-secret
```

## Run the database

Use the project helper for a local PostgreSQL container:

```bash theme={null}
pnpm docker:pg
```

Or point Navigator at an existing database:

```dotenv theme={null}
POSTGRES_URL=postgres://user:password@host:5432/database
```

## Apply migrations

```bash theme={null}
pnpm db:migrate
```

## Start development

```bash theme={null}
pnpm dev
```

The app runs at `http://localhost:3000`.

## Useful scripts

| Script             | Purpose                              |
| ------------------ | ------------------------------------ |
| `pnpm dev`         | Start the Next.js development server |
| `pnpm build`       | Build for production                 |
| `pnpm start`       | Run the production build             |
| `pnpm build:local` | Build with local cookie settings     |
| `pnpm test`        | Run unit tests                       |
| `pnpm test:e2e`    | Run Playwright tests                 |
| `pnpm check-types` | Run TypeScript checks                |
| `pnpm format`      | Format with Biome                    |
