Commit Graph

144 Commits

Author SHA1 Message Date
8dc5a03584 feat(database): Add consent management migrations and auto-migration system
- Add Migration 005: consent fields to groups table (display_in_workshop, consent_timestamp, management_token)
- Add Migration 006: social_media_platforms and group_social_media_consents tables
- Implement automatic migration execution in DatabaseManager.initialize()
- Add standalone migration runner script (runMigrations.js)
- Seed data: Facebook, Instagram, TikTok platforms

Note: DatabaseManager statement splitting needs improvement for complex SQL.
Manual migration execution works correctly via sqlite3.
2025-11-09 20:57:48 +01:00
4317d761d2 docs: Add feature plan for social media consent management
- Add comprehensive feature plan for consent management system
- Phase 1: Workshop display and social media consents (4-5 days)
- Phase 2: Self-service management portal (3-4 days)
- GDPR-compliant consent handling with timestamps
- Extensible social media platform configuration
- Export functionality for legal documentation
- Contact email: it@hobbyhimmel.de
2025-11-09 20:31:12 +01:00
19a813bbb7 Merge feature/ExifExtraction FEATURE_PLAN 2025-11-09 19:58:39 +01:00
3fafb621b0 docs: Add FEATURE_PLAN for EXIF metadata extraction
Plan for implementing automatic EXIF data extraction from uploaded images:
- Extract capture date, camera model, and GPS coordinates
- Use earliest capture date for chronological group sorting
- Add new database fields: capture_date, exif_date_taken, exif_camera_model
- Implement ExifService with exifr library
- Create migration script for existing images
- Update slideshow sorting logic with EXIF-based chronology
- Fallback to year/upload date when EXIF unavailable

Estimated effort: 5-7 hours (3 phases)
Dependencies: exifr npm package
2025-11-09 13:30:58 +01:00
7be6d9e3e1 Merge feature/PreloadImage: Slideshow optimization with intelligent preloading 2025-11-09 13:23:46 +01:00
57ce0ff2aa feat: Slideshow optimization with intelligent preloading and chronological sorting
- Add intelligent image preloading (useImagePreloader hook)
- Eliminate duplicate image display issue
- Remove visible loading delays in slideshow
- Implement chronological group sorting (year → upload date)
- Add cache management with LRU strategy (max 10 images)
- Add 3s timeout for slow connections with graceful fallback
- Add debug logging in development mode

Performance improvements:
- 0ms load time for pre-cached images (vs 200-1500ms before)
- Seamless transitions with no visual artifacts
- Better UX on production servers with slower internet

Fixes:
- Fixed: Duplicate image display in slideshow (network latency)
- Fixed: Flickering transitions between images
- Fixed: Random group order replaced with chronological

Files changed:
- NEW: frontend/src/hooks/useImagePreloader.js
- MODIFIED: frontend/src/Components/Pages/SlideshowPage.js
- UPDATED: README.md, CHANGELOG.md, docs/FEATURE_PLAN-preload-image.md
2025-11-09 13:23:27 +01:00
1b4629cca3 changed admin, Link to gitea, LoadingLogo 2025-11-09 11:55:31 +01:00
008adf3f27 feat(frontend): Ersetze Lottie-Animation durch custom 3D SVG Logo-Animation
- Lottie-react Bibliothek durch native CSS 3D Transforms ersetzt
- Hobbyhimmel Logo (Hammer & Wolke) als animiertes Loading-Icon
- Wolke rotiert um Y-Achse (4s)
- Hammer rotiert um Y-Achse UND eigene Diagonalachse (3s)
- 15° X-Neigung für dynamischeren 3D-Effekt
- Nested Transform-Hierarchie mit transform-box: fill-box
- Upload-Erfolgsmeldung als grünes Banner unter Animation
- Nutzer muss Upload-Bestätigung mit Button bestätigen
- Loading-Animation bleibt während Erfolgsmeldung sichtbar
2025-11-08 20:58:23 +01:00
ddc7e787b3 feat(frontend): Update footer with version info and attribution
- Display app version dynamically from window._env_.APP_VERSION
- Credit original author (vallezw) with link to original repo
- Credit extended version (lotzm) with link to Gitea repo
- Update package.json version to 1.1.0

