Task 4: Upload Routes Extended
- upload.js: Generate preview after single file upload
- batchUpload.js: Generate previews for all batch uploads
- Async preview generation (non-blocking response)
- Auto-update preview_path in database after generation
Task 5: Repository with preview_path
- GroupRepository: Include preview_path in INSERT
- getGroupById: Return previewPath in image objects
- groupFormatter: Add previewPath to formatGroupDetail()
- All queries now support preview_path column
Task 6: API Endpoints Extended
- Add PREVIEW_STATIC_DIRECTORY constant (/previews)
- Serve preview images via express.static
- All existing endpoints now return previewPath field
- Fallback to filePath if preview not available (frontend)
- Install sharp@0.33.5 for image processing
- Create ImagePreviewService with preview generation
- Support 800px max width, JPEG 85% quality
- Automatic directory creation on first use
- Include preview size reduction logging
- Add cleanup method for orphaned previews
- Update backend/Dockerfile: node:18 → node:24 (LTS)
- Node 24 provides longer support window and latest features
- Tested: Build successful (127s), container starts cleanly, all services working
Phase 1 refined: Backend now on Node 24 LTS with extended support timeline.
Major Frontend Refactoring:
- Replace ImagePreviewGallery with unified ImageGallery/ImageGalleryCard components
- Support 4 display modes: group, moderation, preview, single-image
- Add hidePreview prop to conditionally hide group preview images
- Unified grid layout with responsive 3/2/1 column design
- Remove 15+ legacy files and components
- Delete UploadedImagePage, SocialMedia components, old upload components
- Remove unused CSS files (GroupCard.css, Image.css/scss)
- Clean up /upload/:image_url route from App.js
- Fix image preview functionality in MultiUploadPage
- Convert File objects to blob URLs with URL.createObjectURL()
- Add proper memory cleanup with URL.revokeObjectURL()
- Improve page navigation and layout
- Fix GroupsOverviewPage to route to /groups/:groupId detail page
- Adjust PublicGroupImagesPage spacing and layout
- Fix ModerationGroupsPage duplicate stats section
CSS Refactoring:
- Rename GroupCard.css → ImageGallery.css with updated class names
- Maintain backward compatibility with legacy class names
- Fix grid stretching with fixed 3-column layout
Development Environment:
- Add docker-compose.override.yml for local development
- Create Dockerfile.dev with hot-reload support
- Add start-dev.sh and nginx.dev.conf
- Update README.dev.md with development setup instructions
Production Build:
- Fix frontend/Dockerfile multi-stage build (as → AS)
- Update prod.sh to explicitly use docker-compose.yml (ignore override)
- Resolve node:18-alpine image corruption issue
- Backend Dockerfile improvements for Node 14 compatibility
Documentation:
- Update TODO.md marking completed frontend tasks
- Clean up docs/images directory
- Update README.md with current project status
All changes tested and verified in both development and production environments.
- README aktualisiert, um die neuen Verzeichnisse zu reflektieren
- Konstanten für Verzeichnispfade in 'constants.js' hinzugefügt
- 'DatabaseManager.js' angepasst, um die neuen Datenbankverzeichnisse zu verwenden
- Routen für Batch-Upload, Download und Upload aktualisiert, um die neuen Pfade zu berücksichtigen
- 'MigrationService.js' hinzugefügt, um vorhandene Daten in die neuen Verzeichnisse zu migrieren
- Hilfsfunktionen in 'groupStorage.js' und 'initiate-resources.js' angepasst
- 'docker-compose.yml' und 'prod.sh' aktualisiert, um die neuen Verzeichnisse zu berücksichtigen