Commit Graph

62 Commits

Author SHA1 Message Date
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
ff71c9d86a chore: add .gitignore with data-backup exclusion
- Exclude backend/src/data-backup/ from version control
- Add common ignores: node_modules, .env, IDE files, logs
2025-10-30 21:52:58 +01:00
170e1c20e6 feat: automatic preview generation on database init
Task 7: Batch-Migration Automation
- Add generateMissingPreviews() method to DatabaseManager
- Automatically runs after schema creation
- Finds all images without preview_path
- Generates previews for existing images on startup
- Graceful error handling (won't break server start)
- Progress logging: 'Found X images without preview, generating...'
- No manual script needed - fully automated

Benefits:
- Works on every backend restart
- Incremental (only missing previews)
- Non-blocking database initialization
- Perfect for deployments and updates
2025-10-30 20:51:35 +01:00
661d6441ab feat: integrate preview generation into upload flow
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)
2025-10-30 20:41:06 +01:00
940144cbf5 feat: add preview_path migration and constants
Task 2: DB Migration
- Add preview_path column to images table via ALTER TABLE
- Migration runs automatically on database initialization
- Handles duplicate column gracefully

Task 3: Constants & Config
- Export PREVIEW_FS_DIR constant (data/previews)
- Export PREVIEW_CONFIG (800px, 85% quality, JPEG)
- Update ImagePreviewService to import from constants
- Update schema.sql documentation with preview_path
2025-10-30 20:30:56 +01:00
0471830e49 feat: add Sharp library and ImagePreviewService
- 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
2025-10-30 20:25:33 +01:00
6ee736bcea docs: add feature plan for preview images
- Architecture overview: previews/ directory structure
- Backend: Sharp library for image processing
- DB schema extension: preview_path column
- Frontend: Use previews in galleries, keep originals in slideshow
- Estimated effort: 12-22h (2-3 days)
- Expected improvement: ~95% size reduction, ~96% faster load times