Footer styling:
- Position fixed at bottom-right corner of viewport
- Unobtrusive design with small font size (11px)
- Semi-transparent background with subtle shadow
- Stays visible while scrolling
- Hover effect on links for better UX

Changes:
- frontend/package.json: version 0.1.0 → 1.1.0
- Footer.js: Dynamic version display, attribution links
- Footer.css: Fixed positioning, responsive styling
2025-11-08 16:22:04 +01:00
d25fc58b76 fix(docker): Add sqlite3 to production backend image
- Install sqlite3 in prod Dockerfile using apk (Alpine package manager)
- Required for test-cleanup-prod.sh script to function
- Matches dev environment which already had sqlite3 installed

Changes:
- docker/prod/backend/Dockerfile: Add 'apk add --no-cache sqlite'
- tests/test-cleanup.sh -> split into test-cleanup-dev.sh and test-cleanup-prod.sh
- Separate scripts for dev/prod with correct docker-compose paths

Testing:
- sqlite3 now available at /usr/bin/sqlite3 in prod container
- test-cleanup-prod.sh can now execute database queries
2025-11-08 16:05:35 +01:00
f7ced61e4b Merge feature/DeleteUnprovedGroups into main
Complete implementation of automatic cleanup for unapproved groups:
- Automatic deletion after 7 days for unapproved groups
- Daily cron job at 10:00 AM (Europe/Berlin)
- Complete deletion log with statistics
- Countdown display in moderation interface
- SweetAlert2 approval feedback
- Comprehensive testing tools

Backend:
- GroupCleanupService with singleton pattern
- DeletionLogRepository for audit trail
- SchedulerService for cron jobs
- Extended GroupRepository with cleanup methods
- Admin API endpoints for deletion log

Frontend:
- DeletionLogSection component with statistics
- Countdown widget in ImageGalleryCard
- SweetAlert2 integration for approval feedback
- Toggle between last 10 and all deletion entries

Infrastructure:
- node-cron v3.0.3 dependency
- nginx configuration updates (dev + prod)
- Database schema with deletion_log table

Testing:
- Interactive bash test script (tests/test-cleanup.sh)
- Node.js test alternative
- Comprehensive testing guide (tests/TESTING-CLEANUP.md)

Bug fixes:
- Singleton import in admin routes
- nginx Basic Auth configuration for /api/admin

Documentation:
- README.md updated with feature description
- CHANGELOG.md with complete overview
- TODO.md marking feature complete
- FEATURE_PLAN finalized with all tasks completed

11 tasks completed, ~21 hours development time
Ready for production deployment
2025-11-08 14:46:11 +01:00
4ee1b76d77 docs: Finalize automatic cleanup feature documentation
- Update README.md with comprehensive feature description
  - Add automatic cleanup and deletion log to features list
  - Document countdown display and 7-day retention policy
  - Add Testing section with test-cleanup.sh instructions
  - Update API endpoints with new admin routes

- Update CHANGELOG.md with complete feature overview
  - Backend: Services, Repositories, Scheduler, API endpoints
  - Frontend: DeletionLogSection, countdown, SweetAlert2 feedback
  - Infrastructure: nginx config updates
  - Testing: Comprehensive test tools and documentation

- Update TODO.md marking feature as completed

- Update FEATURE_PLAN with final status
  - All 11 tasks completed (100%)
  - Bug fixes documented
  - Deployment checklist updated
  - Final timeline and statistics

- Organize test files into tests/ directory
  - Move TESTING-CLEANUP.md to tests/
  - Move test-cleanup.sh to tests/

