# Quick start

Get Edge running locally in under 10 minutes.

## Prerequisites

* Python 3.12+
* Node.js 18+
* Git
* Docker (for the production-shape run)

## 1. Clone and configure

```bash
git clone https://github.com/NKAP360-dev/edge-app.git
cd edge-app
cp .env.example .env
```

Edit `.env` and set the **minimum** required vars:

```bash
# PocketBase admin (created on first boot)
POCKETBASE_ADMIN_EMAIL=admin@example.com
POCKETBASE_ADMIN_PASSWORD=changeme

# JWT signing
JWT_SECRET=$(openssl rand -hex 32)
```

LLM gateway vars are optional for local dev — the demo flow can run with a stub.

## 2. Install dependencies

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r backend/requirements.txt
npm install
```

## 3. Start everything

```bash
./start.sh
```

This starts PocketBase (:8090), OpsKiln MCP (:8080), backend (:8000), frontend (:3000) in order.

## 4. Open the UI

| URL                           | What             |
| ----------------------------- | ---------------- |
| `http://localhost:3000`       | Edge UI          |
| `http://localhost:8000/docs`  | Swagger API      |
| `http://localhost:8000/redoc` | ReDoc API        |
| `http://localhost:8090/_/`    | PocketBase admin |

## 5. Run your first eval

In the UI:

1. **Datasets** → create a new dataset with use case `QA`.
2. Upload a small CSV or use the import template.
3. **Flow builder** → add nodes `Dataset Selector` → `AI Service Endpoint` → `DeepEval`.
4. Pick metrics: `answer_relevancy`, `hallucination`.
5. Click **Run**. Watch the progress events stream.

## Docker production-shape run

```bash
docker build -t edge .
docker run -d --name edge \
  -p 8080:8080 -p 8000:8000 -p 8090:8090 \
  -v $(pwd)/.env:/app/.env:ro \
  -v $(pwd)/pocketbase/examples/base/pb_data:/app/pocketbase/examples/base/pb_data \
  edge
```

Open `http://localhost:8080`.

## Troubleshooting

| Symptom                        | Fix                                                          |
| ------------------------------ | ------------------------------------------------------------ |
| `port already in use`          | Override via `BACKEND_PORT`, `FRONTEND_PORT`, etc.           |
| `PocketBase admin login fails` | Check `POCKETBASE_ADMIN_PASSWORD` matches and PB is on :8090 |
| `LLM 401`                      | PFX path / bearer token wrong; check `.env`                  |
| `Langfuse client init failed`  | Either unset all `LANGFUSE_*` vars or fix the host URL       |

For environment-specific deployment, see [SaaS](/deployment/saas.md) or [On-prem](/deployment/on-prem.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.edge.nyami.fr/deployment/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
