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

# Quickstart

> Get the backend running locally and send your first API request.

## Prerequisites

* Node.js 18+
* npm 10+
* PostgreSQL / Supabase database
* Supabase project for dashboard auth
* OpenAI API key

## 1) Install dependencies

```bash theme={null}
npm install
```

## 2) Configure environment

```bash theme={null}
cp apps/api/.env.example apps/api/.env
cp apps/dashboard/.env.local.example apps/dashboard/.env.local
```

Set required values in `apps/api/.env`:

* `DATABASE_URL`
* `SUPABASE_URL`
* `SUPABASE_SERVICE_ROLE_KEY`
* `OPENAI_API_KEY`
* `PORT` (optional, defaults to `3001`)

## 3) Prepare database

```bash theme={null}
npm run -w @actionbot/api db:push
npm run -w @actionbot/api db:seed
```

Then generate a widget token:

```bash theme={null}
npm run -w @actionbot/api db:token
```

## 4) Start services

```bash theme={null}
npm run -w @actionbot/api dev
npm run -w @actionbot/dashboard dev
npm run -w @actionbot/widget dev
```

## 5) Send first chat request

```bash theme={null}
curl -X POST https://platform.watermelonn.app/api/v1/chat/message \
  -H "Authorization: Bearer YOUR_WIDGET_JWT_OR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"Where is my order #1234?"}'
```
