Commit Graph

13 Commits

Author SHA1 Message Date
e8ba1e73a0 feat(phase2): Implement Frontend Management Portal & nginx routing (Tasks 12, 20)
Task 12: ManagementPortalPage - Self-Service Portal Implementation
- New page: ManagementPortalPage.js (~650 lines) with token-based auth
- Maximum component reuse (ImageGalleryCard, ImageGallery, DescriptionInput, ConsentBadges)
- Single-page layout without tabs (consistent with ModerationGroupImagesPage)
- All CRUD operations: view, edit metadata, delete images, revoke/restore consents, delete group
- Data transformation: API camelCase → Component snake_case (ConsentBadges compatibility)
- Error handling: 404 invalid token, 429 rate-limit, general errors
- Route added: /manage/:token in App.js

Task 20: nginx Configuration for Management API
- Dev: Proxy /api/manage/* → backend-dev:5000
- Prod: Proxy /api/manage/* → image-uploader-backend:5000
- Headers: Host, X-Real-IP, X-Forwarded-For, X-Forwarded-Proto
- Frontend container rebuilt with new nginx config

Navigation Enhancement (Navbar.js):
- Conditional rendering with useLocation() hook
- Show "Upload" always (active only on /)
- Show "Mein Upload" additionally on /manage/:token (active)
- Both buttons visible simultaneously on management page

Test Results:
 Token validation (404 on invalid)
 API routing through nginx
 ConsentBadges display correctly
 All CRUD operations functional
 Rate-limiting working (429 on excessive requests)
 Navigation highlighting correct
 Component reuse: 0 lines duplicated code

Known Issues (to be fixed in separate bugfix session):
⚠️ Issue 6: ModerationGroupsPage - Filter "Alle Gruppen" not working
⚠️ Issue 7: Export button "Consent-Daten exportieren" not working

Files Changed:
- frontend/src/Components/Pages/ManagementPortalPage.js (NEW)
- frontend/src/App.js (route added)
- frontend/src/Components/ComponentUtils/Headers/Navbar.js (conditional nav)
- docker/dev/frontend/nginx.conf (proxy config)
- docker/prod/frontend/nginx.conf (proxy config)
- docs/FEATURE_PLAN-social-media.md (documentation updated)
2025-11-13 20:05:27 +01:00
76aa028686 fix: Add /api prefix to consent routes and nginx proxy config
- Update consent.js routes to use /api prefix
- Add /api/social-media location to dev/prod nginx configs
- Fix route registration for proper API access
2025-11-09 21:22:35 +01:00
1b4629cca3 changed admin, Link to gitea, LoadingLogo 2025-11-09 11:55:31 +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
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
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
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
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
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