mirror of
https://github.com/complexcaresolutions/cms.c2sgmbh.git
synced 2026-03-17 19:44:12 +00:00
Tests: - Update frontend.e2e.spec.ts with locale testing - Add search.e2e.spec.ts for search functionality - Add i18n.int.spec.ts for localization tests - Add search.int.spec.ts for search integration - Update playwright.config.ts Documentation: - Add CLAUDE.md with project instructions - Add docs/ directory with detailed documentation - Add scripts/ for utility scripts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4.9 KiB
4.9 KiB
Payload CMS Multi-Tenant - Projektstatus
Stand: 26. November 2025, 21:00 Uhr
Zusammenfassung
Das Payload CMS Multi-Tenant-System ist funktionsfähig installiert und läuft. Das Admin-Panel ist erreichbar unter https://pl.c2sgmbh.de/admin
✅ Abgeschlossen
Infrastruktur
- LXC Container 700 (sv-payload) erstellt und konfiguriert
- LXC Container 701 (sv-postgres) erstellt und konfiguriert
- Netzwerk VLAN 181 eingerichtet
- NAT-Regel für öffentliche IP 37.24.237.181 konfiguriert
- DNS pl.c2sgmbh.de → 37.24.237.181 (ohne Cloudflare)
PostgreSQL 17
- Installation auf sv-postgres
- Datenbank payload_db erstellt
- User payload mit Passwort konfiguriert
- Remote-Zugriff nur von 10.10.181.100 erlaubt
- Firewall konfiguriert
Payload CMS
- Node.js 22 LTS installiert
- pnpm installiert
- Payload CMS 3.x mit blank Template erstellt
- PostgreSQL-Adapter konfiguriert
- Umgebungsvariablen gesetzt
- Datenbank-Migrationen ausgeführt
- Production Build erstellt
Caddy Reverse Proxy
- Caddy 2.10.2 installiert
- Let's Encrypt SSL-Zertifikat automatisch geholt
- Reverse Proxy zu localhost:3000 konfiguriert
- Security Headers gesetzt
- Gzip/Zstd Kompression aktiviert
PM2 Process Management
- PM2 installiert
- ecosystem.config.cjs konfiguriert (als CommonJS wegen ES Module)
- Autostart bei Systemboot eingerichtet
- Logging konfiguriert
Multi-Tenant Plugin
- @payloadcms/plugin-multi-tenant 3.65.0 installiert
- Plugin in payload.config.ts konfiguriert
- Tenants Collection erstellt
- ImportMap generiert
- Build mit Plugin erfolgreich
📊 Aktuelle Daten
Tenants
| ID | Name | Slug | Status |
|---|---|---|---|
| 1 | porwoll.de | porwoll | ✅ Angelegt |
| 4 | Complex Care Solutions GmbH | c2s | ✅ Angelegt |
| 5 | Gunshin | gunshin | ✅ Angelegt |
| - | Zweitmeinung | zweitmeinung | ⏳ Noch anzulegen |
Users
| ID | Tenants | |
|---|---|---|
| 1 | martin.porwoll@complexcaresolutions.de | porwoll, c2s, gunshin |
Datenbank-Status
-- Tenants
SELECT id, name, slug FROM tenants;
-- Ergebnis: 3 Tenants (IDs 1, 4, 5)
-- User-Tenant-Zuordnung
SELECT * FROM users_tenants;
-- Ergebnis: User 1 ist Tenants 1, 4, 5 zugeordnet
⚠️ Bekannte Probleme
1. Tenant-Anzeige im Admin
Problem: In der Tenants-Übersicht wird nur der erste Tenant (porwoll.de) angezeigt, obwohl alle drei in der Datenbank existieren und dem User zugeordnet sind.
Mögliche Ursachen:
- Session/Cache-Problem
- Plugin-Filter-Logik
Workaround: Ausloggen und neu einloggen, Hard-Refresh (Ctrl+Shift+R)
2. Manuelle User-Tenant-Zuweisung
Problem: Bei der initialen Installation musste die User-Tenant-Beziehung manuell per SQL erstellt werden.
Lösung für neue User: Im Admin unter Users → [User] → Tenants-Feld sollte die Zuweisung möglich sein.
🔜 Nächste Schritte
Kurzfristig
- Vierten Tenant "Zweitmeinung" anlegen (slug: zweitmeinung)
- Tenant-Anzeige-Problem debuggen
- Domains zu Tenants hinzufügen
- Claude Code CLI auf sv-payload installieren
Mittelfristig
- Content Collections erstellen (Pages, Posts, etc.)
- Frontend Next.js Apps für jede Domain aufsetzen
- Media Upload testen
- Backup-Strategie implementieren
Langfristig
- Email-Adapter konfigurieren (aktuell: Console-Output)
- Weitere Redakteur-Accounts anlegen
- Monitoring einrichten
- CI/CD Pipeline aufsetzen
📁 Wichtige Dateien
/home/payload/payload-cms/
├── src/payload.config.ts # Haupt-Konfiguration
├── src/collections/
│ ├── Users.ts
│ ├── Media.ts
│ └── Tenants.ts
├── .env # Umgebungsvariablen
└── ecosystem.config.cjs # PM2 Config
/etc/caddy/Caddyfile # Reverse Proxy Config
/var/log/caddy/ # Caddy Logs
/home/payload/logs/ # PM2/Payload Logs
🔧 Schnellbefehle
# Status prüfen
pm2 status
pm2 logs payload --lines 20
# Neustart nach Änderungen
cd /home/payload/payload-cms
pnpm build
pm2 restart payload
# Datenbank prüfen
PGPASSWORD=Finden55 psql -h 10.10.181.101 -U payload -d payload_db -c "SELECT * FROM tenants;"
# Caddy neu laden
sudo systemctl reload caddy
📞 Zugangsdaten
| Service | URL/Host | Credentials |
|---|---|---|
| Admin Panel | https://pl.c2sgmbh.de/admin | martin.porwoll@complexcaresolutions.de |
| PostgreSQL | 10.10.181.101:5432 | payload / Finden55 |
| SSH sv-payload | 10.10.181.100 | root |
| SSH sv-postgres | 10.10.181.101 | root |
📝 Änderungsprotokoll
26.11.2025
- Initial Setup komplett
- PostgreSQL 17 auf separatem LXC
- Payload CMS 3.x mit Multi-Tenant Plugin
- Caddy mit Let's Encrypt SSL
- PM2 Process Management
- 3 von 4 Tenants angelegt
- User-Tenant-Zuweisung manuell per SQL