Ref: feature/preview-images
2025-10-29 23:34:08 +01:00
473465f363 Merge pull request 'upgrade/deps-react-node-20251028' (#2) from upgrade/deps-react-node-20251028 into main
Reviewed-on: #2
2025-10-29 23:22:30 +01:00
b0c95c5698 docs: add security audit results to CHANGELOG
Document npm audit findings for frontend (21 vulns) and backend (27 vulns).
Recommend separate security PR for critical packages (axios, send/serve-static).

Ref: upgrade/deps-react-node-20251028
2025-10-29 23:16:27 +01:00
80ffcfd210 docs: complete migration documentation and finalize dev environment
- Add comprehensive CHANGELOG.md with all upgrade phases and results
- Update TODO.md to mark framework upgrades as completed
- Update UPGRADE_PLAN with actual timelines and detailed phase results
- Finalize docker-compose.override.yml and Dockerfile.dev for dev workflow
- Update package-lock.json after dependency changes

All 4 phases completed successfully:
- Backend: Node 14 → 24
- Frontend: React 17 → 18.3.1, Router v5 → v6, MUI v4 → v5
- Dev environment with HMR fully functional
- Integration smoke tests passed
2025-10-29 23:11:37 +01:00
fe65544893 docs: complete upgrade documentation with CHANGELOG, smoke tests, and actual timelines 2025-10-29 23:10:21 +01:00
bf115453f1 chore(frontend): fix ESLint warnings - remove unused handlers/imports 2025-10-29 21:54:58 +01:00
a44a85be73 chore(frontend): remove @mui/styles, replace react-lottie with lottie-react and remove legacy-peer-deps in Dockerfile 2025-10-29 21:49:09 +01:00
5b4855a5f5 refactor(frontend): migrate SlideshowPage to MUI sx 2025-10-29 21:41:02 +01:00
182dcb228c refactor(frontend): migrate MultiUploadPage to MUI sx 2025-10-29 21:34:16 +01:00
494c09e062 refactor(frontend): migrate MultiImageDropzone to MUI sx 2025-10-29 21:31:02 +01:00
4aac9dae4e refactor(frontend): migrate DescriptionInput to MUI sx 2025-10-29 21:26:51 +01:00
8535e8fafe refactor(frontend): migrate UploadProgress to MUI sx (remove makeStyles) 2025-10-29 21:18:44 +01:00
5c6f0ce061 feat(frontend): migrate to MUI v5 (phase 4 step 1)
- Replace @material-ui/core -> @mui/material
- Replace @material-ui/icons -> @mui/icons-material
- Switch makeStyles imports to @mui/styles (compat)
- Add @mui/material, @mui/icons-material, @mui/styles, @emotion/react, @emotion/styled to package.json

Notes: Kept makeStyles via @mui/styles for incremental migration; next: replace makeStyles usage with sx/styled where needed.
2025-10-29 20:10:33 +01:00
5ba463427b feat(frontend): upgrade react-router-dom 5→6 (Phase 3)
- Update package.json: react-router-dom ^5.2.0→^6.28.0
- Migrate App.js: Switch→Routes, component→element props, path="*" for 404
- Migrate 5 pages: useHistory→useNavigate, history.push()→navigate()
  - GroupsOverviewPage.js (4x navigate)
  - ModerationGroupsPage.js (1x navigate)
  - ModerationGroupImagesPage.js (2x navigate)
  - PublicGroupImagesPage.js (import updated)
  - SlideshowPage.js (4x navigate + keyboard handler)
- Regenerate package-lock.json with react-router v6

 Tested: Production build 254.46 KB gzip (+1.17 KB)
 Manual test: Navigation, moderation routing, slideshow ESC - all working

Phase 3 complete: Modern react-router v6 with improved routing API.
2025-10-28 22:59:59 +01:00
93534587d2 feat(frontend): upgrade React 17→18 + react-scripts 4→5 (Phase 2)
- Update package.json: react/react-dom ^17→^18.3.1, react-scripts 4→5.0.1
- Migrate to React 18 Root API in src/index.js (createRoot)
- Add --legacy-peer-deps to Dockerfile for MUI v4 compatibility
- Regenerate package-lock.json with legacy peer deps flag

 Tested: Production build 253.28 KB gzip, containers running
 Manual test: Upload, Moderation, Public View, Slideshow - all working

Phase 2 complete: Frontend on React 18 with concurrent rendering.
2025-10-28 21:30:14 +01:00
acdb2fa6cd refactor(backend): upgrade to Node 24 LTS (v24.11.0)
- 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.
2025-10-28 20:35:03 +01:00
fd3a10657a feat(backend): upgrade Node 14 → 18 (Phase 1)
- Update backend/Dockerfile: FROM node:14 → node:18
- Remove Debian Buster EOL repository workarounds (Node 18 uses Bullseye)
- Tested: Docker build successful, container starts cleanly, DB initializes

Phase 1 complete: Backend runtime now on Node 18 LTS.
2025-10-28 20:25:26 +01:00
dea913ac99 Merge pull request 'chore(upgrade): add issue template and upgrade plan for deps upgrade' (#1) from upgrade/deps-react-node-20251028 into main
Reviewed-on: #1
2025-10-28 20:20:11 +01:00
58a1979b89 chore(upgrade): add issue template and upgrade plan for deps upgrade
- Add .github/ISSUES/upgrade-deps-react-node-20251028.md with analysis summary
- Add docs/UPGRADE_PLAN-upgrade-deps-react-node-20251028.md with detailed plan and steps

Branch: upgrade/deps-react-node-20251028
2025-10-28 20:13:57 +01:00
9406b725c1 removed old css in ImageGallery.css 2025-10-28 20:04:42 +01:00
a0d74f795a feat: Complete frontend refactoring and development environment setup
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.
2025-10-27 22:22:52 +01:00
237c776ddc CSS Cleanup 2025-10-26 11:52:14 +01:00
03a7e91d2b Removed Erweiterungen.md, Update TODO.md 2025-10-22 20:22:46 +02:00
aec0be8982 tut wieder 2025-10-20 21:18:44 +02:00
f6c02259dd GroupsOverviewPage.js wieder hergestellt 2025-10-20 21:10:59 +02:00
d29aaa05cd removed old files 2025-10-20 20:07:45 +02:00
c7f75a4bd8 Renaming GroupImagePage -> ModerationGroupImagesPage.js 2025-10-20 19:47:06 +02:00