# Install and configure anan2

Follow the source instructions for **anan2**. Read the prerequisites and configuration steps before running an example.

## Setup

### 1. Configure Convex

```bash
npx convex dev
```

### 2. Convex Auth (JWT keys)

Generate JWT keys for Convex Auth:

```bash
node generateKeys.mjs
```

Copy the output and add to Convex Dashboard **Environment Variables**:

- `JWT_PRIVATE_KEY` - from output
- `JWKS` - from output
- `SITE_URL` - e.g. `http://localhost:5173` (or your deployment URL)
- `ADMIN_EMAILS` - (optional) comma-separated emails for admin role, e.g. `admin@example.com`

### 3. Environment Variables

**Convex** (set via `npx convex env set` or Dashboard):

- `OPENROUTER_API_KEY` - For AI content generation
- `OPENAI_API_KEY` - For RAG embeddings (text-embedding-3-small)
- `VAPID_PUBLIC_KEY` - Web push (from `npx web-push generate-vapid-keys`)
- `VAPID_PRIVATE_KEY` - Web push private key

**Local** (`.env.local`):

- `VITE_CONVEX_URL` - Convex deployment URL
- `VITE_VAPID_PUBLIC_KEY` - Same as VAPID_PUBLIC_KEY (for client subscribe)

### 4. Run

```bash
npm run dev
```

## Check the installation

After setup, continue with the [first example](/docs/up-to-code-anan2/quick-start-guide). If a command fails, compare the runtime version, working directory, and required configuration with the original README before changing dependencies.

## Source and help

- [GitHub repository](https://github.com/Up-to-code/anan2)
- [Original README](https://github.com/Up-to-code/anan2/blob/main/README.md)
- [Issues and existing reports](https://github.com/Up-to-code/anan2/issues)
