From eea0ce26e9531c387d0e1f79d48139aff22f19b2 Mon Sep 17 00:00:00 2001 From: Martin Porwoll Date: Thu, 18 Dec 2025 15:42:40 +0000 Subject: [PATCH 1/8] docs: consolidate and update documentation for December 2025 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CLAUDE.md: Update tech stack versions (Payload 3.68.4, Next.js 15.5.9, React 19.2.3) - CLAUDE.md: Expand architecture with sv-caddy (LXC 699) and sv-frontend (LXC 704) - CLAUDE.md: Add Videos and VideoCategories collections - CLAUDE.md: Update documentation references section - INFRASTRUCTURE.md: Complete rewrite with current infrastructure - PROJECT_STATUS.md: Add new project status document - TODO.md: Add changelog entry for documentation consolidation - Remove obsolete: INFRASTRUCTURE_COMPLETE_DECEMBER_2025.md, TECHSTACK_COMPLETE_DECEMBER_2025.md ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 71 +++- docs/INFRASTRUCTURE.md | 732 +++++++++++---------------------------- docs/PROJECT_STATUS.md | 206 +++++++++++ docs/anleitungen/TODO.md | 11 +- 4 files changed, 462 insertions(+), 558 deletions(-) create mode 100644 docs/PROJECT_STATUS.md diff --git a/CLAUDE.md b/CLAUDE.md index 538fc7f..9a08c54 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -11,31 +11,55 @@ Multi-Tenant CMS fรผr 4 Websites unter einer Payload CMS 3.x Instanz: ## Tech Stack -- **CMS:** Payload CMS 3.x -- **Framework:** Next.js 15.4.7 +- **CMS:** Payload CMS 3.68.4 +- **Framework:** Next.js 15.5.9 +- **React:** 19.2.3 - **Sprache:** TypeScript -- **Datenbank:** PostgreSQL 17 (separater Server) +- **Runtime:** Node.js 22.x +- **Datenbank:** PostgreSQL 17.6 (separater Server) - **Connection Pool:** PgBouncer 1.24.1 (Transaction-Mode) -- **Reverse Proxy:** Caddy 2.10.2 mit Let's Encrypt +- **Reverse Proxy:** Caddy 2.9.x mit Let's Encrypt (Dev) / Nginx (Prod) - **Process Manager:** PM2 - **Package Manager:** pnpm -- **Cache:** Redis (optional, mit In-Memory-Fallback) +- **Cache:** Redis 7.x (optional, mit In-Memory-Fallback) - **Job Queue:** BullMQ (Redis-basiert) +- **Analytics:** Umami 3.x +- **AI Tools:** Claude Code, Codex CLI, Gemini CLI ## Architektur +### Development (VLAN 181 - porwoll.tech) + ``` -Internet โ†’ 37.24.237.181 โ†’ Caddy (443) โ†’ Payload (3000) - โ†“ - PgBouncer (6432) - โ†“ - PostgreSQL (10.10.181.101:5432) +Internet โ†’ Cloudflare โ†’ 37.24.237.181 โ†’ Caddy (sv-caddy) โ†’ Services + โ†“ + โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” + โ”‚ โ”‚ + sv-payload:3000 sv-frontend:3000-3008 + (Payload CMS) (9 Frontend-Projekte) + โ”‚ + PgBouncer (6432) + โ”‚ + PostgreSQL (sv-postgres:5432) ``` -| Server | IP | Funktion | -| --------------------- | ------------- | ---------- | -| sv-payload (LXC 700) | 10.10.181.100 | App Server | -| sv-postgres (LXC 701) | 10.10.181.101 | Datenbank | +| LXC | Hostname | IP | Service | Status | +|-----|----------|-----|---------|--------| +| 699 | sv-caddy | 10.10.181.99 | Caddy Reverse Proxy | โœ… Running | +| 700 | sv-payload | 10.10.181.100 | Payload CMS + Redis | โœ… Running | +| 701 | sv-postgres | 10.10.181.101 | PostgreSQL 17 + Redis Commander | โœ… Running | +| 702 | sv-dev-payload | 10.10.181.102 | Payload Experimental | โธ๏ธ Stopped | +| 703 | sv-analytics | 10.10.181.103 | Umami Analytics | โœ… Running | +| 704 | sv-frontend | 10.10.181.104 | Multi-Frontend Dev (9 Projekte) | โœ… Running | + +### Production (Hetzner 3) + +| Service | URL | Port | +|---------|-----|------| +| Payload CMS | https://cms.c2sgmbh.de | 3001 | +| Umami Analytics | https://analytics.c2sgmbh.de | 3000 | +| PostgreSQL 17 | localhost | 5432 | +| Redis Cache | localhost | 6379 | ## Wichtige Pfade @@ -758,6 +782,8 @@ Vollwertiger Hero-Slider mit: | Bookings | bookings | Fotografie-Buchungen (porwoll.de) | | Certifications | certifications | Zertifizierungen (C2S) | | Projects | projects | Game-Development-Projekte (gunshin.de) | +| Videos | videos | Video-Bibliothek mit YouTube/Vimeo/Uploads | +| VideoCategories | video-categories | Kategorien fรผr Videos | ## Timeline Collection @@ -985,11 +1011,20 @@ Automatisches Deployment auf Staging-Server bei Push auf `develop`: ## Dokumentation -- `CLAUDE.md` - Diese Datei (Projekt-รœbersicht) -- `docs/INFRASTRUCTURE.md` - Server-Architektur & Deployment +### Hauptdokumentation +- `CLAUDE.md` - Diese Datei (Projekt-รœbersicht fรผr AI-Assistenten) +- `docs/INFRASTRUCTURE.md` - Infrastruktur-รœbersicht (Dev + Prod) +- `docs/PROJECT_STATUS.md` - Aktueller Projektstatus & Roadmap - `docs/STAGING-DEPLOYMENT.md` - Staging Deployment Workflow -- `docs/anleitungen/TODO.md` - Task-Liste & Roadmap + +### Anleitungen +- `docs/anleitungen/TODO.md` - Task-Liste & Changelog - `docs/anleitungen/SECURITY.md` - Sicherheitsrichtlinien +- `docs/anleitungen/FRONTEND.md` - Frontend-Entwicklung (sv-frontend) +- `docs/anleitungen/API_ANLEITUNG.md` - API-Dokumentation +- `docs/anleitungen/framework-monitoring.md` - Framework-Updates beobachten + +### Scripts & Backup - `scripts/backup/README.md` - Backup-System Dokumentation -*Letzte Aktualisierung: 14.12.2025* +*Letzte Aktualisierung: 18.12.2025* diff --git a/docs/INFRASTRUCTURE.md b/docs/INFRASTRUCTURE.md index 1db94ec..ddcff69 100644 --- a/docs/INFRASTRUCTURE.md +++ b/docs/INFRASTRUCTURE.md @@ -1,85 +1,174 @@ -# Payload CMS Multi-Tenant Infrastructure +# Infrastruktur Dokumentation -> Letzte Aktualisierung: 09.12.2025 +*Letzte Aktualisierung: 18. Dezember 2025* -## รœbersicht - -Diese Dokumentation beschreibt die Infrastruktur eines Payload CMS 3.x Multi-Tenant-Systems fรผr den Betrieb mehrerer Websites unter einer zentralen CMS-Instanz. - -## Gesamtarchitektur +## Gesamtรผbersicht ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ GESAMTARCHITEKTUR โ”‚ +โ”‚ INFRASTRUKTUR รœBERSICHT โ”‚ โ”‚ โ”‚ -โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ -โ”‚ โ”‚ LOKALE ENTWICKLUNGSUMGEBUNG โ”‚ โ”‚ -โ”‚ โ”‚ (Proxmox VE Cluster) โ”‚ โ”‚ -โ”‚ โ”‚ LAN: 10.10.181.0/24 โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚ sv-payload โ”‚ โ”‚ sv-postgres โ”‚ โ”‚sv-dev-payloadโ”‚ โ”‚sv-analytics โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚ LXC 700 โ”‚ โ”‚ LXC 701 โ”‚ โ”‚ LXC 702 โ”‚ โ”‚ LXC 703 โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚ Payload CMS โ”‚ โ”‚ PostgreSQL โ”‚ โ”‚ Next.js โ”‚ โ”‚ Umami โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚10.10.181.100โ”‚ โ”‚10.10.181.101โ”‚ โ”‚10.10.181.102โ”‚ โ”‚10.10.181.103โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚ + Redis โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ -โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ -โ”‚ โ”‚ โ”‚ -โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ -โ”‚ โ”‚ LOKALER INTERNETZUGANG โ”‚ โ”‚ -โ”‚ โ”‚ 850 Mbps โ†“ / 50 Mbps โ†‘ โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ Feste IP-Adressen: โ”‚ โ”‚ -โ”‚ โ”‚ 37.24.237.178 - Router โ”‚ โ”‚ -โ”‚ โ”‚ 37.24.237.179 - complexcaresolutions โ”‚ โ”‚ -โ”‚ โ”‚ 37.24.237.180 - Nginx Proxy Manager โ”‚ โ”‚ -โ”‚ โ”‚ 37.24.237.181 - pl.c2sgmbh.de โ”‚ โ”‚ -โ”‚ โ”‚ 37.24.237.182 - frei โ”‚ โ”‚ -โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ -โ”‚ โ”‚ โ”‚ -โ”‚ INTERNET โ”‚ -โ”‚ โ”‚ โ”‚ -โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ -โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ -โ”‚ โ–ผ โ–ผ โ–ผ โ”‚ -โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ -โ”‚ โ”‚ HETZNER 1 โ”‚ โ”‚ HETZNER 2 โ”‚ โ”‚ HETZNER 3 โ”‚ โ”‚ -โ”‚ โ”‚ CCS GmbH โ”‚ โ”‚ Martin Porwoll โ”‚ โ”‚ Backend/Analytics โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ 78.46.87.137 โ”‚ โ”‚ 94.130.141.114 โ”‚ โ”‚ 162.55.85.18 โ”‚ โ”‚ -โ”‚ โ”‚ Debian 12.12 โ”‚ โ”‚ Ubuntu 24.04 โ”‚ โ”‚ Debian 13 โ”‚ โ”‚ -โ”‚ โ”‚ Plesk โ”‚ โ”‚ Plesk โ”‚ โ”‚ Native โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ Next.js Frontends โ”‚ โ”‚ Next.js Frontends โ”‚ โ”‚ โœ… Payload CMS โ”‚ โ”‚ -โ”‚ โ”‚ โ€ข complexcare... โ”‚ โ”‚ โ€ข porwoll.de โ”‚ โ”‚ โœ… Umami โ”‚ โ”‚ -โ”‚ โ”‚ โ€ข gunshin.de โ”‚ โ”‚ โ€ข caroline-... โ”‚ โ”‚ โœ… PostgreSQL 17 โ”‚ โ”‚ -โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โœ… Redis Cache โ”‚ โ”‚ -โ”‚ โ”‚ โœ… Claude Code โ”‚ โ”‚ -โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ”‚ INTERNET โ”‚ +โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ Vodafone Business โ”‚ +โ”‚ โ”‚ 5 รถffentliche IPs โ”‚ +โ”‚ โ”‚ โ”‚ +โ”‚ โ–ผ โ”‚ +โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ +โ”‚ โ”‚ UBIQUITI DREAM MACHINE PRO SE โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ 37.24.237.178 โ”‚ Internetzugang โ”‚ โ”‚ +โ”‚ โ”‚ 37.24.237.179 โ”‚ cloud.complexcaresolutions.de โ†’ 10.10.179.100 โ”‚ โ”‚ +โ”‚ โ”‚ 37.24.237.180 โ”‚ zh3.de (Nginx PM) โ†’ 10.10.180.100 โ”‚ โ”‚ +โ”‚ โ”‚ 37.24.237.181 โ”‚ porwoll.tech (Caddy) โ†’ 10.10.181.99 โ”‚ โ”‚ +โ”‚ โ”‚ 37.24.237.182 โ”‚ FREI (Reserve) โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ”‚ โ”‚ +โ”‚ CLOUDFLARE (Proxy) โ”‚ +โ”‚ โ”œโ”€โ”€ zh3.de + Subdomains โ†’ 37.24.237.180 โ”‚ +โ”‚ โ”œโ”€โ”€ porwoll.tech + *.porwoll.tech โ†’ 37.24.237.181 โ”‚ +โ”‚ โ””โ”€โ”€ porwoll.org (intern DNS only) โ”‚ +โ”‚ โ”‚ +โ”‚ HETZNER (Extern) โ”‚ +โ”‚ โ”œโ”€โ”€ 78.46.87.137 (Hetzner 1 - zweitmeinu.ng) โ”‚ +โ”‚ โ”œโ”€โ”€ 94.130.141.114 (Hetzner 2 - Porwoll) โ”‚ +โ”‚ โ””โ”€โ”€ 162.55.85.18 (Hetzner 3 - Payload Prod) โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` --- -## Server-Details +## ร–ffentliche IP-Adressen -### HETZNER 3 - Backend & Analytics (Produktion) +| IP | Verwendung | Ziel (intern) | +|----|------------|---------------| +| 37.24.237.178 | Internetzugang (Default) | - | +| 37.24.237.179 | cloud.complexcaresolutions.de | 10.10.179.100 (Nextcloud) | +| 37.24.237.180 | zh3.de (via Cloudflare) | 10.10.180.100 (Nginx PM) | +| 37.24.237.181 | porwoll.tech (Cloudflare) | 10.10.181.99 (Caddy) | +| 37.24.237.182 | FREI (Reserve) | - | -| Eigenschaft | Wert | -|-------------|------| -| **Hostname** | sv-hz03-backend | -| **IP-Adresse** | 162.55.85.18 | -| **Betriebssystem** | Debian 13 "Trixie" | -| **CPU** | AMD Ryzen 5 3600 (6 Cores / 12 Threads) | -| **RAM** | 64 GB DDR4 ECC | -| **Storage** | 2x 512 GB NVMe SSD (Software RAID 1) | -| **Netzwerk** | 1 Gbit/s (garantiert) | -| **Traffic** | Unbegrenzt | -| **Kosten** | ~โ‚ฌ52/Monat | +--- -#### Services auf Hetzner 3 +## VLANs + +| VLAN | Name | Subnetz | Zweck | +|------|------|---------|-------| +| 40 | c2s-prd | 10.10.40.0/24 | Produktion | +| 90 | c2s-mgt | 10.10.90.0/24 | Management (Proxmox) | +| 179 | c2s-179 | 10.10.179.0/24 | Cloud Services | +| 180 | c2s-180 | 10.10.180.0/24 | Web Services (zh3.de) | +| 181 | c2s-181 | 10.10.181.0/24 | Development (porwoll.tech) | + +--- + +## VLAN 181 - Development (porwoll.tech) + +| ID | Hostname | IP | Service | Status | +|----|----------|-----|---------|--------| +| 699 | sv-caddy | 10.10.181.99 | Caddy Reverse Proxy | โœ… Running | +| 700 | sv-payload | 10.10.181.100 | Payload CMS Dev | โœ… Running | +| 701 | sv-postgres | 10.10.181.101 | PostgreSQL 17 + Redis Commander | โœ… Running | +| 702 | sv-dev-payload | 10.10.181.102 | Payload Test | โธ๏ธ Stopped | +| 703 | sv-analytics | 10.10.181.103 | Umami Analytics | โœ… Running | +| 704 | sv-frontend | 10.10.181.104 | Frontend Dev (9 Projekte) | โœ… Running | + +--- + +## sv-frontend (LXC 704) - Frontend Development + +**SSH:** `ssh frontend@10.10.181.104` + +### Software Stack +- Node.js 22.x +- pnpm +- Next.js 16.0.10 +- Claude Code 2.0.72 +- Codex CLI 0.73.0 +- Gemini CLI 0.21.2 + +### Projekte & Ports + +| Port | Service | Repository | URL | +|------|---------|------------|-----| +| 3000 | frontend-porwoll | frontend.porwoll.de | porwoll-dev.porwoll.tech | +| 3001 | frontend-blogwoman | frontend.blogwoman.de | blogwoman-dev.porwoll.tech | +| 3002 | frontend-caroline-com | frontend.caroline-porwoll.com | caroline-com-dev.porwoll.tech | +| 3003 | frontend-caroline-de | frontend.caroline-porwoll.de | caroline-de-dev.porwoll.tech | +| 3004 | frontend-ccs | frontend.complexcaresolutions.de | ccs-dev.porwoll.tech | +| 3005 | frontend-gunshin | frontend.gunshin.de | gunshin-dev.porwoll.tech | +| 3006 | frontend-sensual | frontend.sensualmoment.de | sensual-dev.porwoll.tech | +| 3007 | frontend-zweitmeinu | frontend.zweitmeinu.ng | zweitmeinu-dev.porwoll.tech | +| 3008 | frontend-zytoskandal | frontend.zytoskandal.de | zytoskandal-dev.porwoll.tech | + +### Service-Verwaltung + +```bash +# Service starten +systemctl start frontend-porwoll + +# Service stoppen +systemctl stop frontend-porwoll + +# Alle Status +systemctl status frontend-* +``` + +--- + +## sv-caddy (LXC 699) - Reverse Proxy + +- **IP:** 10.10.181.99 +- **Software:** Caddy 2.9.x + Cloudflare DNS Plugin +- **SSL:** Wildcard *.porwoll.tech via Let's Encrypt DNS-Challenge +- **Config:** `/etc/caddy/Caddyfile` + +### Routing + +| URL | Backend | +|-----|---------| +| pl.porwoll.tech | 10.10.181.100:3000 | +| redis.porwoll.tech | 10.10.181.101:8081 | +| umami.porwoll.tech | 10.10.181.103:3000 | +| *-dev.porwoll.tech | 10.10.181.104:300x | + +--- + +## GitHub Organisation: complexcaresolutions + +| Repository | Beschreibung | Visibility | +|------------|--------------|------------| +| cms.c2sgmbh | Payload CMS Backend | Internal | +| frontend.porwoll.de | porwoll.de Frontend | Internal | +| frontend.blogwoman.de | blogwoman.de Frontend | Internal | +| frontend.caroline-porwoll.com | caroline-porwoll.com Frontend | Internal | +| frontend.caroline-porwoll.de | caroline-porwoll.de Frontend | Internal | +| frontend.complexcaresolutions.de | CCS Website Frontend | Internal | +| frontend.gunshin.de | gunshin.de Frontend | Internal | +| frontend.sensualmoment.de | sensualmoment.de Frontend | Internal | +| frontend.zweitmeinu.ng | zweitmeinu.ng Frontend | Internal | +| frontend.zytoskandal.de | zytoskandal.de Frontend | Internal | + +--- + +## Hetzner 3 - Payload Production + +- **IP:** 162.55.85.18 +- **Domain:** cms.c2sgmbh.de +- **User:** payload +- **SSH:** `ssh payload@162.55.85.18` + +### Software +- Payload CMS 3.68.4 +- Next.js 15.5.9 +- React 19.2.3 +- PostgreSQL 17 +- Redis +- Umami Analytics + +### Services | Service | User | Port | URL | Status | |---------|------|------|-----|--------| @@ -88,501 +177,66 @@ Diese Dokumentation beschreibt die Infrastruktur eines Payload CMS 3.x Multi-Ten | Umami Analytics | umami | 3000 | https://analytics.c2sgmbh.de | โœ… Lรคuft | | Redis Cache | redis | 6379 | localhost | โœ… Lรคuft | | Nginx | root | 80/443 | Reverse Proxy | โœ… Lรคuft | -| Claude Code | claude | - | CLI Tool | โœ… Installiert | - -#### System-User - -| User | Zweck | Home-Verzeichnis | -|------|-------|------------------| -| root | System-Administration | /root | -| payload | Payload CMS | /home/payload | -| umami | Umami Analytics | /home/umami | -| claude | Claude Code / Server-Admin | /home/claude | - ---- - -### HETZNER 1 - Complex Care Solutions GmbH - -| Eigenschaft | Wert | -|-------------|------| -| **Eigentรผmer** | Complex Care Solutions GmbH | -| **IP-Adresse** | 78.46.87.137 | -| **Betriebssystem** | Debian 12.12 | -| **Control Panel** | Plesk Web Pro Edition 18.0.73 | -| **CPU** | AMD Ryzen 7 Pro 8700GE | -| **RAM** | 64 GB | -| **Storage** | 2x 512 GB NVMe SSD (Software RAID 1) | - -#### Domains auf Hetzner 1 - -| Domain | Zweck | -|--------|-------| -| **complexcaresolutions.de** | Hauptdomain | -| **gunshin.de** | Portfolio/Holding | -| c2sgmbh.de | Kurzform โ†’ Redirect | -| zweitmeinung-*.de | Fachgebiete โ†’ Redirect | - ---- - -### HETZNER 2 - Martin Porwoll (privat) - -| Eigenschaft | Wert | -|-------------|------| -| **Eigentรผmer** | Martin Porwoll (privat) | -| **IP-Adresse** | 94.130.141.114 | -| **Betriebssystem** | Ubuntu 24.04 LTS | -| **Control Panel** | Plesk Web Pro Edition 18.0.73 | -| **CPU** | Intel Xeon E3-1275v6 | -| **RAM** | 64 GB | -| **Storage** | 2x 512 GB NVMe SSD (Software RAID 1) | - -#### Domains auf Hetzner 2 - -| Domain | Zweck | -|--------|-------| -| **porwoll.de** | Hauptdomain | -| **caroline-porwoll.de** | Dr. Caroline Porwoll | - ---- - -### Lokale Infrastruktur (Proxmox) - Entwicklung - -| Server | IP | Port | Funktion | OS | -|--------|-----|------|----------|-----| -| sv-payload | 10.10.181.100 | 3000 | Payload CMS (Dev) + Redis | Debian 13 | -| sv-postgres | 10.10.181.101 | 5432 | PostgreSQL (Dev) | Debian 13 | -| sv-dev-payload | 10.10.181.102 | 3001 | Next.js Frontend | Debian 13 | -| sv-analytics | 10.10.181.103 | 3000 | Umami (Dev) | Debian 13 | - -#### Feste IP-Adressen (Lokal โ†’ Internet) - -| IP | Verwendung | -|----|------------| -| 37.24.237.178 | Router / Gateway | -| 37.24.237.179 | complexcaresolutions.cloud | -| 37.24.237.180 | Nginx Proxy Manager | -| 37.24.237.181 | pl.c2sgmbh.de (Payload Dev) | -| 37.24.237.182 | **Frei** | - ---- - -## Credentials - -### Produktion (sv-hz03-backend) - -#### PostgreSQL - -| Datenbank | User | Passwort | -|-----------|------|----------| -| payload_db | payload | Suchen55 | -| umami_db | umami | Suchen55 | - -#### Redis +### Deploy ```bash -redis-cli -h localhost -p 6379 -# Kein Passwort (nur localhost) -``` - -#### Environment Variables - Payload (.env) - -```env -DATABASE_URI=postgresql://payload:Suchen55@localhost:5432/payload_db -PAYLOAD_SECRET=hxPARlMkmv+ZdCOAMw+N4o2x4mNbERB237iDQTYXALY= -PAYLOAD_PUBLIC_SERVER_URL=https://cms.c2sgmbh.de -NEXT_PUBLIC_SERVER_URL=https://cms.c2sgmbh.de -NODE_ENV=production -PORT=3001 -REDIS_HOST=localhost -REDIS_PORT=6379 -``` - -### Entwicklung (pl.c2sgmbh.de) - -#### PostgreSQL (sv-postgres) - -| Datenbank | User | Passwort | -|-----------|------|----------| -| payload_db | payload | Finden55 | - -#### Environment Variables (.env) - -```env -DATABASE_URI=postgresql://payload:Finden55@10.10.181.101:5432/payload_db -PAYLOAD_SECRET=a53b254070d3fffd2b5cfcc3 -PAYLOAD_PUBLIC_SERVER_URL=https://pl.c2sgmbh.de -NEXT_PUBLIC_SERVER_URL=https://pl.c2sgmbh.de -NODE_ENV=production -PORT=3000 -REDIS_HOST=localhost -REDIS_PORT=6379 +~/deploy.sh ``` --- -## Multi-Tenant Konzept - -Das System verwendet `@payloadcms/plugin-multi-tenant` fรผr die Mandantenfรคhigkeit. - -### Tenants (Mandanten) - -Jeder Tenant reprรคsentiert eine separate Website: - -| Tenant | Slug | Domains | -|--------|------|---------| -| porwoll.de | porwoll | porwoll.de, www.porwoll.de | -| Complex Care Solutions GmbH | c2s | complexcaresolutions.de | -| Gunshin | gunshin | gunshin.de | - -### Datenisolation - -- Jeder Content (Media, Pages, Posts etc.) gehรถrt zu genau einem Tenant -- User werden Tenants zugewiesen und sehen nur deren Inhalte -- Die Domain-Erkennung erfolgt automatisch durch das Plugin - -### Datenbank-Tabellen +## Development Workflow ``` -tenants - Mandanten-Stammdaten -tenants_domains - Domain-Zuordnungen -users_tenants - User-Mandanten-Beziehung (N:M) +DEVELOPMENT STAGING PRODUCTION +sv-frontend โ†’ sv-payload โ†’ Hetzner 03 +porwoll.tech pl.porwoll.tech cms.c2sgmbh.de + develop branch main branch ``` ---- - -## Redis Caching - -### Architektur - -``` -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ REDIS CACHING STRATEGIE โ”‚ -โ”‚ โ”‚ -โ”‚ Request โ†’ Payload CMS โ†’ Redis Cache? โ”‚ -โ”‚ โ”‚ โ”‚ -โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ” โ”‚ -โ”‚ HIT MISS โ”‚ -โ”‚ โ”‚ โ”‚ โ”‚ -โ”‚ โ–ผ โ–ผ โ”‚ -โ”‚ Return PostgreSQL โ†’ Cache in Redis โ†’ Return โ”‚ -โ”‚ โ”‚ -โ”‚ Cache-Typen: โ”‚ -โ”‚ โ€ข API Response Cache (GET /api/pages, /api/posts) โ”‚ -โ”‚ โ€ข Automatische Invalidierung bei Content-ร„nderungen โ”‚ -โ”‚ โ”‚ -โ”‚ Konfiguration: โ”‚ -โ”‚ โ€ข Max Memory: 2GB (Prod) / 512MB (Dev) โ”‚ -โ”‚ โ€ข Eviction: allkeys-lru โ”‚ -โ”‚ โ€ข TTL: 5 Minuten (Standard) โ”‚ -โ”‚ โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ -``` - -### Redis Befehle - -```bash -# Status prรผfen -redis-cli ping - -# Statistiken -redis-cli info stats - -# Cache-Keys anzeigen -redis-cli keys "*" - -# Cache leeren -redis-cli flushdb - -# Live-Monitoring -redis-cli monitor -``` - -### Background Jobs (geplant) - -**Evaluation (09.12.2025): BullMQ vs Agenda.js** - -| Kriterium | BullMQ | Agenda.js | -|-----------|--------|-----------| -| Database | Redis โœ… | MongoDB โŒ | -| TypeScript | Native โœ… | Begrenzt โš ๏ธ | -| Priority Jobs | Ja โœ… | Nein โŒ | -| Rate Limiting | Ja โœ… | Nein โŒ | -| UI Dashboard | @bull-board โœ… | Keine โŒ | - -**Entscheidung: BullMQ** (Redis bereits vorhanden, TypeScript-native, @bull-board UI) - -**Geplante Konfiguration:** -```bash -# Environment Variables (wenn implementiert) -QUEUE_REDIS_URL=redis://localhost:6379/1 # Separate DB fรผr Jobs -QUEUE_CONCURRENCY=5 # Parallele Worker -QUEUE_DEFAULT_RETRY=3 # Wiederholungsversuche -``` - -**PM2 Worker-Konfiguration (geplant):** -```javascript -// ecosystem.config.cjs - Erweiterung -{ - name: 'queue-worker', - script: './scripts/run-queue-worker.ts', - instances: 1, - max_memory_restart: '500M' -} -``` - ---- - -## Deployment Workflow - -``` -โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” -โ”‚ DEPLOYMENT WORKFLOW โ”‚ -โ”‚ โ”‚ -โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ -โ”‚ โ”‚ ENTWICKLUNG (DEV) โ”‚ โ”‚ PRODUKTION (PROD) โ”‚ โ”‚ -โ”‚ โ”‚ pl.c2sgmbh.de โ”‚ โ”‚ cms.c2sgmbh.de โ”‚ โ”‚ -โ”‚ โ”‚ 37.24.237.181 โ”‚ โ”‚ 162.55.85.18 โ”‚ โ”‚ -โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ -โ”‚ โ”‚ -โ”‚ Step 1: CODE ENTWICKELN โ”‚ -โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ -โ”‚ โ”‚ cd /home/payload/payload-cms โ”‚ โ”‚ -โ”‚ โ”‚ pnpm dev # Lokal testen โ”‚ โ”‚ -โ”‚ โ”‚ pnpm build # Build-Test โ”‚ โ”‚ -โ”‚ โ”‚ pm2 restart payload # Auf Dev-Server deployen โ”‚ โ”‚ -โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ -โ”‚ โ†“ โ”‚ -โ”‚ โ”‚ -โ”‚ Step 2: ZU GITHUB PUSHEN โ”‚ -โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ -โ”‚ โ”‚ git add . # Alle ร„nderungen stagen โ”‚ โ”‚ -โ”‚ โ”‚ git commit -m "feat: XYZ" # Commit erstellen โ”‚ โ”‚ -โ”‚ โ”‚ git push origin main # Zu GitHub pushen โ”‚ โ”‚ -โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ -โ”‚ โ†“ โ”‚ -โ”‚ โ”‚ -โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ -โ”‚ โ”‚ GITHUB REPOSITORY (PRIVAT) โ”‚ โ”‚ -โ”‚ โ”‚ https://github.com/c2s-admin/cms.c2sgmbh โ”‚ โ”‚ -โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ -โ”‚ โ†“ โ”‚ -โ”‚ โ”‚ -โ”‚ Step 3: AUF PRODUKTION DEPLOYEN โ”‚ -โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ -โ”‚ โ”‚ ssh payload@162.55.85.18 โ”‚ โ”‚ -โ”‚ โ”‚ ~/deploy.sh # Automatisches Deployment โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ Das deploy.sh Script macht: โ”‚ โ”‚ -โ”‚ โ”‚ โ”œโ”€ git pull origin main # Code von GitHub holen โ”‚ โ”‚ -โ”‚ โ”‚ โ”œโ”€ pnpm install # Dependencies aktualisieren โ”‚ โ”‚ -โ”‚ โ”‚ โ”œโ”€ pnpm build # Produktions-Build โ”‚ โ”‚ -โ”‚ โ”‚ โ””โ”€ pm2 restart payload # Service neustarten โ”‚ โ”‚ -โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ -โ”‚ โ”‚ -โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ -``` - -### Git-Setup auf Servern - -| Server | User | Remote | Auth-Methode | Status | -|--------|------|--------|--------------|--------| -| pl.c2sgmbh.de (Dev) | payload | HTTPS | GitHub CLI (`gh auth`) | โœ… Konfiguriert | -| cms.c2sgmbh.de (Prod) | payload | SSH | SSH-Key | โœ… Eingerichtet | - -### Deployment-Befehle - -**Entwicklungsserver โ†’ GitHub:** - -```bash -cd /home/payload/payload-cms -git status -pnpm build -pm2 restart payload -git add . -git commit -m "feat: Beschreibung der ร„nderung" -git push origin main -``` - -**GitHub โ†’ Produktionsserver:** - -```bash -# Option A: SSH + Deploy-Script (empfohlen) -ssh payload@162.55.85.18 '~/deploy.sh' - -# Option B: Manuelles SSH-Login -ssh payload@162.55.85.18 -cd ~/payload-cms -git pull origin main -pnpm install -pnpm build -pm2 restart payload -``` - ---- - -## Backup - -### Backup-Script (~/backup.sh) - -```bash -#!/bin/bash -set -e - -BACKUP_DIR=~/backups -DATE=$(date +%Y-%m-%d_%H-%M-%S) -RETENTION_DAYS=7 - -mkdir -p $BACKUP_DIR - -# PostgreSQL Backup -PGPASSWORD=Suchen55 pg_dump -h localhost -U payload payload_db > $BACKUP_DIR/payload_db_$DATE.sql -gzip $BACKUP_DIR/payload_db_$DATE.sql - -# Alte Backups lรถschen -find $BACKUP_DIR -name "*.sql.gz" -mtime +$RETENTION_DAYS -delete -``` - -### Cronjob (tรคglich 3:00 Uhr) - -``` -0 3 * * * /home/payload/backup.sh >> /home/payload/backups/backup.log 2>&1 -``` - ---- - -## Service-Management - -### PM2 Befehle - -```bash -pm2 status # Status -pm2 logs payload # Logs -pm2 restart payload # Neustart -pm2 save # Autostart speichern -``` - -### Systemd Services - -```bash -# PostgreSQL -systemctl status postgresql -systemctl restart postgresql - -# Nginx -systemctl status nginx -systemctl restart nginx -nginx -t # Config testen - -# Redis -systemctl status redis-server -systemctl restart redis-server -``` +**AI Tools:** Claude Code, Codex CLI, Gemini CLI, VS Code Remote-SSH --- ## URLs รœbersicht -| Service | Entwicklung | Produktion | -|---------|-------------|------------| -| Payload Admin | https://pl.c2sgmbh.de/admin | https://cms.c2sgmbh.de/admin | -| Payload API | https://pl.c2sgmbh.de/api | https://cms.c2sgmbh.de/api | -| Umami | - | https://analytics.c2sgmbh.de | +### Development (porwoll.tech) + +| Service | URL | +|---------|-----| +| Portal | https://porwoll.tech | +| Payload CMS | https://pl.porwoll.tech | +| Redis Commander | https://redis.porwoll.tech | +| Umami Analytics | https://umami.porwoll.tech | +| Frontend porwoll.de | https://porwoll-dev.porwoll.tech | +| (8 weitere) | https://*-dev.porwoll.tech | + +### Production (Hetzner) + +| Service | URL | +|---------|-----| +| Payload Admin | https://cms.c2sgmbh.de/admin | +| Payload API | https://cms.c2sgmbh.de/api | +| Umami Analytics | https://analytics.c2sgmbh.de | --- -## SSH Schnellzugriff +## Quick Reference ```bash -# Produktion (Hetzner 3) -ssh root@162.55.85.18 # Root -ssh payload@162.55.85.18 # Payload User -ssh umami@162.55.85.18 # Umami User -ssh claude@162.55.85.18 # Claude Code +# Frontend-Server +ssh frontend@10.10.181.104 -# Hetzner Server -ssh root@78.46.87.137 # Hetzner 1 (CCS) -ssh root@94.130.141.114 # Hetzner 2 (Porwoll) +# Hetzner 3 Production +ssh payload@162.55.85.18 -# Entwicklung (Proxmox) -ssh payload@10.10.181.100 # sv-payload -ssh root@10.10.181.101 # sv-postgres +# Caddy neu laden +ssh root@10.10.181.99 "systemctl reload caddy" + +# Frontend Service starten +systemctl start frontend-porwoll ``` --- -## Netzwerk & Firewall - -### UFW Regeln auf sv-payload (Dev) - -```bash -22/tcp ALLOW 10.10.181.0/24 # SSH aus VLAN -80/tcp ALLOW Anywhere # HTTP (ACME) -443/tcp ALLOW Anywhere # HTTPS -``` - -### UFW Regeln auf sv-postgres (Dev) - -```bash -22/tcp ALLOW 10.10.181.0/24 # SSH aus VLAN -5432/tcp ALLOW 10.10.181.100 # PostgreSQL nur von Payload -``` - -### UFW Regeln auf sv-hz03-backend (Prod) - -```bash -22/tcp ALLOW Anywhere # SSH -80/tcp ALLOW Anywhere # HTTP -443/tcp ALLOW Anywhere # HTTPS -``` - ---- - -## SSL Zertifikate - -| Domain | Anbieter | Status | -|--------|----------|--------| -| pl.c2sgmbh.de | Let's Encrypt (Caddy) | Auto-Renewal | -| cms.c2sgmbh.de | Let's Encrypt (Certbot) | Auto-Renewal | -| analytics.c2sgmbh.de | Let's Encrypt (Certbot) | Auto-Renewal | - ---- - -## Tech Stack - -| Komponente | Technologie | Version | -|------------|-------------|---------| -| CMS | Payload CMS | 3.x | -| Framework | Next.js | 15.4.7 | -| Runtime | Node.js | 22.x | -| Datenbank | PostgreSQL | 17 | -| Cache | Redis | 7.x | -| Analytics | Umami | 3.x | -| Process Manager | PM2 | Latest | -| Package Manager | pnpm | Latest | -| Reverse Proxy (Dev) | Caddy | 2.10.2 | -| Reverse Proxy (Prod) | Nginx | Latest | -| SSL | Let's Encrypt | - | - ---- - -## DSGVO-Konformitรคt - -Die Architektur wurde bewusst ohne Cloudflare designed: - -- Keine US-Dienste im Datenpfad fรผr Admin-Zugriffe -- Direkte รถffentliche IP statt Proxy -- Keine Auftragsverarbeiter-Vertrรคge fรผr CDN nรถtig -- Redakteur-IPs und Sessions bleiben in DE - ---- - -## Checkliste nach Deployment - -- [ ] `pm2 status` - Alle Prozesse online? -- [ ] `redis-cli ping` - Redis antwortet? -- [ ] Admin Panel erreichbar? -- [ ] `pm2 logs payload --lines 10` - Keine Fehler? - ---- - -*Stand: 09. Dezember 2025* +*Dokumentation: Martin Porwoll | Complex Care Solutions GmbH | 18.12.2025* diff --git a/docs/PROJECT_STATUS.md b/docs/PROJECT_STATUS.md new file mode 100644 index 0000000..bc0a1d2 --- /dev/null +++ b/docs/PROJECT_STATUS.md @@ -0,0 +1,206 @@ +# Projekt Status - Dezember 2025 + +**Stand:** 18. Dezember 2025 + +## Zusammenfassung + +Die komplette Entwicklungsinfrastruktur ist eingerichtet und funktionsfรคhig: +- Payload CMS Multi-Tenant (Dev + Prod) +- Multi-Frontend Development Environment +- AI-gestรผtzte Entwicklungstools +- Reverse Proxy Stack (Caddy + Nginx) +- Analytics (Umami) + +--- + +## โœ… Abgeschlossen + +### Infrastruktur VLAN 181 (Development) + +| LXC | Hostname | IP | Service | Status | +|-----|----------|-----|---------|--------| +| 699 | sv-caddy | 10.10.181.99 | Caddy Reverse Proxy | โœ… Running | +| 700 | sv-payload | 10.10.181.100 | Payload CMS + Redis | โœ… Running | +| 701 | sv-postgres | 10.10.181.101 | PostgreSQL 17 + Redis Cmd | โœ… Running | +| 702 | sv-dev-payload | 10.10.181.102 | Payload Experimental | โธ๏ธ Stopped | +| 703 | sv-analytics | 10.10.181.103 | Umami Analytics | โœ… Running | +| 704 | sv-frontend | 10.10.181.104 | Multi-Project Next.js | โœ… Running | + +### Hetzner 3 (Production) + +- [x] Debian 13 Installation +- [x] PostgreSQL 17 mit payload_db und umami_db +- [x] Redis Cache +- [x] Payload CMS Production (cms.c2sgmbh.de) +- [x] Umami Analytics Production (analytics.c2sgmbh.de) +- [x] Nginx Reverse Proxy mit Let's Encrypt +- [x] PM2 Process Management +- [x] Claude Code CLI +- [x] Backup-Scripts (tรคglich) +- [x] CVE-2025-55182 Hotfix + +### Caddy Reverse Proxy (sv-caddy) + +- [x] Caddy 2.9.x mit Cloudflare DNS Plugin +- [x] Wildcard SSL fรผr *.porwoll.tech +- [x] Cloudflare DNS-Challenge +- [x] Routing fรผr alle Services +- [x] Security Headers + +### Payload CMS + +- [x] Multi-Tenant Plugin +- [x] Redis Caching +- [x] Package-Versionen synchronisiert: + - Next.js 15.5.9 + - React 19.2.3 + - Payload 3.68.4 +- [x] GitHub Repository (complexcaresolutions/cms.c2sgmbh) + +### sv-frontend (Multi-Project) + +- [x] Node.js 22.x + pnpm +- [x] AI-Tools installiert: + - Claude Code 2.0.72 + - Codex CLI 0.73.0 + - Gemini CLI 0.21.2 +- [x] 9 Frontend-Projekte initialisiert +- [x] Systemd Services (Ports 3000-3008) +- [x] SSH-Zugriff mit Key +- [x] VS Code Remote-SSH kompatibel + +### GitHub Repositories + +Organisation: **complexcaresolutions** (Internal) + +- [x] cms.c2sgmbh (Payload CMS) +- [x] frontend.porwoll.de +- [x] frontend.blogwoman.de +- [x] frontend.caroline-porwoll.com +- [x] frontend.caroline-porwoll.de +- [x] frontend.complexcaresolutions.de +- [x] frontend.gunshin.de +- [x] frontend.sensualmoment.de +- [x] frontend.zweitmeinu.ng +- [x] frontend.zytoskandal.de + +--- + +## โš ๏ธ Kritische Aufgaben + +| Prioritรคt | Aufgabe | Status | +|-----------|---------|--------| +| ๐Ÿ”ด | Umami Dev Admin-Passwort รคndern | Offen | +| ๐Ÿ”ด | auth.zh3.de - 502 Bad Gateway beheben | Offen | +| ๐ŸŸก | pve04/pve05/Backup: Enterprise Repo | Offen | + +--- + +## ๐Ÿ”œ Nรคchste Schritte + +### Kurzfristig (diese Woche) + +1. [ ] Porwoll.de Frontend-Entwicklung starten +2. [ ] VS Code Remote-SSH testen +3. [ ] Claude Code auf sv-frontend authentifizieren + +### Mittelfristig (Januar 2025) + +4. [ ] Frontend-Staging auf Hetzner 3 einrichten +5. [ ] GitHub Actions fรผr Deployment +6. [ ] Content Collections in Payload erweitern +7. [ ] Design-System (Tailwind + Shadcn/UI) + +### Langfristig (Q1 2025) + +8. [ ] Alle 9 Frontends entwickeln +9. [ ] Migration von Plesk-Domains zu neuer Infra +10. [ ] CI/CD Pipeline komplett +11. [ ] Monitoring & Alerting + +--- + +## ๐Ÿ“Š Service-URLs + +### Development (porwoll.tech) + +| Service | URL | Status | +|---------|-----|--------| +| Portal | https://porwoll.tech | โœ… | +| Payload CMS | https://pl.porwoll.tech | โœ… | +| Redis Commander | https://redis.porwoll.tech | โœ… | +| Umami Analytics | https://umami.porwoll.tech | โœ… | +| Frontend porwoll.de | https://porwoll-dev.porwoll.tech | โœ… | +| (8 weitere) | https://*-dev.porwoll.tech | โธ๏ธ On-Demand | + +### Production (Hetzner) + +| Service | URL | Status | +|---------|-----|--------| +| Payload CMS | https://cms.c2sgmbh.de | โœ… | +| Umami Analytics | https://analytics.c2sgmbh.de | โœ… | + +--- + +## ๐Ÿ”ง Quick Commands + +### sv-frontend + +```bash +# SSH Zugang +ssh frontend@10.10.181.104 + +# Service starten/stoppen +systemctl start frontend-porwoll +systemctl stop frontend-porwoll + +# AI-Tools +claude # Claude Code +codex # Codex CLI +gemini # Gemini CLI +``` + +### Hetzner 3 + +```bash +# SSH Zugang +ssh payload@162.55.85.18 + +# Deploy +~/deploy.sh + +# Logs +pm2 logs payload +``` + +--- + +## ๐Ÿ“ ร„nderungsprotokoll + +### 18.12.2025 +- sv-frontend (LXC 704) komplett eingerichtet +- 9 GitHub Repositories erstellt +- Alle Next.js Projekte initialisiert +- Systemd Services fรผr alle Frontends +- Caddy Routing fรผr *-dev.porwoll.tech +- AI-Tools (Claude Code, Codex, Gemini) installiert +- Infrastruktur-Dokumentation aktualisiert + +### 12.12.2025 +- sv-caddy mit Cloudflare DNS-Challenge +- Wildcard SSL fรผr porwoll.tech +- Redis Commander auf sv-postgres +- pgAdmin4 entfernt (MIME-Type Probleme) + +### 11.12.2025 +- Hetzner 3 Production Setup +- Payload CMS Migration +- Umami Analytics Production +- Redis Caching (Dev + Prod) +- Package-Versionen synchronisiert + +### 26.11.2025 +- Initial Payload CMS Setup +- Multi-Tenant Plugin +- PostgreSQL auf sv-postgres +- Erste Tenants angelegt diff --git a/docs/anleitungen/TODO.md b/docs/anleitungen/TODO.md index a52be40..e8eeb7c 100644 --- a/docs/anleitungen/TODO.md +++ b/docs/anleitungen/TODO.md @@ -222,12 +222,21 @@ --- -*Letzte Aktualisierung: 17.12.2025* +*Letzte Aktualisierung: 18.12.2025* --- ## Changelog +### 18.12.2025 +- **Dokumentation konsolidiert:** + - CLAUDE.md: Tech-Stack auf aktuelle Versionen aktualisiert (Payload 3.68.4, Next.js 15.5.9, React 19.2.3) + - CLAUDE.md: Architektur-Diagramm erweitert (sv-caddy, sv-frontend hinzugefรผgt) + - CLAUDE.md: Videos/VideoCategories Collections hinzugefรผgt + - docs/INFRASTRUCTURE.md: Komplett aktualisiert mit neuer Infrastruktur + - docs/PROJECT_STATUS.md: Neues Statusdokument behalten + - Obsolete Dateien entfernt: INFRASTRUCTURE_COMPLETE_DECEMBER_2025.md, TECHSTACK_COMPLETE_DECEMBER_2025.md + ### 17.12.2025 - **Security Code-Review abgeschlossen:** - **IP Header Spoofing behoben:** `X-Forwarded-For`/`X-Real-IP` werden nur bei `TRUST_PROXY=true` vertraut From 7b51f928ddecc99f75451a80a1646920efe7f559 Mon Sep 17 00:00:00 2001 From: Martin Porwoll Date: Thu, 18 Dec 2025 15:49:38 +0000 Subject: [PATCH 2/8] docs(frontend): update to use production API, DB, SEO and consent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change all API URLs from pl.c2sgmbh.de (dev) to cms.c2sgmbh.de (prod) - Add environment configuration section with production endpoints - Add explanation why production data is used for development - Add SEO integration section with production data examples - Update Cookie-Consent section for production API - Add Videos, Timelines, Workflows to API endpoints - Add CORS configuration note - Update tenant-specific features for current state ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- docs/anleitungen/FRONTEND.md | 205 +++++++++++++++++++++++++++++------ 1 file changed, 171 insertions(+), 34 deletions(-) diff --git a/docs/anleitungen/FRONTEND.md b/docs/anleitungen/FRONTEND.md index 45657aa..367b3ea 100644 --- a/docs/anleitungen/FRONTEND.md +++ b/docs/anleitungen/FRONTEND.md @@ -1,21 +1,53 @@ # Frontend-Entwicklung - Payload CMS Multi-Tenant > **Server:** sv-frontend (LXC 704) - 10.10.181.104 -> **Backend API:** https://pl.c2sgmbh.de/api +> **Backend API:** https://cms.c2sgmbh.de/api (Production) ## รœbersicht Das Frontend wird als separates Next.js-Projekt entwickelt und nutzt Payload CMS als Headless CMS รผber die REST-API. +**Wichtig:** Die Frontend-Entwicklung verwendet die **Produktions-API und -Datenbank**, um mit echten Inhalten zu arbeiten. SEO-Einstellungen und Cookie-Consent-Konfigurationen werden ebenfalls aus der Produktionsumgebung geladen. + +--- + +## Umgebungskonfiguration + +### Environment Variables (.env.local) + +```env +# API-Endpunkte (PRODUKTION) +NEXT_PUBLIC_PAYLOAD_URL=https://cms.c2sgmbh.de +NEXT_PUBLIC_API_URL=https://cms.c2sgmbh.de/api + +# Analytics (optional) +NEXT_PUBLIC_UMAMI_HOST=https://analytics.c2sgmbh.de +NEXT_PUBLIC_UMAMI_WEBSITE_ID= + +# Tenant-Konfiguration (je nach Projekt) +NEXT_PUBLIC_TENANT_ID=4 +NEXT_PUBLIC_TENANT_SLUG=c2s +``` + +### Warum Production-Daten? + +| Aspekt | Grund | +|--------|-------| +| **Content** | Echte Inhalte fรผr realistische Entwicklung | +| **SEO** | Produktions-Meta-Tags und Structured Data | +| **Cookie-Consent** | Live Cookie-Konfigurationen (DSGVO-relevant) | +| **Media** | Produktions-Bilder mit allen GrรถรŸen | +| **Consistency** | Keine Sync-Probleme zwischen Dev/Prod | + --- ## API-Dokumentation | Ressource | URL | |-----------|-----| -| **Swagger UI** | https://pl.c2sgmbh.de/api/docs | -| **OpenAPI JSON** | https://pl.c2sgmbh.de/api/openapi.json | -| **REST API Base** | https://pl.c2sgmbh.de/api | +| **Swagger UI** | https://cms.c2sgmbh.de/api/docs | +| **OpenAPI JSON** | https://cms.c2sgmbh.de/api/openapi.json | +| **REST API Base** | https://cms.c2sgmbh.de/api | --- @@ -25,6 +57,7 @@ Das Frontend wird als separates Next.js-Projekt entwickelt und nutzt Payload CMS - [ ] **Block-Komponenten entwickeln** - [ ] Hero Block + - [ ] Hero Slider Block - [ ] Text Block - [ ] Image Text Block - [ ] Card Grid Block @@ -38,6 +71,9 @@ Das Frontend wird als separates Next.js-Projekt entwickelt und nutzt Payload CMS - [ ] Testimonials Block - [ ] Newsletter Block - [ ] Process Steps Block + - [ ] FAQ Block + - [ ] Team Block + - [ ] Services Block - [ ] **Newsletter-Anmelde-Formular** - API: `POST /api/newsletter/subscribe` @@ -45,7 +81,7 @@ Das Frontend wird als separates Next.js-Projekt entwickelt und nutzt Payload CMS - Felder: email, firstName (optional), tenantId, source - [ ] **Cookie-Banner implementieren** - - Cookie Configurations aus API laden + - Cookie Configurations aus Production-API laden - Consent-Logs an Backend senden - DSGVO-konform mit Opt-In @@ -57,9 +93,9 @@ Das Frontend wird als separates Next.js-Projekt entwickelt und nutzt Payload CMS - Unterstรผtzte Locales: `de` (default), `en` - [ ] **SEO-Integration** - - Meta-Tags aus Pages/Posts + - Meta-Tags aus Pages/Posts (Production) - Structured Data (JSON-LD) - - Sitemap: https://pl.c2sgmbh.de/sitemap.xml + - Sitemap: https://cms.c2sgmbh.de/sitemap.xml - [ ] **Suche implementieren** - API: `GET /api/search?q=...&locale=de` @@ -69,26 +105,26 @@ Das Frontend wird als separates Next.js-Projekt entwickelt und nutzt Payload CMS ### Tenant-spezifische Features #### porwoll.de -- [ ] Immobilien-Listing -- [ ] Objektsuche mit Filtern -- [ ] Kontaktformular mit Objekt-Referenz +- [ ] Portfolio-Galerie (Fotografie) +- [ ] Buchungsformular +- [ ] Before/After Bildvergleich #### complexcaresolutions.de (C2S) - [ ] Team-รœbersicht - [ ] Leistungs-Seiten +- [ ] Zertifizierungen - [ ] Karriere-Seite mit Stellenangeboten -#### gunshin.de (Fotografin-Portfolio) -- [ ] Portfolio-Galerie - - API: `GET /api/portfolios?where[tenant][equals]=5` - - Kategorien: `GET /api/portfolio-categories` -- [ ] Projekt-Detailseiten mit Lightbox +#### gunshin.de (Game Development) +- [ ] Projekt-Galerie + - API: `GET /api/projects?where[tenant][equals]=5` +- [ ] Portfolio-Seiten - [ ] Referenzen-Slider #### zweitmein.ng -- [ ] Produkt-รœbersicht (falls E-Commerce) - [ ] FAQ-Sektion - [ ] Preistabellen +- [ ] Kontaktformular --- @@ -107,14 +143,18 @@ Das Frontend wird als separates Next.js-Projekt entwickelt und nutzt Payload CMS | FAQs | `GET /api/faqs` | FAQ-Eintrรคge | | Portfolios | `GET /api/portfolios` | Portfolio-Projekte | | Media | `GET /api/media` | Medien/Bilder | +| Videos | `GET /api/videos` | Video-Bibliothek | +| Timelines | `GET /api/timelines` | Chronologische Events | +| Workflows | `GET /api/workflows` | Prozess-Darstellungen | -### Globals +### Globals (SEO & Settings aus Production) | Global | Endpoint | Beschreibung | |--------|----------|--------------| -| Site Settings | `GET /api/globals/site-settings` | Logo, Name, SEO | +| Site Settings | `GET /api/globals/site-settings` | Logo, Name, Kontakt | | Navigation | `GET /api/globals/navigation` | Menรผ-Struktur | -| SEO Settings | `GET /api/globals/seo-settings` | Default SEO | +| SEO Settings | `GET /api/globals/seo-settings` | Default SEO (Production) | +| Privacy Policy | `GET /api/globals/privacy-policy-settings` | Datenschutz | ### Spezielle Endpoints @@ -123,6 +163,8 @@ Das Frontend wird als separates Next.js-Projekt entwickelt und nutzt Payload CMS | `/api/search` | GET | Volltextsuche | | `/api/search/suggestions` | GET | Auto-Complete | | `/api/newsletter/subscribe` | POST | Newsletter-Anmeldung | +| `/api/timelines` | GET | Timeline-Daten | +| `/api/workflows` | GET | Workflow-Daten | --- @@ -132,10 +174,13 @@ Alle Collection-Anfragen sollten nach Tenant gefiltert werden: ```typescript // Beispiel: Posts fรผr Tenant "c2s" (ID: 4) -fetch('https://pl.c2sgmbh.de/api/posts?where[tenant][equals]=4&locale=de') +fetch('https://cms.c2sgmbh.de/api/posts?where[tenant][equals]=4&locale=de') // Beispiel: Pages fรผr Tenant "gunshin" (ID: 5) -fetch('https://pl.c2sgmbh.de/api/pages?where[tenant][equals]=5&locale=de') +fetch('https://cms.c2sgmbh.de/api/pages?where[tenant][equals]=5&locale=de') + +// Beispiel: SEO-Settings (Global, kein Tenant-Filter) +fetch('https://cms.c2sgmbh.de/api/globals/seo-settings') ``` ### Tenant-IDs @@ -181,10 +226,10 @@ Unterstรผtzte Locales: `de` (default), `en` ```typescript // Deutsch (default) -fetch('https://pl.c2sgmbh.de/api/posts?locale=de') +fetch('https://cms.c2sgmbh.de/api/posts?locale=de') // Englisch -fetch('https://pl.c2sgmbh.de/api/posts?locale=en') +fetch('https://cms.c2sgmbh.de/api/posts?locale=en') // Fallback: Wenn EN nicht vorhanden, wird DE zurรผckgegeben ``` @@ -196,7 +241,7 @@ fetch('https://pl.c2sgmbh.de/api/posts?locale=en') ### Anmeldung ```typescript -const response = await fetch('https://pl.c2sgmbh.de/api/newsletter/subscribe', { +const response = await fetch('https://cms.c2sgmbh.de/api/newsletter/subscribe', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -219,18 +264,25 @@ const response = await fetch('https://pl.c2sgmbh.de/api/newsletter/subscribe', { --- -## Cookie-Consent +## Cookie-Consent (Production-Daten) ### Konfiguration laden ```typescript -const config = await fetch('https://pl.c2sgmbh.de/api/cookie-configurations?where[tenant][equals]=4') +// Cookie-Konfiguration aus Production laden +const config = await fetch('https://cms.c2sgmbh.de/api/cookie-configurations?where[tenant][equals]=4') + .then(r => r.json()) + +// config.docs enthรคlt: +// - Kategorien (necessary, analytics, marketing, etc.) +// - Cookie-Details pro Kategorie +// - Texte fรผr Banner (lokalisiert) ``` ### Consent loggen ```typescript -await fetch('https://pl.c2sgmbh.de/api/consent-logs', { +await fetch('https://cms.c2sgmbh.de/api/consent-logs', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -245,12 +297,49 @@ await fetch('https://pl.c2sgmbh.de/api/consent-logs', { --- +## SEO-Integration (Production-Daten) + +### Global SEO-Settings + +```typescript +// SEO-Defaults aus Production laden +const seoSettings = await fetch('https://cms.c2sgmbh.de/api/globals/seo-settings') + .then(r => r.json()) + +// Enthรคlt: +// - defaultTitle, titleTemplate +// - defaultDescription +// - defaultImage (OG-Image) +// - robotsDefault +``` + +### Page-spezifische SEO + +```typescript +// SEO-Daten aus Page laden +const page = await fetch('https://cms.c2sgmbh.de/api/pages?where[slug][equals]=about&where[tenant][equals]=4') + .then(r => r.json()) + +// page.docs[0].meta enthรคlt: +// - title, description +// - image (OG-Image Override) +// - noIndex, noFollow +``` + +### Sitemap + +Die Sitemap wird automatisch von Payload generiert: +- **URL:** https://cms.c2sgmbh.de/sitemap.xml +- Enthรคlt alle publizierten Pages und Posts + +--- + ## Kontaktformular Formular-Submissions werden รผber die Forms-Collection verarbeitet: ```typescript -await fetch('https://pl.c2sgmbh.de/api/form-submissions', { +await fetch('https://cms.c2sgmbh.de/api/form-submissions', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -272,14 +361,14 @@ Falls User-Authentifizierung benรถtigt wird: ```typescript // Login -const { token, user } = await fetch('https://pl.c2sgmbh.de/api/users/login', { +const { token, user } = await fetch('https://cms.c2sgmbh.de/api/users/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email, password }) }).then(r => r.json()) // Authentifizierte Requests -fetch('https://pl.c2sgmbh.de/api/...', { +fetch('https://cms.c2sgmbh.de/api/...', { headers: { 'Authorization': `JWT ${token}` } }) ``` @@ -293,7 +382,9 @@ fetch('https://pl.c2sgmbh.de/api/...', { Die Payload-Typen kรถnnen aus dem Backend exportiert werden: ```bash -# Auf dem Payload-Server +# Auf dem Payload-Server (Production) +ssh payload@162.55.85.18 +cd ~/payload-cms pnpm payload generate:types # Datei: src/payload-types.ts @@ -316,14 +407,60 @@ Diese Datei kann ins Frontend-Projekt kopiert werden fรผr typsichere API-Calls. - TTL: 60 Sekunden fรผr Suche - Cache wird bei Content-ร„nderungen invalidiert +### CORS + +Die Production-API erlaubt Requests von: +- `*.porwoll.tech` (Development) +- `porwoll.de`, `complexcaresolutions.de`, `gunshin.de` (Production) + +--- + +## Development Server (sv-frontend) + +### SSH-Zugang + +```bash +ssh frontend@10.10.181.104 +``` + +### Projekt starten + +```bash +cd ~/frontend.porwoll.de +pnpm dev +# Lรคuft auf Port 3000 โ†’ https://porwoll-dev.porwoll.tech +``` + +### AI-Tools + +```bash +claude # Claude Code CLI +codex # Codex CLI +gemini # Gemini CLI +``` + +### Service-Management + +```bash +# Systemd Service starten +systemctl start frontend-porwoll + +# Service stoppen +systemctl stop frontend-porwoll + +# Logs anzeigen +journalctl -u frontend-porwoll -f +``` + --- ## Ressourcen - **Payload CMS Docs:** https://payloadcms.com/docs -- **API-Dokumentation:** https://pl.c2sgmbh.de/api/docs -- **Backend-Repository:** https://github.com/c2s-admin/cms.c2sgmbh.git +- **API-Dokumentation:** https://cms.c2sgmbh.de/api/docs +- **Backend-Repository:** https://github.com/complexcaresolutions/cms.c2sgmbh.git +- **Analytics:** https://analytics.c2sgmbh.de --- -*Erstellt: 11.12.2025* +*Letzte Aktualisierung: 18.12.2025* From 9c9ae86d995a917eebbee495f714e15d2c96f3a3 Mon Sep 17 00:00:00 2001 From: Martin Porwoll Date: Thu, 18 Dec 2025 15:53:41 +0000 Subject: [PATCH 3/8] docs: add comprehensive DEPLOYMENT.md guide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create docs/DEPLOYMENT.md with full deployment documentation - Document staging (pl.porwoll.tech) and production (cms.c2sgmbh.de) workflows - Add rollback procedures and migration handling - Include PM2 configuration and health checks - Add troubleshooting section and deployment checklists - Update TODO.md to mark task as completed - Add DEPLOYMENT.md to CLAUDE.md documentation references ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 1 + docs/DEPLOYMENT.md | 525 +++++++++++++++++++++++++++++++++++++++ docs/anleitungen/TODO.md | 4 +- 3 files changed, 528 insertions(+), 2 deletions(-) create mode 100644 docs/DEPLOYMENT.md diff --git a/CLAUDE.md b/CLAUDE.md index 9a08c54..c028b2f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1014,6 +1014,7 @@ Automatisches Deployment auf Staging-Server bei Push auf `develop`: ### Hauptdokumentation - `CLAUDE.md` - Diese Datei (Projekt-รœbersicht fรผr AI-Assistenten) - `docs/INFRASTRUCTURE.md` - Infrastruktur-รœbersicht (Dev + Prod) +- `docs/DEPLOYMENT.md` - Deployment-Prozess & Checklisten - `docs/PROJECT_STATUS.md` - Aktueller Projektstatus & Roadmap - `docs/STAGING-DEPLOYMENT.md` - Staging Deployment Workflow diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md new file mode 100644 index 0000000..03d8dbd --- /dev/null +++ b/docs/DEPLOYMENT.md @@ -0,0 +1,525 @@ +# Deployment Guide - Payload CMS Multi-Tenant + +*Letzte Aktualisierung: 18. Dezember 2025* + +## รœbersicht + +Dieses Dokument beschreibt den Deployment-Prozess fรผr das Payload CMS Multi-Tenant-System. + +``` +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ DEVELOPMENT โ”‚ โ”‚ STAGING โ”‚ โ”‚ PRODUCTION โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ sv-frontend โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚ sv-payload โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚ Hetzner 3 โ”‚ +โ”‚ Local Dev โ”‚ โ”‚ pl.porwoll.tech โ”‚ โ”‚ cms.c2sgmbh.de โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ develop branch โ”‚ โ”‚ develop branch โ”‚ โ”‚ main branch โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ +``` + +--- + +## Umgebungen + +| Umgebung | Server | URL | Branch | Zweck | +|----------|--------|-----|--------|-------| +| **Development** | sv-payload (LXC 700) | https://pl.porwoll.tech | `develop` | Entwicklung & Testing | +| **Production** | Hetzner 3 | https://cms.c2sgmbh.de | `main` | Live-System | + +--- + +## Staging Deployment (Development โ†’ pl.porwoll.tech) + +### Automatisch via GitHub Actions + +Bei jedem Push auf `develop` wird automatisch deployed: + +```yaml +# .github/workflows/deploy-staging.yml +on: + push: + branches: [develop] +``` + +**Ablauf:** +1. Pre-deployment Checks (Lint, Tests) +2. SSH-Verbindung zu sv-payload +3. `git pull origin develop` +4. `pnpm install` +5. `pnpm payload migrate` +6. `pnpm build` +7. `pm2 restart payload` +8. Health Check + +### Manuell auf sv-payload + +```bash +# SSH zum Server +ssh payload@10.10.181.100 + +# Ins Projektverzeichnis +cd /home/payload/payload-cms + +# ร„nderungen holen +git pull origin develop + +# Dependencies aktualisieren +pnpm install + +# Migrationen ausfรผhren (falls vorhanden) +pnpm payload migrate + +# Build erstellen +pnpm build + +# PM2 neustarten +pm2 restart payload + +# Logs prรผfen +pm2 logs payload --lines 20 +``` + +### Mit Deploy-Script + +```bash +# Auf sv-payload +./scripts/deploy-staging.sh + +# Optionen: +./scripts/deploy-staging.sh --skip-build # Nur Code-Update +./scripts/deploy-staging.sh --skip-migrations # Ohne Migrationen +``` + +--- + +## Production Deployment (main โ†’ cms.c2sgmbh.de) + +### Schritt 1: Merge zu main + +```bash +# Auf dem Development-Server oder lokal +git checkout main +git pull origin main +git merge develop +git push origin main +``` + +### Schritt 2: Deploy auf Hetzner 3 + +```bash +# SSH zum Production-Server +ssh payload@162.55.85.18 + +# Deploy-Script ausfรผhren +~/deploy.sh +``` + +### Deploy-Script (~/deploy.sh) + +```bash +#!/bin/bash +set -e + +cd ~/payload-cms + +echo "๐Ÿ“ฅ Pulling latest changes..." +git pull origin main + +echo "๐Ÿ“ฆ Installing dependencies..." +pnpm install + +echo "๐Ÿ”„ Running migrations..." +pnpm payload migrate + +echo "๐Ÿ—๏ธ Building..." +pnpm build + +echo "๐Ÿ”„ Restarting PM2..." +pm2 restart payload + +echo "โœ… Deployment complete!" +pm2 status +``` + +### Manuelles Deployment + +```bash +ssh payload@162.55.85.18 +cd ~/payload-cms +git pull origin main +pnpm install +pnpm payload migrate +pnpm build +pm2 restart payload +``` + +--- + +## Rollback + +### Auf vorherigen Commit zurรผcksetzen + +```bash +# Letzten funktionierenden Commit finden +git log --oneline -10 + +# Zurรผcksetzen (VORSICHT: ร„ndert History nicht) +git checkout +pnpm install +pnpm build +pm2 restart payload + +# Oder: Hard Reset (VORSICHT: ร„ndert History) +git reset --hard +git push --force origin main # Nur im Notfall! +``` + +### Datenbank-Rollback + +```bash +# Backup wiederherstellen (nur bei Datenverlust) +gunzip -c ~/backups/payload_db_YYYY-MM-DD_HH-MM-SS.sql.gz | \ + psql -h localhost -U payload -d payload_db +``` + +--- + +## Migrationen + +### Migration erstellen + +```bash +# Auf Development-Server +pnpm payload migrate:create + +# Generiert: src/migrations/YYYYMMDD_HHMMSS_.ts +``` + +### Migration ausfรผhren + +```bash +# Normale Ausfรผhrung +pnpm payload migrate + +# Bei PgBouncer-Problemen: Direkte Verbindung +./scripts/db-direct.sh migrate +``` + +### Migration-Status prรผfen + +```bash +pnpm payload migrate:status +``` + +--- + +## Build-Konfiguration + +### Memory-Limits + +Der Server hat 8GB RAM. Build-Einstellungen: + +```json +// package.json +{ + "scripts": { + "build": "cross-env NODE_OPTIONS='--no-deprecation --max-old-space-size=2048' next build" + } +} +``` + +### Bei Memory-Problemen + +```bash +# PM2 stoppen um Speicher freizugeben +pm2 stop payload + +# Build mit reduziertem Memory +NODE_OPTIONS="--no-deprecation --max-old-space-size=1024" pnpm build + +# PM2 wieder starten +pm2 start payload +``` + +--- + +## PM2 Konfiguration + +### ecosystem.config.cjs + +```javascript +module.exports = { + apps: [ + { + name: 'payload', + script: 'node_modules/.bin/next', + args: 'start', + cwd: '/home/payload/payload-cms', + instances: 1, + max_memory_restart: '2G', + env: { + NODE_ENV: 'production', + PORT: 3000 + } + }, + { + name: 'queue-worker', + script: './scripts/run-queue-worker.ts', + interpreter: 'node', + interpreter_args: '--import tsx', + cwd: '/home/payload/payload-cms', + instances: 1, + max_memory_restart: '500M' + } + ] +} +``` + +### PM2 Befehle + +```bash +pm2 status # Status aller Prozesse +pm2 logs payload # Logs anzeigen +pm2 logs queue-worker # Queue-Worker Logs +pm2 restart payload # Neustart +pm2 restart all # Alle neustarten +pm2 save # Autostart-Konfiguration speichern +pm2 startup # Systemd-Integration +``` + +--- + +## Health Checks + +### Nach Deployment prรผfen + +```bash +# 1. PM2 Status +pm2 status + +# 2. Logs auf Fehler prรผfen +pm2 logs payload --lines 50 + +# 3. API erreichbar? +curl -I https://cms.c2sgmbh.de/api/users + +# 4. Admin Panel erreichbar? +curl -I https://cms.c2sgmbh.de/admin + +# 5. Redis verbunden? +redis-cli ping +``` + +### Automatischer Health Check + +```bash +#!/bin/bash +# health-check.sh + +API_URL="https://cms.c2sgmbh.de/api" +ADMIN_URL="https://cms.c2sgmbh.de/admin" + +# API Check +if curl -sf "$API_URL/users" > /dev/null; then + echo "โœ… API OK" +else + echo "โŒ API FAILED" + exit 1 +fi + +# Admin Check +if curl -sf "$ADMIN_URL" > /dev/null; then + echo "โœ… Admin OK" +else + echo "โŒ Admin FAILED" + exit 1 +fi + +echo "โœ… All checks passed" +``` + +--- + +## Umgebungsvariablen + +### Production (.env) + +```env +# Datenbank +DATABASE_URI=postgresql://payload:***@localhost:5432/payload_db +PAYLOAD_SECRET=*** + +# URLs +PAYLOAD_PUBLIC_SERVER_URL=https://cms.c2sgmbh.de +NEXT_PUBLIC_SERVER_URL=https://cms.c2sgmbh.de + +# Environment +NODE_ENV=production +PORT=3001 + +# Redis +REDIS_URL=redis://localhost:6379 + +# Security +CSRF_SECRET=*** +TRUST_PROXY=true +``` + +### Staging (.env) + +```env +# Datenbank (via PgBouncer) +DATABASE_URI=postgresql://payload:***@127.0.0.1:6432/payload_db +PAYLOAD_SECRET=*** + +# URLs +PAYLOAD_PUBLIC_SERVER_URL=https://pl.porwoll.tech +NEXT_PUBLIC_SERVER_URL=https://pl.porwoll.tech + +# Environment +NODE_ENV=production +PORT=3000 + +# Redis +REDIS_URL=redis://localhost:6379 + +# Security +CSRF_SECRET=*** +TRUST_PROXY=true +``` + +--- + +## CI/CD Pipeline + +### GitHub Actions Workflows + +| Workflow | Trigger | Aktion | +|----------|---------|--------| +| `ci.yml` | Push/PR auf main, develop | Lint, Test, Build | +| `security.yml` | Push/PR, Schedule | Security Scanning | +| `deploy-staging.yml` | Push auf develop | Auto-Deploy zu Staging | + +### Secrets (GitHub) + +| Secret | Beschreibung | +|--------|--------------| +| `STAGING_SSH_KEY` | SSH Private Key fรผr sv-payload | + +### Manuelles Deployment triggern + +```bash +# Via GitHub CLI +gh workflow run deploy-staging.yml + +# Mit skip_tests Option +gh workflow run deploy-staging.yml -f skip_tests=true +``` + +--- + +## Backup vor Deployment + +### Automatisches Backup + +Backups laufen tรคglich um 03:00 Uhr. Vor groรŸen Deployments manuell: + +```bash +# Auf Production +~/backup.sh + +# Auf Staging +/home/payload/backups/postgres/backup-db.sh --verbose +``` + +### Backup-Speicherorte + +| Server | Lokal | Offsite | +|--------|-------|---------| +| Production | ~/backups/ | - | +| Staging | /home/payload/backups/postgres/ | s3://c2s/backups/postgres/ | + +--- + +## Troubleshooting + +### Build schlรคgt fehl + +```bash +# Cache lรถschen +rm -rf .next +pnpm build + +# Mit mehr Speicher +NODE_OPTIONS="--max-old-space-size=4096" pnpm build +``` + +### PM2 startet nicht + +```bash +# Logs prรผfen +pm2 logs payload --lines 100 + +# Prozess komplett entfernen und neu starten +pm2 delete payload +pm2 start ecosystem.config.cjs +``` + +### Datenbank-Verbindung fehlgeschlagen + +```bash +# PgBouncer Status (Staging) +sudo systemctl status pgbouncer + +# PostgreSQL Status (Production) +sudo systemctl status postgresql + +# Verbindung testen +psql -h localhost -U payload -d payload_db -c "SELECT 1" +``` + +### Migration fehlgeschlagen + +```bash +# Status prรผfen +pnpm payload migrate:status + +# Bei PgBouncer-Problemen +./scripts/db-direct.sh migrate + +# Einzelne Migration manuell +pnpm payload migrate --name 20251216_073000_add_video_collections +``` + +--- + +## Checkliste + +### Vor dem Deployment + +- [ ] Alle Tests grรผn (`pnpm test`) +- [ ] Build erfolgreich (`pnpm build`) +- [ ] Migrationen getestet auf Staging +- [ ] Backup erstellt (bei Datenbank-ร„nderungen) +- [ ] CLAUDE.md/Docs aktualisiert (bei neuen Features) + +### Nach dem Deployment + +- [ ] `pm2 status` - Prozesse online +- [ ] Admin Panel erreichbar +- [ ] API funktioniert +- [ ] Logs auf Fehler geprรผft +- [ ] Neue Features manuell getestet + +--- + +## Kontakte + +| Rolle | Kontakt | +|-------|---------| +| Server Admin | Martin Porwoll | +| Repository | https://github.com/complexcaresolutions/cms.c2sgmbh | + +--- + +*Dokumentation: Complex Care Solutions GmbH | 18.12.2025* diff --git a/docs/anleitungen/TODO.md b/docs/anleitungen/TODO.md index e8eeb7c..d065247 100644 --- a/docs/anleitungen/TODO.md +++ b/docs/anleitungen/TODO.md @@ -39,7 +39,7 @@ ### Dokumentation | Status | Task | |--------|------| -| [ ] | DEPLOYMENT.md erstellen | +| [x] | DEPLOYMENT.md erstellen | --- @@ -173,7 +173,7 @@ ## Dokumentation -- [ ] DEPLOYMENT.md (Deployment-Prozess) +- [x] DEPLOYMENT.md (Deployment-Prozess) *(erledigt: 18.12.2025)* --- From ba0f37a5b2aa3ddb60022583b3b03d517d25a215 Mon Sep 17 00:00:00 2001 From: Martin Porwoll Date: Thu, 18 Dec 2025 16:03:45 +0000 Subject: [PATCH 4/8] docs(analytics): update URLs to use production endpoints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update Umami URLs from internal IPs to production (analytics.c2sgmbh.de) - Add Development vs Production URL comparison table - Update UmamiScript component to use production URL as default - Add Payload CMS API URLs to frontend .env.local example - Update server-side tracking to use production Umami - Add global type declarations for gtag and CookieConsent ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- docs/anleitungen/Analytics.md | 981 ++++++++++++++++++++++++++++++++++ 1 file changed, 981 insertions(+) create mode 100644 docs/anleitungen/Analytics.md diff --git a/docs/anleitungen/Analytics.md b/docs/anleitungen/Analytics.md new file mode 100644 index 0000000..fc6b9aa --- /dev/null +++ b/docs/anleitungen/Analytics.md @@ -0,0 +1,981 @@ +# ANALYTICS-Lร–SUNG: Implementierungsรผbersicht fรผr Payload CMS + +*Letzte Aktualisierung: 18. Dezember 2025* + +## Kontext + +Du entwickelst das Multi-Tenant Payload CMS Backend und Next.js Frontend fรผr 4 Websites. Diese Dokumentation beschreibt die Analytics-Lรถsung, die in das Frontend integriert werden muss. + +**Wichtig:** Frontends verwenden die **Production-API** (cms.c2sgmbh.de) und **Production-Analytics** (analytics.c2sgmbh.de). + +--- + +## Architektur-รœbersicht + +``` +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ ANALYTICS ARCHITEKTUR โ”‚ +โ”‚ โ”‚ +โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ +โ”‚ โ”‚ OHNE CONSENT (immer aktiv) โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ UMAMI ANALYTICS โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Server: sv-analytics (10.10.181.103:3000) โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Dashboard: http://10.10.181.103:3000 โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Script: /custom.js (Anti-Adblock) โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Endpoint: /api/send โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Features: โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข Cookieless Tracking (DSGVO-konform ohne Einwilligung) โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข Pageviews, Sessions, Referrer, UTM-Parameter โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข Custom Events (Newsletter, Formulare, CTAs, Downloads) โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข 100% Erfassung aller Besucher โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ +โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ”‚ โ”‚ +โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ +โ”‚ โ”‚ MIT CONSENT (Kategorie: "marketing") โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ GOOGLE ADS CONVERSION โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Client-Side (bei Consent): โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข Google Ads Tag (gtag.js) โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข Conversion Tracking โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข Remarketing Audiences โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Server-Side (immer, anonymisiert): โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข Google Ads Conversion API โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข Enhanced Conversions (gehashte E-Mail) โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข GCLID-basierte Attribution โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ GOOGLE CONSENT MODE v2 โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Integration mit bestehendem Orestbida Consent-Banner โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Kategorie "marketing" steuert: โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข ad_storage โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข ad_user_data โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ โ€ข ad_personalization โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ +โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ”‚ โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ +``` + +--- + +## Infrastruktur + +### Umami Server + +| Umgebung | Server | URL | Dashboard | +|----------|--------|-----|-----------| +| **Production** | Hetzner 3 | https://analytics.c2sgmbh.de | https://analytics.c2sgmbh.de | +| **Development** | sv-analytics (LXC 703) | https://umami.porwoll.tech | https://umami.porwoll.tech | + +| Eigenschaft | Production | Development | +|-------------|------------|-------------| +| **Tracking Script** | https://analytics.c2sgmbh.de/script.js | https://umami.porwoll.tech/script.js | +| **API Endpoint** | https://analytics.c2sgmbh.de/api/send | https://umami.porwoll.tech/api/send | +| **Datenbank** | umami_db auf Hetzner 3 | umami_db auf sv-postgres | + +### Website-IDs (Multi-Tenant) + +Die Website-IDs werden in Umami fรผr jeden Tenant erstellt: + +```typescript +// src/config/analytics.ts + +export const UMAMI_WEBSITE_IDS: Record = { + 'porwoll.de': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + 'complexcaresolutions.de': 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy', + 'gunshin.de': 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz', + 'zweitmeinu.ng': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', +} + +// Production URL fรผr Frontends +export const UMAMI_HOST = process.env.NEXT_PUBLIC_UMAMI_HOST || 'https://analytics.c2sgmbh.de' +``` + +--- + +## Frontend-Integration + +### 1. Umami Script Komponente + +```typescript +// src/components/analytics/UmamiScript.tsx + +'use client' + +import Script from 'next/script' + +interface UmamiScriptProps { + websiteId: string + host?: string +} + +export function UmamiScript({ + websiteId, + host = 'https://analytics.c2sgmbh.de' // Production default +}: UmamiScriptProps) { + if (!websiteId) return null + + return ( +