Zum Inhalt springen

Installation

TeamVis läuft als Next.js 16 standalone Container mit Supabase (Postgres + Storage) als Backend. Empfohlen für die Bereitstellung: Caddy als Reverse-Proxy mit Auto-HTTPS.

Voraussetzungen

  • Linux-VPS (1 vCPU, 2 GB RAM reichen für ~200 MA)
  • Docker + Docker Compose
  • Supabase-Projekt (gehostet bei supabase.com oder self-hosted — das Projekt nutzt nur das Postgres-/Storage-Schema, keine Supabase-Auth)
  • Domain mit DNS-A-Record auf den Server

Schritt 1 — Repo klonen

Terminal-Fenster
git clone https://gitlab.example.com/teamvis.git /opt/teamvis
cd /opt/teamvis

Schritt 2 — .env

Lege /opt/teamvis/.env an:

Terminal-Fenster
NEXT_PUBLIC_SUPABASE_URL=https://<project>.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOi…
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOi…
SESSION_SECRET=<min 32 Zeichen Zufall>
NEXT_PUBLIC_SITE_URL=https://team.deine-domain.de
# Optional: SMTP für Self-Service-Portal
SMTP_HOST=mail.beispiel.de
SMTP_PORT=587
SMTP_SECURE=false
SMTP_PASS=
SMTP_FROM_EMAIL=[email protected]
SMTP_FROM_NAME=TeamVis

Schritt 3 — Migrationen einspielen

In Supabase SQL Editor (oder via psql) alle Migrationen aus supabase/migrations/ in numerischer Reihenfolge ausführen.

Das sind Stand 2026-05 die Migrationen 0001_rls.sql bis 0026_magic_link_tokens.sql.

Schritt 4 — Container bauen + starten

Terminal-Fenster
docker compose build app
docker compose up -d

Schritt 5 — Caddy

/etc/caddy/Caddyfile:

team.deine-domain.de {
reverse_proxy 127.0.0.1:3001
}

sudo systemctl reload caddy — Caddy holt automatisch ein Let’s-Encrypt-Zertifikat.

Schritt 6 — Erster Admin

Direkt in Supabase, Tabelle admin_users:

insert into admin_users (email, password_hash)
values ('[email protected]', '<bcrypt-hash>');

bcrypt-Hash erzeugen z.B. mit htpasswd -nbBC 12 "" PASSWORT | tr -d ':\n' | sed 's/$2y/$2a/'.

Schritt 7 — Storage-Bucket

In Supabase: Storage → Bucket employee-photos anlegen, Public. RLS-Policies kommen aus Migration 0001.

Updates

Terminal-Fenster
cd /opt/teamvis
git pull --rebase
docker compose build app
docker compose up -d --force-recreate

Bei neuen Migrationen: in Supabase SQL Editor ausführen, bevor der Container neu startet.