Commit Graph

16 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
fe65544893 docs: complete upgrade documentation with CHANGELOG, smoke tests, and actual timelines 2025-10-29 23:10:21 +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
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
48bf6f2074 Initial Commit 2025-10-15 21:33:00 +02:00