Commit graph

5 commits

Author SHA1 Message Date
13507d1361 feat(youtube): add metrics sync cron endpoints
Add two cron endpoints for automated YouTube metrics syncing:
- /api/cron/youtube-metrics-sync (every 6 hours): syncs video performance
  metrics (views, likes, comments) for all active channels
- /api/cron/youtube-channel-sync (daily at 04:00 UTC): syncs channel-level
  statistics (subscribers, total views, video count)

Both endpoints follow the established cron pattern with CRON_SECRET auth,
concurrent execution guards, HEAD monitoring, and structured logging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 13:27:05 +00:00
cb035d209d feat(dashboard): Phase 3 - Scheduled Reports & Real-time Updates
Phase 3.0a - Scheduled Reports:
- ReportSchedules Collection: Zeitplan-Verwaltung für automatische Reports
  - Frequenz: täglich, wöchentlich, monatlich
  - Formate: PDF, Excel (CSV), HTML E-Mail
  - Report-Typen: Übersicht, Sentiment, Response-Metriken, Content-Performance
  - Multiple Empfänger per E-Mail
  - Zeitzone-Support

- ReportGeneratorService: Report-Generierung
  - Datensammlung aus community-interactions
  - HTML-Template für PDF und E-Mail
  - CSV-Export für Excel-kompatible Daten

- Cron-Endpoint: /api/cron/send-reports (stündlich)
  - Prüft fällige Reports
  - Automatischer Versand per E-Mail
  - Status-Tracking und Fehlerbehandlung

Phase 3.0b - Real-time Updates:
- SSE Stream Endpoint: /api/community/stream
  - Server-Sent Events für Live-Updates
  - 5-Sekunden Polling-Intervall
  - Heartbeat für Verbindungserhalt
  - Automatische Reconnection

- useRealtimeUpdates Hook:
  - React Hook für SSE-Konsum
  - Verbindungsstatus-Management
  - Update-Counter für Badges
  - Channel-Filterung

Vercel Cron aktualisiert:
- send-reports: stündlich (0 * * * *)

Migrationen:
- 20260116_120000_add_report_schedules

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 22:10:30 +00:00
7774616f00 feat(cron): Phase 2.6 - Vercel Cron Configuration
Konfiguriert automatische Hintergrund-Jobs für Vercel:

- Token-Refresh Cron: 2x täglich (6:00 + 18:00 UTC)
  - Erneuert OAuth-Tokens 7 Tage vor Ablauf
  - Benachrichtigt Manager bei Problemen

- Dokumentation in CLAUDE.md:
  - Neue Sektion "Scheduled Cron Jobs (Vercel)"
  - Übersicht aller Cron-Endpoints
  - Beispiele für manuellen Trigger
  - Monitoring-Hinweise

Bestehende Crons:
- community-sync: alle 15 Minuten (YouTube/Facebook/Instagram)
- token-refresh: 2x täglich (OAuth Token Renewal)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 21:53:15 +00:00
89882a545b feat(community): Phase 2.4 - Unified Sync Service
Implements a unified sync service that orchestrates comment
synchronization across all social media platforms.

UnifiedSyncService:
- Platform-agnostic sync orchestration
- Support for YouTube, Facebook, and Instagram
- Parallel platform detection and account grouping
- Progress tracking with live status updates
- Aggregated results per platform
- Error handling with partial results support

New API Endpoints:
- GET/POST /api/cron/community-sync
  - Cron endpoint for scheduled multi-platform sync
  - Query params: platforms, accountIds, analyzeWithAI, maxItems
  - HEAD for monitoring status

- GET /api/community/sync-status
  - Live sync status for dashboard
  - Platform overview with account details
  - Interaction statistics (total, today, unanswered)
  - Last sync result summary

Configuration:
- vercel.json updated to use community-sync cron
- 15-minute sync interval maintained

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 21:33:42 +00:00
797f1a9100 docs: Phase 2.2 Abschlussbericht und Cron-Konfiguration
- Abschlussbericht für Konzept-KI erstellt
- vercel.json mit 15-Minuten Cron-Schedule hinzugefügt
- CRON_SECRET in .env konfiguriert (nicht committed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 17:01:10 +00:00