Feature is now complete and ready for merge.
2025-11-08 14:45:13 +01:00
0a43fe95ea fix(nginx): Remove Basic Auth from /api/admin routes
The /moderation page is already password-protected, so API routes
called from that page don't need additional authentication.
This fixes 'Unexpected token <' error in deletion log display.
2025-11-08 14:25:57 +01:00
b03cd20b40 fix(backend): Correct GroupCleanupService import in admin routes
GroupCleanupService exports an instance, not a class constructor
2025-11-08 13:24:58 +01:00
ace4090bc6 docs: Add comprehensive testing guide for cleanup feature 2025-11-08 13:22:45 +01:00
861d4813d1 feat(testing): Add cleanup testing tools and API endpoints
- Add POST /api/admin/cleanup/trigger for manual cleanup
- Add GET /api/admin/cleanup/preview for dry-run testing
- Create test-cleanup.sh (bash) for easy testing
- Create test-cleanup.js (node) as alternative test tool
- Enable backdating groups for testing purposes
2025-11-08 13:18:44 +01:00
3a2efd97c3 refactor: Move deletion log into ModerationGroupsPage
- Create DeletionLogSection component
- Integrate deletion log at bottom of moderation page
- Remove standalone DeletionLogPage and route
- Remove admin nav link (log now in moderation)
- Keep /api/admin routes for backend API access
- Update nginx configs (remove /admin frontend route)
2025-11-08 12:55:55 +01:00
0f430af877 fix(frontend): Disable exhaustive-deps warning for DeletionLogPage useEffect 2025-11-08 12:43:34 +01:00
e7da188967 feat(frontend+nginx): Add DeletionLogPage and admin routes
- Create DeletionLogPage with statistics cards and deletion history table
- Add admin navigation link to Navbar
- Configure nginx for /admin and /api/admin routes (dev+prod)
- Add password protection for admin routes
- Support toggle between last 10 and all deletions
2025-11-08 12:38:14 +01:00
15fc02235f feat(frontend): Add countdown and improve approval feedback
Phase 4 Progress - Tasks 7 & 8 Complete

Countdown Display (Task 7):
- getDaysUntilDeletion() helper in ImageGalleryCard
- Countdown widget for unapproved groups
- Shows ' Wird gelöscht in: X Tagen'
- Only visible for pending groups in moderation mode
- Yellow warning style with border accent
- CSS: .deletion-countdown with responsive design

Approval Button Improvements (Task 8):
- Upgraded from alert() to SweetAlert2
- Success message with auto-close (2s)
- Error handling with detailed messages
- Optimistic UI updates (groups move between sections)
- Different messages for approve/unapprove actions

Files modified:
- ImageGalleryCard.js: Countdown logic and display
- ImageGallery.css: Countdown styling
- ModerationGroupsPage.js: SweetAlert2 integration

Tasks completed:  4.7,  4.8
2025-11-08 12:28:58 +01:00
c0ef92ec23 feat(api): Add admin endpoints for deletion log
Phase 3 Complete - Backend API

New Admin Endpoints (/api/admin/):
- GET /deletion-log?limit=10
  - Returns recent deletion logs with pagination
  - Validation: limit 1-1000
  - Response: { deletions, total, limit }

- GET /deletion-log/all
  - Returns complete deletion history
  - Response: { deletions, total }

- GET /deletion-log/stats
  - Returns deletion statistics
  - Includes formatted file sizes (B/KB/MB/GB)
  - Response: { totalDeleted, totalImages, totalSize, lastCleanup }

Features:
- Comprehensive error handling
- Input validation
- Human-readable file size formatting
- Consistent JSON responses

Integration:
- admin.js router mounted at /api/admin
- Added to routes/index.js

Task completed:  3.6
2025-11-08 12:25:20 +01:00
939cf22163 feat(backend): Implement automatic cleanup service
Phase 2 Complete - Backend Core Logic

New Components:
- DeletionLogRepository: CRUD for deletion audit trail
- GroupCleanupService: Core cleanup logic
  - findGroupsForDeletion() - finds unapproved groups older than 7 days
  - deleteGroupCompletely() - DB + file deletion
  - deletePhysicalFiles() - removes images & previews
  - logDeletion() - creates audit log entry
  - getDaysUntilDeletion() - calculates remaining days
  - performScheduledCleanup() - main cleanup orchestrator
- SchedulerService: Cron job management
  - Daily cleanup at 10:00 AM (Europe/Berlin)
  - Manual trigger for development

GroupRepository Extensions:
- findUnapprovedGroupsOlderThan(days)
- deleteGroupCompletely(groupId)
- getGroupStatistics(groupId)

Dependencies:
- node-cron ^3.0.3

Integration:
- Scheduler auto-starts with server (server.js)
- Comprehensive logging for all operations

Tasks completed:  2.3,  2.4,  2.5
2025-11-08 12:23:49 +01:00
4f58b04a0f feat(db): Add deletion_log table and cleanup indexes
Phase 1 Complete - Database Schema

