Commit graph

47 commits

Author SHA1 Message Date
847018cd60 docs: add Git branching workflow to CLAUDE.md and DEPLOYMENT.md
- Document develop → staging, main → production workflow
- Add branch descriptions and commit conventions
- Include workflow steps with commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 17:35:25 +00:00
d7dfa2e2ea docs: add Community Management APIs to FRONTEND.md and API_ANLEITUNG.md
Add documentation for YouTube/Meta integration:
- YouTube Channels, Content, Series, Notifications APIs
- Social Platforms, Accounts, Community Interactions APIs
- Code examples for frontend integration
- Field documentation with curl examples

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 17:23:10 +00:00
a923d3ecb4 docs: cleanup and update documentation for January 2026
- Delete redundant TODO.md (consolidated into PROJECT_STATUS.md)
- Simplify STAGING-DEPLOYMENT.md to quick reference format
- Update PROJECT_STATUS.md with January 2026 status:
  - Add Community Management System section
  - Document Payload 3.72.0 login bug (#15243)
  - Update roadmap and changelog
- Update framework-monitoring.md with current versions and bug warning
- Add YouTube/Meta collections to CLAUDE.md:
  - YouTubeChannels, YouTubeContent, YtSeries, YtNotifications
  - MetaAccounts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 15:29:34 +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
3464494b14 feat(community): Phase 2.2 - YouTube Auto-Sync und AI Reply Suggestions
Implementiert automatische YouTube-Kommentar-Synchronisation und
KI-gestützte Antwortvorschläge für das Community Management.

Neue Features:
- Cron-Endpoint für externen Scheduler (/api/cron/youtube-sync)
- ClaudeReplyService für AI-generierte Antworten (3 Tonalitäten)
- Sync Status API mit Live-Polling
- AI Reply Suggestions UI mit Varianten-Auswahl
- Job Logger für strukturiertes Logging von Background Jobs

Änderungen:
- ClaudeAnalysisService: Model-Update auf claude-3-5-haiku-20241022
- CommunityInbox: Sync Status Badge, AI Reply Suggestions Integration
- SCSS: Styles für Sync-Indicator und Suggestion Cards

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:44:06 +00:00
a5e634ccaf docs: add Community Phase 2.1 Analytics implementation report
Complete implementation verification for concept AI:
- All 6 API endpoints implemented
- All 6 React components implemented
- SCSS styling with BEM convention
- Responsive design (3 breakpoints)
- Sidebar navigation integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:00:02 +00:00
22592bf759 fix(Community): convert custom views to client components
- Fix Server Components render error by using 'use client' directive
- Remove DefaultTemplate which requires server-side props
- Add Community Analytics Dashboard view with charts
- Add Analytics API endpoints (overview, sentiment, response metrics, etc.)
- Add implementation report for design AI

The custom views now work correctly within Payload's RootLayout context.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:05:39 +00:00
3294fbb506 feat(YouTube): add YouTube Operations Hub with YtSeries collection
Complete YouTube content management system:
- YouTubeChannels: Channel management with branding and metrics
- YouTubeContent: Video pipeline with workflow, approvals, scheduling
- YtSeries: Dedicated series management per channel (NEW)
- YtBatches: Production batch tracking with targets and progress
- YtTasks: Task management with notifications
- YtNotifications: User notification system
- YtMonthlyGoals: Monthly production goals per channel
- YtScriptTemplates: Reusable script templates
- YtChecklistTemplates: Checklist templates for workflows

Features:
- Role-based access (YouTubeManager, YouTubeCreator, YouTubeViewer)
- Auto-task generation on status changes
- Series relationship with channel-based filtering
- API endpoints for dashboard, tasks, and task completion
- German/English localization support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:54:40 +00:00
15f3fa2481 feat(BlogWoman): add tenant seed scripts and block migrations
- Add migration for BlogWoman page blocks (favorites-block, series-block,
  series-detail-block, featured-content-block) with all required columns
- Add seed scripts for BlogWoman tenant creation with full content:
  - 10 pages (Startseite, Über mich, Newsletter, etc.)
  - 7 blog posts
  - 9 series (GRFI, Investment-Piece, Pleasure P&L, etc.)
  - 4 categories, 10 tags, 1 author
  - Navigation, social links, cookie configuration
- Add Konzept-KI guide for AI-assisted tenant creation
- Add BlogWoman tenant prompt template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 11:13:32 +00:00
49d317fc84 docs: update anleitungen with BlogWoman features and fixes
API_ANLEITUNG.md:
- Fix rate limiting section (was incorrectly stated as not implemented)
- Add comprehensive rate limit documentation with limits table
- Expand collections overview from 13 to 42+ collections
- Add BlogWoman APIs (Favorites, Series)

FRONTEND.md:
- Fix Globals section (SiteSettings/Navigations are now Collections)
- Add Favorites and Series APIs
- Update date

UNIVERSAL_FEATURES.md:
- Add Favorites Collection (affiliate products)
- Add Series Collection (YouTube series)
- Add 5 new BlogWoman blocks documentation
- Update files overview and multi-tenant config
- Add version 1.3 changelog entry

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 15:05:23 +00:00
3ccb8bd585 feat(BlogWoman): add Favorites, Series collections and content blocks
Add new collections and blocks for BlogWoman affiliate and video content:

Collections:
- Favorites: Affiliate products with categories, badges, and price ranges
- Series: YouTube series with custom branding (logo, colors)

Blocks:
- FavoritesBlock: Grid/list/carousel display for affiliate products
- SeriesBlock: Series overview with filtering
- SeriesDetailBlock: Single series page with hero
- VideoEmbedBlock: YouTube/Vimeo embed with privacy mode
- FeaturedContentBlock: Curated mixed-content collections

Also includes documentation updates for deployment and API guides.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 14:57:58 +00:00
9e433315e5 feat: add automatic schema sync to deployment workflow
- Add drizzle.production.config.ts for schema synchronization
- Add scripts/sync-schema.sh for manual schema sync
- Update deploy-production.sh to run drizzle-kit push after migrations
- Document schema sync workflow in DEPLOYMENT_STRATEGY.md
- Update CLAUDE.md with schema sync commands

This prevents schema drift between DEV and PROD by automatically
syncing the database schema (especially payload_locked_documents_rels)
during deployment.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 20:17:47 +00:00
c505f29ebf fix: optimize GitHub Actions workflows to reduce costs
- Remove CodeQL Analysis (requires paid GHAS for private repos)
- Replace with ESLint + pnpm audit for security scanning
- CI: Run full tests only on PRs, not on every push to develop
- CI: Skip CI for markdown-only changes
- Security: Run only on PRs to main and weekly schedule
- Add deploy-production.yml workflow with rollback support
- Add deploy-production.sh script for manual deployments
- Document GitHub Actions cost optimization in DEPLOYMENT_STRATEGY.md

Estimated savings: ~68% of GitHub Actions minutes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 13:52:45 +00:00
29057577d3 docs: update documentation after Payload 3.69.0 upgrade
- CLAUDE.md: Update Payload version 3.68.4 → 3.69.0, update date
- PROJECT_STATUS.md: Add changelog entry for 27.12.2025, update version
- INFRASTRUCTURE.md: Update Payload version
- TODO.md: Add detailed changelog entry for bug fixes and updates
- BUG_REPORT_CUSTOM_VIEWS.md: Update versions, add note that bug persists

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 00:33:12 +00:00
6d40d81a44 docs(universal-features): comprehensive update with all collections and blocks
- Add Production API endpoints for frontend integration
- Add Newsletter API documentation with Double Opt-In flow
- Add FAQs, Team, Services, Timelines, Workflows collections
- Add FAQ, Team, Services blocks documentation
- Update all URLs to production (cms.c2sgmbh.de)
- Add Block overview table
- Add Tenant-IDs reference
- Update file structure overview
- Add changelog entries for v1.1 and v1.2

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 16:10:31 +00:00
d5afc43f9d docs(seo): update with production URLs and frontend integration examples
- Add Production API endpoints for frontend SEO data fetching
- Update all URLs from pl.c2sgmbh.de to cms.c2sgmbh.de
- Add Next.js Metadata API integration examples
- Add verification meta tags example
- Add Multi-Tenant SEO section with tenant domains
- Add localization examples (de/en)
- Add Production vs Development URL tables
- Add SEO setup checklist per tenant
- Update robots.txt example with production URL

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 16:08:24 +00:00
624b3dc605 docs(security): update with custom login page and redirect validation
- Add environment table (Production/Staging URLs with TRUST_PROXY)
- Document browser form redirect with safe URL validation
- Add Open Redirect Prevention details
- Document custom admin login page (src/app/(payload)/admin/login/)
- Add file reference table for all security-related files
- Update changelog with 18.12.2025 entry

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 16:06:09 +00:00
ba0f37a5b2 docs(analytics): update URLs to use production endpoints
- 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 <noreply@anthropic.com>
2025-12-18 16:03:45 +00:00
9c9ae86d99 docs: add comprehensive DEPLOYMENT.md guide
- 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 <noreply@anthropic.com>
2025-12-18 15:53:41 +00:00
7b51f928dd docs(frontend): update to use production API, DB, SEO and consent
- 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 <noreply@anthropic.com>
2025-12-18 15:49:38 +00:00
eea0ce26e9 docs: consolidate and update documentation for December 2025
- 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 <noreply@anthropic.com>
2025-12-18 15:42:40 +00:00
63b97c14f2 feat(security): enhance CSRF, IP allowlist, and rate limiter with strict production checks
- CSRF: Require CSRF_SECRET in production, throw error on missing secret
- IP Allowlist: TRUST_PROXY must be explicitly set to 'true' for proxy headers
- Rate Limiter: Add proper proxy trust handling for client IP detection
- Login: Add browser form redirect support with safe URL validation
- Add custom admin login page with styled form
- Update CLAUDE.md with TRUST_PROXY documentation
- Update tests for new security behavior

BREAKING: Server will not start in production without CSRF_SECRET or PAYLOAD_SECRET

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 05:06:15 +00:00
cf14584d0c docs: update TODO.md with CI timeout improvements
- Add changelog entry for 16.12.2025
- Document job-level and step-level timeouts
- Document vitest timeout configuration

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 22:48:45 +00:00
58b48555d7 feat: implement data retention system
- Add automatic cleanup for email-logs (90 days default)
- Add automatic cleanup for audit-logs (90 days default)
- Add consent-logs archival based on expiresAt (3 years GDPR)
- Add media orphan cleanup for unreferenced files (30 days min age)
- Add BullMQ-based retention worker with daily scheduler
- Add /api/retention endpoint for manual triggers (super-admin only)
- Update queue worker to include retention worker
- Add comprehensive documentation to CLAUDE.md and TODO.md

New files:
- src/lib/retention/retention-config.ts
- src/lib/retention/cleanup-service.ts
- src/lib/retention/index.ts
- src/lib/queue/jobs/retention-job.ts
- src/lib/queue/workers/retention-worker.ts
- src/app/(payload)/api/retention/route.ts

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 23:17:31 +00:00
035cd371ad docs: update TODO.md with CI/Security fixes
- Add changelog entry for 15.12.2025
- E2E tests stabilized (105 passed, 7 skipped)
- Security Scanning pipeline fixed (CodeQL, native secret scanning)
- Update last modified date

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 23:08:56 +00:00
2faefdac1e chore: code cleanup, TypeScript fixes, and dependency updates
- Remove unused variables and imports across API routes and workers
- Fix TypeScript errors in ConsentLogs.ts (PayloadRequest header access)
- Fix TypeScript errors in formSubmissionHooks.ts (add ResponseTracking interface)
- Update eslint ignores for coverage, test results, and generated files
- Set push: false in payload.config.ts (schema changes only via migrations)
- Update dependencies to latest versions (Payload 3.68.4, React 19.2.3)
- Add framework update check script and documentation
- Regenerate payload-types.ts

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 09:02:58 +00:00
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
e3c7d92121 feat: add staging deployment workflow and script
- Add GitHub Actions workflow for automatic staging deployment on develop branch
- Add manual deploy script with --skip-build and --skip-migrations options
- Update CLAUDE.md with deployment documentation
- Mark staging-deployment TODO as complete

Deployment target: pl.c2sgmbh.de (37.24.237.181)
Triggers: push to develop, manual workflow_dispatch

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 12:37:25 +00:00
05fba7f1d7 feat: add tenant-specific collections and BeforeAfterBlock
- Add Bookings Collection for porwoll.de (photography booking system)
- Add Certifications Collection for C2S (healthcare certifications)
- Add Projects Collection for gunshin.de (game development portfolio)
- Add BeforeAfterBlock for before/after image comparisons
- Add migration for 28 new database tables
- Update documentation and clean up TODO.md

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 01:40:17 +00:00
da735cab46 feat: add Products and ProductCategories collections with CI/CD pipeline
- Add Products collection with comprehensive fields (pricing, inventory, SEO, CTA)
- Add ProductCategories collection with hierarchical structure
- Implement CI/CD pipeline with GitHub Actions (lint, typecheck, test, build, e2e)
- Add access control test utilities and unit tests
- Fix Posts API to include category field for backwards compatibility
- Update ESLint config with ignores for migrations and admin components
- Add centralized access control functions in src/lib/access
- Add db-direct.sh utility script for database access

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-12 21:36:26 +00:00
85d6e8fa18 docs: separate frontend tasks and add documentation summary
- Add FRONTEND.md with comprehensive frontend development guide
- Update TODO.md with summary of open payload-server tasks
- Mark frontend tasks as moved to FRONTEND.md with [→] symbol
- Include API endpoints, tenant filtering, and localization info

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-11 15:02:04 +00:00
a066539129 feat: add automated PostgreSQL backup system with S3 offsite storage
- Add backup-db.sh for daily automated backups via cron
- Add restore-db.sh for interactive database restoration
- Add setup-backup.sh for easy setup on new servers
- Support local and S3 (Hetzner Object Storage) backup locations
- 30-day retention with automatic cleanup
- Credentials stored securely in ~/.pgpass and ~/.s3cfg
- Comprehensive documentation with disaster recovery checklist

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-11 14:10:39 +00:00
79577626e2 feat: add Newsletter Double Opt-In email system
- Add email templates for confirmation, welcome, and unsubscribe
- Create newsletter-service.ts with token validation and 48h expiry
- Add API endpoints: /api/newsletter/subscribe, /confirm, /unsubscribe
- Add afterChange hook for automatic email sending on subscription
- Rate-limiting: 5 subscriptions per 10 minutes per IP
- GDPR-compliant with re-subscription support after unsubscribe

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-10 16:37:16 +00:00
1005b1c52a feat: add OpenAPI documentation with Swagger UI
- Install payload-oapi plugin for automatic API documentation
- Configure OpenAPI 3.1 specification at /api/openapi.json
- Add Swagger UI interface at /api/docs
- Update documentation with new API endpoints

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-10 15:14:13 +00:00
ce4962e74b feat: BullMQ queue system for email and PDF processing
- Add BullMQ-based job queue with Redis backend
- Implement email worker with tenant-specific SMTP support
- Add PDF worker with Playwright for HTML/URL-to-PDF generation
- Create /api/generate-pdf endpoint with job status polling
- Fix TypeScript errors in Tenants, TenantBreadcrumb, TenantDashboard
- Fix type casts in auditAuthEvents and audit-service
- Remove credentials from ecosystem.config.cjs (now loaded via dotenv)
- Fix ESM __dirname issue with fileURLToPath for PM2 compatibility

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 22:59:17 +00:00
6ccb50c5f4 docs: consolidate and update documentation
- Remove obsolete instruction documents (PROMPT_*.md, SECURITY_FIXES.md)
- Update CLAUDE.md with security features, test suite, audit logs
- Merge Techstack_Dokumentation into INFRASTRUCTURE.md
- Update SECURITY.md with custom login route documentation
- Add changelog to TODO.md
- Update email service and data masking for SMTP error handling
- Extend test coverage for CSRF and data masking

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 09:25:00 +00:00
53f26e7349 feat: admin UX improvements with tenant switcher and email config
Tenant-Wechsel UI:
- Add TenantBreadcrumb component showing active tenant in admin header
- Add German translations for multi-tenant plugin selector
- Integrate with existing plugin TenantSelector dropdown

Email-Konfiguration UX:
- Add SMTP field validation (host format, port range, required fields)
- Add EmailDeliverabilityInfo component with SPF/DKIM/DMARC guidance
- Add TestEmailButton component for SMTP configuration testing
- Create /api/test-email endpoint with full security:
  - CSRF protection (double-submit cookie)
  - IP allowlist (same rules as /api/send-email)
  - Rate limiting (10/min per user)
  - Tenant access control with proper object normalization

Security:
- Add comprehensive integration tests for /api/test-email
- Tests cover CSRF, IP blocking, auth, tenant access, input validation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 16:33:39 +00:00
b5f319bc99 docs: add SECURITY.md and update TODO.md
- Created docs/anleitungen/SECURITY.md with comprehensive
  security documentation covering:
  - Rate Limiter configuration and usage
  - IP Allowlist/Blocklist with CIDR and wildcard support
  - CSRF Protection (Double Submit Cookie pattern)
  - Data Masking for sensitive fields in logs
  - Pre-commit hook for secret detection
  - CI/CD security workflow
  - Test suite overview (143 tests)
  - Production checklist and monitoring recommendations

- Updated TODO.md:
  - Marked AuditLogs as completed
  - Marked CI/CD Pipeline as completed
  - Added SECURITY.md to documentation section

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 00:32:12 +00:00
0cdc25c4f0 feat: comprehensive security test suite
Add 143 security tests covering all security modules:

Unit Tests (125 tests):
- rate-limiter.unit.spec.ts: limiter creation, request tracking,
  blocking, window reset, IP extraction, header generation
- csrf.unit.spec.ts: token generation/validation, origin checking,
  double submit cookie pattern, referer validation
- ip-allowlist.unit.spec.ts: CIDR matching, wildcards, endpoint-
  specific allowlist/blocklist rules, IP extraction
- data-masking.unit.spec.ts: field detection, pattern matching,
  recursive masking, JWT/connection string/private key handling

API Integration Tests (18 tests):
- security-api.int.spec.ts: rate limiting responses, IP blocking,
  CSRF protection on state-changing endpoints

Test Infrastructure:
- tests/helpers/security-test-utils.ts: CSRF token generators,
  mock request builders, environment setup utilities
- vitest.config.mts: updated to include unit tests
- package.json: added test:unit and test:security scripts
- .github/workflows/security.yml: added security-tests CI job

Also updated detect-secrets.sh to ignore .spec.ts and .test.ts
files which may contain example secrets for testing purposes.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 00:20:47 +00:00
fc94531931 feat: implement security hardening module
Security Features:
- Central rate-limiter service with Redis support and memory fallback
  - Predefined limiters: publicApi, auth, email, search, form, strict
  - Automatic cleanup of stale entries
- IP allowlist/blocklist for sensitive endpoints
  - CIDR and wildcard support
  - Configurable via SEND_EMAIL_ALLOWED_IPS, BLOCKED_IPS env vars
- CSRF protection with Double Submit Cookie pattern
  - Token endpoint: GET /api/csrf-token
  - Origin header validation
- Data masking service for sensitive data
  - Automatic redaction of passwords, tokens, API keys
  - Safe logger factory for consistent logging
  - Recursive object masking for audit logs

Secret Scanning:
- Pre-commit hook for local secret detection
- GitHub Actions workflow with Gitleaks and CodeQL
- Gitleaks configuration file
- Dependency vulnerability scanning

Updated:
- /api/send-email now uses central rate-limiter and IP allowlist
- Redis lib exports getRedisClient and isRedisAvailable

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 23:04:14 +00:00
6bbbea52fc feat: implement monitoring & alerting system
- Add AuditLogs collection for tracking critical system actions
  - User changes (create, update, delete)
  - Tenant changes with sensitive data masking
  - Login events tracking

- Add Alert Service with multi-channel support
  - Email, Slack, Discord, Console channels
  - Configurable alert levels (info, warning, error, critical)
  - Environment-based configuration

- Add Email failure alerting
  - Automatic alerts on repeated failed emails
  - Per-tenant failure counting with hourly reset

- Add Email-Logs API endpoints
  - GET /api/email-logs/export (CSV/JSON export)
  - GET /api/email-logs/stats (statistics with filters)

- Add audit hooks for Users and Tenants collections
- Update TODO.md with completed monitoring tasks

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 20:58:20 +00:00
966af755b4 docs: update CLAUDE.md and TODO.md with recent features
- Add E-Mail system documentation (tenant-specific SMTP, API endpoint)
- Add Redis caching section
- Add complete Collections and Globals overview
- Update project structure with new directories
- Mark Portfolio collections and Email system as completed
- Update environment variables documentation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 20:22:05 +00:00
19fcb4d837 feat: implement multi-tenant email system with logging
- Add Payload email adapter for system emails (auth, password reset)
- Add EmailLogs collection for tracking all sent emails
- Extend Tenants collection with SMTP configuration fields
- Implement tenant-specific email service with transporter caching
- Add /api/send-email endpoint with:
  - Authentication required
  - Tenant access control (users can only send for their tenants)
  - Rate limiting (10 emails/minute per user)
- Add form submission notification hook with email logging
- Add cache invalidation hook for tenant email config changes

Security:
- SMTP passwords are never returned in API responses
- Passwords are preserved when field is left empty on update
- Only super admins can delete email logs

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 20:16:54 +00:00
f1f3273fa7 docs: update TODO list with recent achievements
- Add Git & GitHub repository setup as completed
- Mark GitHub CLI installation and configuration as done
- Add isSuperAdmin field to Users Collection
- Update Backup System status (manual backups working)
- Add Techstack documentation to completed docs
- Update last modification date to 05.12.2025

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:22:03 +00:00
b5ca9ff177 docs: add Git & GitHub section and update deployment workflow
- Add comprehensive Git & GitHub documentation
  - GitHub CLI installation instructions
  - Git configuration (HTTPS and SSH)
  - .gitignore best practices
  - Git workflow and commit conventions
  - Useful Git and GitHub CLI commands
  - Backup via Git (exception handling)

- Update deployment workflow
  - Add detailed 4-step deployment process
  - Show Dev → GitHub → Production flow
  - Include verification steps
  - Document Git setup on both servers
  - Add comprehensive deployment commands

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:13:25 +00:00
dbe36ad381 feat: add super admin role and update documentation
- Add isSuperAdmin field to Users collection with migration
- Update API documentation with analytics examples
- Add analytics implementation guide
- Update TODO with completed tasks

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 14:26:08 +00:00
a88e4f60d0 test: add E2E and integration tests with documentation
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>
2025-12-01 08:19:52 +00:00