Architektur
Grundprinzipien
Section titled “Grundprinzipien”- Supabase PostgREST ist die API — es wird KEINE eigene REST-API gebaut (kein FastAPI, Express, Django). PostgREST liefert automatisch REST-Endpoints.
- Supabase Auth für Authentifizierung — KEINE eigene Auth-Lösung.
- Edge Functions (Deno/TypeScript) für Custom-Logik.
- Kein LLM auf dem VPS — Ollama läuft lokal auf dem Keller-PC.
- Keine neuen Services ohne explizite Chef-Freigabe.
Tech Stack
Section titled “Tech Stack”| Komponente | Technologie | |---|---| | Frontend | Next.js 14, TypeScript, Tailwind | | Backend / API | Supabase (PostgreSQL, PostgREST, Auth, Storage) | | Automatisierung | n8n | | Reverse Proxy | Caddy (Wildcard-SSL via Let’s Encrypt) | | Container | Docker (Netzwerk: supabase_default) | | OCPP | CitrineOS | | PDF-Erzeugung | Gotenberg | | E-Mail | Postal | | Kanban | Planka | | Analytics | Umami |
Datenbank-Konventionen
Section titled “Datenbank-Konventionen”- Nur über versionierte SQL-Migrationen in ~/hausmeter/migrations/
- Multi-Tenancy: tenant_id (UUID) auf jeder Tabelle
- UUIDs als Primary Keys:
id UUID PRIMARY KEY DEFAULT gen_random_uuid() - Timestamps:
created_at TIMESTAMPTZ DEFAULT now(),updated_at TIMESTAMPTZ DEFAULT now() - Tabellennamen: englisch, Plural, snake_case
- Enums: Deutsch (z.B. ‘entwurf’ statt ‘draft’)
- Rollen-Hierarchie: admin > hausverwaltung > eigentuemer > manager > hausmeister > mieter
Deployment
Section titled “Deployment”- Frontend:
cd ~/hausmeter/frontend && docker compose up -d --build - Edge Functions:
cd ~/services/supabase/supabase/docker && docker compose restart supabase-edge-functions - Alle Services unter *.hausmeter.com
- Automatisierter Workflow via SSH + git + docker
LLM-Strategie
Section titled “LLM-Strategie”- Ollama läuft LOKAL auf dem Keller-PC — NIEMALS auf dem VPS
- RAG Kundensupport Agent = Nice-to-have Addon, NICHT systemrelevant
- Teamchef (Opus) koordiniert, Sonnet baut Features