- Add deletion_log table for audit trail (no personal data)
- Add performance indexes for cleanup queries:
  - idx_groups_approved
  - idx_groups_cleanup (approved, upload_date)
  - idx_deletion_log_deleted_at (DESC)
  - idx_deletion_log_year
- Table structure: group_id, year, image_count, upload_date, deleted_at, deletion_reason, total_file_size

Tasks completed:  1.1,  1.2
2025-11-08 12:05:34 +01:00
852890fca6 docs: Update FEATURE_PLAN - approved field already exists
- Removed unnecessary migration for approved column (already in DatabaseManager.js)
- Marked existing API endpoint PATCH /groups/:groupId/approve as reusable
- Marked existing repository methods (updateGroupApproval, deleteImage) as reusable
- Updated Phase 1 Task 1 to reflect current state
- Only need to add performance indexes for cleanup queries
2025-11-08 12:00:30 +01:00
5064f265b0 Merge feature/ImageDescription into main
Complete implementation of image descriptions feature:
- Individual image descriptions (max 200 characters)
- Edit mode in moderation interface
- Display in slideshow and public views
- Integrated save functionality
- Docker build optimizations (190MB size reduction)
- Bug fixes and code improvements
2025-11-07 23:21:55 +01:00
07b436cc4d feat: Complete image description feature implementation
Features:
- Add image description field (max 200 chars) for individual images
- Replace 'Sort' button with 'Edit' button in image gallery cards
- Enable edit mode with text fields for each image in moderation
- Display descriptions in slideshow and public views
- Integrate description saving with main save button

Frontend changes:
- ImageGalleryCard: Add edit mode UI with textarea and character counter
- ModerationGroupImagesPage: Integrate description editing into main save flow
- Fix keyboard event propagation in textarea (spacebar issue)
- Remove separate 'Save Descriptions' button
- Add ESLint fixes for useCallback dependencies

Backend changes:
- Fix route order: batch-description route must come before :imageId route
- Ensure batch description update API works correctly

Build optimizations:
- Add .dockerignore to exclude development data (182MB reduction)
- Fix Dockerfile: Remove non-existent frontend/conf directory
- Reduce backend image size from 437MB to 247MB

Fixes:
- Fix route matching issue with batch-description endpoint
- Prevent keyboard events from triggering drag-and-drop
- Clean up unused functions and ESLint warnings
2025-11-07 23:20:50 +01:00
d2f2fe158d docs: Update documentation for image descriptions feature
- README.md: Add image descriptions to Latest Features section
- CHANGELOG.md: Document complete implementation details
- FEATURE_PLAN: Mark status as Implemented (ready for testing)

All 8 phases complete: Backend + Frontend + Testing + Docs 
2025-11-07 18:39:48 +01:00
8323cec156 feat: Add image descriptions to Slideshow and Public views
- Slideshow: Display imageDescription below image (centered overlay)
- PublicGroupImagesPage: Show descriptions in single-image mode
- ImageGalleryCard: Support description display in single-image mode

Phase 5-6 complete: Slideshow + Public Display Integration
2025-11-07 18:36:57 +01:00
292d25f5b4 feat: Implement image descriptions - Backend & Core Frontend
- Database: Add image_description column to images table
- Repository: Add updateImageDescription & updateBatchImageDescriptions methods
- API: Add PATCH endpoints for single and batch description updates
- Upload: Support descriptions in batch upload
- Frontend: ImageGalleryCard with Edit mode and textarea
- Frontend: MultiUploadPage with description input
- Frontend: ModerationGroupImagesPage with description editing
- CSS: Styles for edit mode, textarea, and character counter

Phase 1-4 complete: Backend + Core Frontend + Upload + Moderation
2025-11-07 18:34:16 +01:00
9fd4dff2f5 Add drag-and-drop reordering to upload preview
- Enable image reordering in MultiUploadPage before upload
- Add handleReorder callback to update local state
- Users can now sort preview images via drag-and-drop
- Upload order follows the sorted preview order
- No API call needed (pure local state management)
2025-11-07 17:37:57 +01:00
71f1a2da82 Fix development nginx configuration with password protection
- Created clean dev nginx.conf based on working prod version
- Adapted backend service names (backend-dev)
- Replaced static file serving with React Dev Server proxying
- Added htpasswd authentication for /moderation routes

