Installatiehandleiding

Deze handleiding legt uit hoe je NeuraWiki (backend + webinterface) installeert, configureert en draait, lokaal of met Docker.

1. Vereisten

  • Python 3.12 en uv
  • Node.js 22 en npm
  • PostgreSQL 16 met de pgvector-extensie (of Docker)
  • Een Groq API-sleutel (GROQ_API_KEY)

2. Snelle start (enkel script)

Vanuit de hoofdmap van het project:

./start.sh

Het script start de database via Docker (indien beschikbaar), start de backend op de achtergrond, wacht tot de API klaar is en start dan de webinterface op de voorgrond. Stoppen met Ctrl+C.

Om alles te stoppen:

./stop.sh

3. Code ophalen en configureren

git clone <repository-url> neurawiki
cd neurawiki
cp .env.example .env

Bewerk .env en stel minimaal in:

GROQ_API_KEY=...
GROQ_MODEL=qwen/qwen3.8-27b
DATABASE_URL=postgresql://neurawiki:neurawiki@localhost:5432/neurawiki

4. Database

Optie A — Docker (aanbevolen):

docker compose up -d db

Optie B — Lokale PostgreSQL: maak de gebruiker en database aan en activeer de extensie:

CREATE USER neurawiki WITH PASSWORD 'neurawiki';
CREATE DATABASE neurawiki OWNER neurawiki;
\c neurawiki
CREATE EXTENSION IF NOT EXISTS vector;

5. Backend (FastAPI API)

cd /home/dominique/neurawiki
uv sync
uv run neurawiki

De API is beschikbaar op http://localhost:8000 (Swagger-docs op /docs). Bij de eerste start wordt het databaseschema automatisch aangemaakt en worden de standaardteams ingevoegd.

6. Webinterface (Next.js)

In een andere terminal:

cd /home/dominique/neurawiki/frontend
npm install
npm run dev

De interface is beschikbaar op http://localhost:3000. De frontend proxiet /api/* naar de backend, waardoor de API same-origin is en de authenticatiecookie automatisch wordt meegestuurd.

7. Documenten inlezen

  1. Plaats documenten in data/knowledge/<Team>/ (md, txt, pdf, xlsx). Metadata kan worden opgegeven in YAML-frontmatter voor md/txt.
  2. Start de ingestie:
uv run neurawiki-ingest

8. Eerste beheerdersaccount

Het endpoint /auth/register is open. Maak een admin-account aan:

curl -X POST http://localhost:8000/auth/register \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"SterkWachtwoord1","team":"Linux","role":"admin","teams":["Linux"]}'

Meld je daarna aan op http://localhost:3000 met deze gegevens.

9. Alles-in-één (Docker Compose)

Voor een volledige start (database + API + interface + monitoring):

cd /home/dominique/neurawiki
# stel GROQ_API_KEY in in .env
docker compose up --build

Beschikbare services:

  • Interface (Next.js): http://localhost:3000
  • API (FastAPI): http://localhost:8000
  • Prometheus: http://localhost:9090
  • Grafana: http://localhost:3001 (admin / admin)

10. Handige commando's

ActieCommando
API startenuv run neurawiki
UI starten (dev)cd frontend && npm run dev
UI bouwen (prod)cd frontend && npm run build && npm run start
Inlezenuv run neurawiki-ingest
Python-testsuv run pytest -q
Frontend lintcd frontend && npm run lint
End-to-end testscd frontend && npm run test:e2e

11. Stoppen

# Lokaal: Ctrl+C in elk terminalvenster
# Docker:
docker compose down

Om ook de opgeslagen gegevens te verwijderen:

docker compose down -v