Architektur
Kurzüberblick — Details in verlinkten Docs und im Code.
Systemkontext
Browser / Portale → Next.js (Coolify) → Postgres (gutachtenos)
↓
GoTrue · Storage · Graph · ResendMulti-Tenancy
- Jede fachliche Tabelle: tenant_id + RLS
- Rollen: super_admin, tenant_admin, tenant_user, Anwalt via app_metadata.role lawyer
- Service Role Key nur serverseitig
Feature-Module
Pattern: src/features/NAME/ — Beispiele: auth, cases
actions/ # Server Actions (Zod-validiert)
components/ # UI
lib/ # Hilfsfunktionen
index.ts # Public exportsIntegrationen
| Integration | Pfad / Cron |
|---|---|
| Microsoft 365 | src/services/integrations/, OAuth pro User |
| E-Mail Ingest | Cron email-ingest 06:00 |
| Outlook Kalender | Cron outlook-calendar-import 06:30 |
| SharePoint DMS | Graph Sync, Cron sharepoint-revisions |
| Actaport | Push + Doc-Sync (Beta) |
| KI | Tenant-scoped, Budget-Cap in Integration Settings |
Cron-Shell auf App-VPS: /root/gutachtenos-cron.sh
Deploy-Pipeline
- Push main → GitHub Actions docker-image.yml
- Build Dockerfile.build → GHCR
- Coolify zieht latest-Tag, Health-Check /api/health
Dokumentations-Site
| Aspekt | Detail |
|---|---|
| Tool | VitePress in docs-site/ |
| Quelle | docs/ (Markdown, Single Source of Truth) |
| Build | docs-site/.vitepress/dist nach npm run build |
| URL | docs.gutachtenos.pxl.systems (statisch, eigene Coolify-App) |
| Ausgeschlossen | docs/pilot/, Kunden-Lastenheft, interne Roadmaps |
Warum VitePress statt Nextra in der App?
- Docs deployen unabhängig vom SaaS-Image
- Kein Mix aus Marketing-App und Docs-Router
- Markdown-first, Local Search
- llms.txt parallel unter /llms.txt in der App
Portable-by-Design
Env für alle URLs, Migrationen versioniert, Dockerfile + optional render.yaml — Migration VPS → Cloud ~1 Tag.