Testing confirms:
 Homepage accessible (200 OK)
 Moderation page protected (401 Unauthorized)
 Moderation API protected (401 Unauthorized)
 Upload functionality working (single + batch)
2025-11-07 17:27:45 +01:00
3845de92a6 Fix batch upload and attempt nginx auth setup
- Fixed missing 'path' import in batchUpload.js
- Fixed GroupRepository import (singleton vs class)
- Added htpasswd file to development config
- Created new nginx.conf based on working production config
- Updated Dockerfile to copy htpasswd for development

Status:
 Upload functionality restored (both single and batch)
 Backend routing and error handling fixed
⚠️ nginx auth config needs troubleshooting (container not using new config)
2025-11-06 18:28:32 +01:00
782f11e513 Fix nginx routing for development environment
- Fixed nginx proxy configuration for API endpoints
- Added proper proxy headers and max body size for uploads
- Added /api/groups endpoint routing
- Corrected proxy_pass paths to route properly to backend
- API endpoints now accessible via nginx proxy

Fixes: Image upload routing issue in development environment
2025-11-06 17:35:09 +01:00
ae67bc7978 🔧 Fix: Development environment env.sh Pfade korrigiert
- Kopiert Development-spezifische .env und env.sh ins frontend/ für Volume-Mount
- Aktualisiert .gitignore für Development-Dateien
- Frontend-Container startet jetzt ohne env.sh Fehler
- Development-Server läuft erfolgreich auf Port 3000
2025-11-06 17:26:28 +01:00
2678ad9b12 🚀 Refactor: Saubere Docker-Struktur mit getrennten dev/prod Umgebungen
- Neue Docker-Struktur: docker/{dev,prod}/ für klare Trennung
- Entfernt: docker-compose.override.yml (problematisch)
- Hinzugefügt: ./dev.sh und ./prod.sh Scripts für einfache Bedienung
- Container-spezifische Konfigurationen in docker/{dev,prod}/*/config/
- Aktualisierte READMEs für neue Struktur
- Backend-Daten in .gitignore hinzugefügt
- Bereinigt: Veraltete Dockerfiles und Konfigurationsdateien

Jetzt: Wartungsfreundlich, keine Verwirrung zwischen Umgebungen
2025-11-05 23:00:25 +01:00
7ea95341c0 🐛 Fix: Bildvorschau beim Upload wieder funktionsfähig
- Problem: getImageSrc() konnte nicht mit Blob-URLs von ausgewählten Upload-Dateien umgehen
- Lösung: Direkte Behandlung von Blob-URLs in ImageGalleryCard für Upload-Preview
- Erweitert: imageUtils.js um Blob-URL Unterstützung
- Hinzugefügt: Eindeutige IDs für Preview-Objekte in MultiUploadPage

Fixes #upload-preview-missing
2025-11-05 19:50:14 +01:00
3ad9490806 Update TODO.md 2025-11-03 22:42:07 +01:00
8332a78c1e fix: resolve reordering API routing issue
🔧 Problem identified and fixed:
- nginx proxy was routing /api/groups to /groups (removing /api prefix)
- Backend route was registered under /api/groups instead of /groups
- Changed backend route registration from '/api/groups' to '/groups'
- Tested API endpoint: curl to /api/groups/qion_-lT1/reorder now works
- Removed debug console.log statements for cleaner production code

 Drag-and-drop reordering now functional in ModerationGroupImagesPage
 API requests properly routed through nginx proxy to backend
 Error 'Reihenfolge konnte nicht geändert werden' resolved
2025-11-03 21:39:44 +01:00
5b4e7b21fa docs: update README.md with new reordering features
🆕 Added feature highlights:
- Drag-and-Drop Image Reordering for admins
- Touch-friendly interface with mobile optimization
- Slideshow integration with custom ordering
- Admin panel for content curation
- Optimistic UI updates with error recovery

Updated 'What's New' section with January 2025 features
Enhanced feature list with technical capabilities
2025-11-03 21:24:29 +01:00
ba02d26dc7 docs: update feature plan with completion status
 All 9 tasks completed successfully:
- Backend API with SQL transactions and validation
- Frontend drag-and-drop with @dnd-kit and touch support
- Admin-only reordering in ModerationGroupImagesPage
- Public users cannot reorder (PublicGroupImagesPage)
- Slideshow integration via upload_order
- Optimistic updates with error rollback
- Comprehensive testing and error handling
- Performance: 10 images reordered in 0.148s

Feature ready for production deployment.
2025-11-03 21:22:15 +01:00
e20b1e433d feat: complete drag-and-drop reordering integration
 Phase 2 Complete - Frontend Integration:
- Fixed service imports and exports in reorderService.js
- Added HTTP request helper to replace missing sendRequest
- Integrated reordering in ModerationGroupImagesPage (Admin-only)
- Disabled reordering in PublicGroupImagesPage (Public users)
- Added optimistic updates with error rollback
- Added success/error notifications via SweetAlert2
- Fixed useCallback dependency warnings

 Reordering Features:
- Drag handles always visible for touch devices
- Mobile-friendly drag zones and visual feedback
- Loading states during API calls
- Automatic slideshow integration via upload_order
- Complete error handling and validation

Next: End-to-end testing across browsers and devices
2025-11-03 21:16:40 +01:00
7564525c7e feat: implement drag-and-drop reordering infrastructure
Phase 1 (Backend API):
 GroupRepository.updateImageOrder() with SQL transactions
 PUT /api/groups/:groupId/reorder API route with validation
 Manual testing: Reordering verified working (group qion_-lT1)
 Error handling: Invalid IDs, missing groups, empty arrays

Phase 2 (Frontend DnD):
 @dnd-kit/core packages installed
 ReorderService.js for API communication
 useReordering.js custom hook with optimistic updates
 ImageGalleryCard.js extended with drag handles & sortable
 ImageGallery.js with DndContext and SortableContext
 CSS styles for drag states, handles, touch-friendly mobile

Next: Integration with ModerationGroupImagesPage
2025-11-03 21:06:39 +01:00
abd12923aa feat: add reordering feature plan and task breakdown
- Created comprehensive FEATURE_PLAN-reordering.md with 9 tasks in 3 phases
- Must-Have: Touch-Support for mobile drag-and-drop
- Admin-only: Reordering restricted to ModerationGroupImagesPage
- Public users cannot reorder images (security restriction)
- Technical approach: @dnd-kit/core + PUT /api/groups/:groupId/reorder
- Estimated: 10-12 hours over 2-3 days
2025-11-03 20:44:33 +01:00
b3739fee75 update todos 2025-11-03 20:30:42 +01:00
40348afc7b Merge branch 'feature/preview-images' 2025-11-01 14:07:27 +01:00
45e47b9c1d TODOs aktualisiert 2025-11-01 14:00:53 +01:00
889f61d9bc Merge pull request 'feature/preview-images' (#3) from feature/preview-images into main
Reviewed-on: #3
2025-11-01 12:33:21 +01:00
4440b969f3 docs: add preview image feature documentation to README
- Added Preview Image Optimization to features list
- New section explaining automatic thumbnail generation
- Technical specifications: 800px JPEG, 85% quality, 96-98% size reduction
- Performance benefits: ~30x faster gallery loading
- Smart image loading: previews for galleries, originals for slideshow
- Updated API endpoints section with /api/previews and /api/download
- Updated database schema showing preview_path column
- Enhanced storage architecture diagram
2025-11-01 12:29:51 +01:00
04dca26d00 FIX: Wenn kein Name angegeben ist, wird nun auch nichts angezeigt, anstelle von null 2025-11-01 11:43:17 +01:00
aec9db2a76 feat(frontend): integrate preview images in gallery components
- Add imageUtils.js helper with getImageSrc() and getGroupPreviewSrc()
- Update ImageGalleryCard to use preview images for galleries
- Update ModerationGroupsPage to show preview images in modal
- Update ModerationGroupImagesPage to use preview images
- Update PublicGroupImagesPage to pass all image fields
- SlideshowPage continues using original images (full quality)
- Update nginx.dev.conf with /api/previews and /api/download routes
- Update start-dev.sh to generate correct nginx config
- Fix GroupRepository.getAllGroupsWithModerationInfo() to return full image data
- Remove obsolete version from docker-compose.override.yml
- Update TODO.md: mark frontend cleanup as completed

Performance: Gallery load times reduced by ~96% (100KB vs 3MB per image)
2025-10-31 18:20:50 +01:00