cms.c2sgmbh/docs/anleitungen/TODO.md
Martin Porwoll 3b3440cae5 docs: add staging deployment guide and swap setup script
- Add comprehensive staging deployment documentation (docs/STAGING-DEPLOYMENT.md)
- Add Proxmox swap setup script for ZFS-based LXC containers
- Update CLAUDE.md with staging deployment docs reference
- Mark staging-deployment and memory/swap TODOs as complete

Swap configuration:
- 4GB ZFS ZVOL on Proxmox host (rpool/swap)
- Container swap limit: 4096MB (pct set 700 -swap 4096)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 15:19:59 +00:00

256 lines
7.2 KiB
Markdown

# To-Do-Liste - Payload CMS Multi-Tenant Projekt
> **Server:** sv-payload (LXC 700) - 10.10.181.100
> **Frontend-Tasks:** Siehe `FRONTEND.md` (sv-frontend, LXC 704)
---
## Zusammenfassung: Offene Tasks (Payload-Server)
### Hohe Priorität
| Status | Task | Bereich |
|--------|------|---------|
| [ ] | SMTP-Credentials in `.env` konfigurieren | E-Mail |
### Mittlere Priorität
| Status | Task | Bereich |
|--------|------|---------|
| [ ] | Media-Backup zu S3/MinIO | Backup |
| [ ] | CDN-Integration (Cloudflare) | Caching |
| [x] | CI/CD Pipeline erweitern (Lint/Test/Build) | DevOps |
| [x] | Staging-Deployment | DevOps |
| [x] | Memory-Problem lösen (Swap) | Infrastruktur |
| [ ] | PM2 Cluster Mode testen | Infrastruktur |
### Niedrige Priorität
| Status | Task | Bereich |
|--------|------|---------|
| [ ] | Monitoring: Sentry, Prometheus, Grafana | Monitoring |
| [ ] | AuditLogs Retention (90 Tage Cron) | Data Retention |
| [ ] | Email-Log Cleanup Cron | Data Retention |
| [ ] | Dashboard-Widget für Email-Status | Admin UX |
| [ ] | TypeScript Strict Mode | Tech Debt |
| [x] | E2E Tests für kritische Flows | Testing |
### Dokumentation
| Status | Task |
|--------|------|
| [ ] | DEPLOYMENT.md erstellen |
---
## Legende
- [ ] Offen
- [x] Erledigt
- [~] In Bearbeitung
- [!] Hohe Priorität
- [→] Ausgelagert (siehe FRONTEND.md)
---
## Offene Aufgaben
### Hohe Priorität
- [ ] **SMTP-Credentials in `.env` konfigurieren**
- Echte SMTP-Zugangsdaten für Produktion hinterlegen
### Mittlere Priorität
#### Analytics Integration
- [ ] **Umami Analytics (cookieless, ohne Consent)**
- [ ] Umami-Server auf sv-analytics (10.10.181.103) einrichten
- [ ] Website-IDs für alle 4 Tenants in Umami erstellen
- [ ] `src/config/analytics.ts` mit Website-IDs anlegen
- [ ] `src/components/analytics/UmamiScript.tsx` implementieren
- [ ] Umami Script in Root Layout einbinden (Multi-Tenant)
- [ ] `src/hooks/useAnalytics.ts` Hook für Custom Events
- [ ] `src/lib/analytics.server.ts` für Server-Side Events
- [ ] Event-Tracking in Newsletter-Formular integrieren
- [ ] Event-Tracking in CTA-Buttons integrieren
- [ ] TrackedButton & TrackedDownload Komponenten erstellen
- [ ] **Google Ads Conversion (mit Consent)**
- [ ] `src/components/analytics/GoogleConsentMode.tsx` implementieren
- [ ] Google Consent Mode v2 mit Orestbida Cookie-Banner integrieren
- [ ] `src/hooks/useGclid.ts` Hook für GCLID-Erfassung
- [ ] `src/lib/google-ads.ts` Client-Side Conversion Tracking
- [ ] `src/lib/google-ads.server.ts` Server-Side Conversion API
- [ ] Enhanced Conversions mit gehashten E-Mails
- [ ] **Cookie Inventory**
- [ ] Google Ads Cookies (_gcl_au, _gcl_aw, IDE) zur Cookie Inventory Collection hinzufügen
- [ ] **Environment Variables**
- [ ] NEXT_PUBLIC_UMAMI_HOST in .env.local
- [ ] NEXT_PUBLIC_GOOGLE_ADS_ID in .env.local (pro Tenant)
- [ ] UMAMI_HOST, UMAMI_WEBSITE_ID in Backend .env
- [ ] Google Ads API Credentials in Backend .env
- [ ] **CDN-Integration (Cloudflare)**
- [~] **Backup-System**
- [ ] Media-Backup zu S3/MinIO
- [ ] Disaster Recovery Plan
### Niedrige Priorität
- [ ] **Monitoring & Logging**
- Sentry Error Tracking
- Prometheus Metrics
- Grafana Dashboard
---
## Build & Infrastructure
- [x] **Memory-Problem lösen** *(erledigt: 4GB Swap via ZFS ZVOL auf Proxmox Host)*
- [x] Swap auf Server aktivieren (4GB)
- [x] Container Swap-Limit konfiguriert (`pct set 700 -swap 4096`)
- [ ] **PM2 Cluster Mode**
- [ ] Multi-Instanz Konfiguration testen
- [ ] Shared State via Redis sicherstellen
---
## Testing & CI/CD
- [x] **CI/CD Pipeline** *(erledigt: `.github/workflows/ci.yml`)*
- [x] Automatisches Lint/Test/Build Workflow
- [x] Staging-Deployment *(erledigt: `.github/workflows/deploy-staging.yml`)*
- [x] **E2E Tests für kritische Flows** *(erledigt: `tests/e2e/`)*
---
## Data Retention
- [ ] **Automatische Datenbereinigung**
- [ ] Cron-Job für Email-Log Cleanup (älter als X Tage)
- [ ] AuditLogs Retention Policy (90 Tage)
- [ ] Consent-Logs Archivierung
- [ ] Media-Orphan-Cleanup
---
## Tenant-spezifische Features
> **Hinweis:** Backend-Collections hier, Frontend-Komponenten in `FRONTEND.md`
### porwoll.de
- [ ] Immobilien-Collection (falls benötigt) *(Backend)*
- [→] Objektsuche *(Frontend)*
- [→] Kontaktformular mit Objekt-Referenz *(Frontend)*
### complexcaresolutions.de (C2S)
- [→] Leistungs-Übersicht *(Frontend)*
- [→] Karriere-Seite mit Stellenangeboten *(Frontend)*
### gunshin.de / Fotografin-Portfolio
- [→] Projekt-Galerie Frontend *(Frontend)*
- [→] Referenzen-Slider *(Frontend)*
### zweitmein.ng
- [ ] Produkt-Collection (falls E-Commerce) *(Backend)*
- [→] Preistabellen *(Frontend)*
---
## Technische Schulden
- [ ] TypeScript Strict Mode aktivieren
- [x] E2E Tests für kritische Flows
- [ ] Code-Review für Security-relevante Bereiche
- [ ] Performance-Audit der Datenbank-Queries
---
## Dokumentation
- [ ] DEPLOYMENT.md (Deployment-Prozess)
---
## Regelmäßige Wartung
### Wöchentlich
- [ ] PM2 Logs prüfen
- [ ] Datenbank-Größe überwachen
- [ ] Media-Storage prüfen
### Monatlich
- [ ] Dependencies aktualisieren (`pnpm update`)
- [ ] Sicherheitsupdates prüfen (`pnpm audit`)
- [ ] Backup-Restore testen
### Quartalsweise
- [ ] Performance-Review
- [ ] Security-Audit
- [ ] Dokumentation aktualisieren
---
## Notizen
### Bekannte Probleme
1. **Tenant-Isolation bei localhost:** API gibt 403 zurück, wenn kein Tenant zur Domain passt. Das ist gewolltes Verhalten für Multi-Tenant-Sicherheit.
2. **GraphQL Playground deaktiviert:** Route wurde entfernt. Bei Bedarf wieder aktivieren.
3. **PM2 Cluster Mode:** Aktuell 1 Instanz. Für Skalierung `instances: "max"` setzen.
### Nächste Schritte (Priorisiert)
1. **[MITTEL]** Media-Backup zu S3 einrichten
2. **[NIEDRIG]** Monitoring (Sentry/Prometheus)
3. **[NIEDRIG]** Analytics Integration (Umami)
---
## Kontakte & Ressourcen
- **Payload CMS Docs:** https://payloadcms.com/docs
- **GitHub Issues:** https://github.com/payloadcms/payload/issues
- **Discord Community:** https://discord.com/invite/payload
---
*Letzte Aktualisierung: 14.12.2025*
---
## Changelog
### 14.12.2025
- **Tenant-spezifische Collections implementiert:**
- Bookings Collection für porwoll.de (Fotografie-Buchungen)
- Certifications Collection für C2S (Zertifizierungen)
- Projects Collection für gunshin.de (Game-Development-Projekte)
- BeforeAfterBlock für porwoll.de (Vorher/Nachher Bildvergleich)
- Migration: `20251214_010000_tenant_specific_collections.ts`
- 28 neue Datenbank-Tabellen erstellt
- **TODO.md bereinigt:** Alle erledigten Tasks entfernt
### 12.12.2025
- **PgBouncer Connection Pooling eingerichtet**
- **Unit Tests für Access Control implementiert**
- **Rate-Limits auf Redis migriert**
### 11.12.2025
- **Automatisierte Datenbank-Backups eingerichtet**
- **Offsite-Backup zu Hetzner Object Storage**
- **Dokumentierter Restore-Prozess**
### 10.12.2025
- **Newsletter Double Opt-In implementiert**
- **OpenAPI-Dokumentation hinzugefügt**
- **Audit-Fixes durchgeführt**
### 09.12.2025
- **Full-Text-Search aktiviert**
- **BullMQ Queue-System implementiert**
- **PDF-Queue-System implementiert**
- **Index-Audit durchgeführt**