Commit Graph

72 Commits

Author SHA1 Message Date
40a96142ba feat: implement hotspot visualization on map
- Add HotspotSeverity type and HotspotWithSeverity interface
- Implement getHotspots() method in analyticsService with severity calculation
- Add hotspot layer to MapView component with color-coded circles
- Create hotspot markers with severity icons and report count badges
- Add detailed hotspot popups showing report count, severity score, radius, and dates
- Implement hotspot toggle control in MapFilters with loading state
- Add hotspot severity legend to MapFilters
- Integrate hotspot data fetching in MapPage with sample fallback data
- Color-code hotspot boundaries: yellow (low), orange (medium/high), red (critical)
- Display hotspot statistics in interactive popups

Implements task 12: Create hotspot visualization
Requirements: 3.2, 3.3, 3.5
2025-11-16 19:01:26 +00:00
82635559db feat: implement data visualization charts for analytics dashboard
- Add TimeSeriesChart component for report trends over time
- Add LitterTypeChart component with pie chart for type distribution
- Add QuantityChart component with bar chart for quantity aggregation
- Update analytics service with new API methods for chart data
- Add new types for chart data structures (TimeSeriesDataPoint, LitterTypeDistribution, QuantityAggregation)
- Integrate charts into AnalyticsPage with responsive grid layout
- Add mock data fallback for development when API is not available
- Configure charts for mobile responsiveness
- Implement comparison metrics display in time series
- Add loading states and empty states for all charts

Implements task 11: Data visualization charts
Requirements: 5.2, 5.3, 5.4
2025-11-16 18:58:01 +00:00
4be50caf4c fix: add graceful fallback for analytics API not yet implemented
- Show mock data (zeros) when API is unavailable
- Display warning message instead of error
- Update export error message to be more informative
- Prevents JSON parse errors when backend endpoints don't exist yet
2025-11-16 18:53:39 +00:00
9f7fc43fb2 feat: implement analytics dashboard layout (task 10)
- Add analytics types (AnalyticsSummary, DateRange)
- Create analyticsService for API calls and CSV export
- Implement DateRangeSelector component with presets
- Create StatCard component for summary statistics
- Build responsive AnalyticsPage with:
  - Summary statistics cards (reports, events, users, litter collected)
  - Date range filtering with presets
  - CSV export functionality
  - Loading and error states
  - Responsive grid layout

Requirements: 5.1, 5.5
2025-11-16 18:52:34 +00:00
fc2fff5cb1 feat: Configure database with Prisma and MySQL spatial support (Task 22)
- Set up MySQL 8.0+ with spatial data support (POINT SRID 4326)
- Created Prisma schema with all models (User, Report, Event, etc.)
- Added Clerk authentication support (clerk_id field)
- Configured spatial indexes on location fields for performance
- Created database migrations and applied to MySQL
- Built spatial query utilities for geographical operations
- Added database connection singleton and health checks
- Created comprehensive documentation and test scripts

Requirements: 1.1, 2.1, 3.2, 4.1
2025-11-16 18:46:00 +00:00
82a365f357 Update tasks to reflect MySQL instead of PostgreSQL/PostGIS
- Change task 22 from PostgreSQL+PostGIS to MySQL with spatial support
- Update references to PostGIS spatial queries to MySQL spatial functions
- Remove materialized view reference (MySQL specific)
- Update test task to reference MySQL instead of PostGIS
2025-11-16 18:21:09 +00:00
48e75465ab Add Clerk authentication to API requests
- Update API client to include Bearer token in requests
- Add token getter method to reportService for photo uploads
- Create ApiInitializer component to set up auth tokens
- Use Clerk's getToken() to retrieve session tokens
- Fix 401 Unauthorized errors on report submission
2025-11-16 17:34:07 +00:00
ae19d9b690 Change backend API port from 3000 to 3005
- Update server default port to 3005
- Update frontend API base URL to point to port 3005
2025-11-16 17:31:11 +00:00
c0ec28c5c9 Set up backend API server with Express and Prisma
- Initialize Node.js/Express backend project structure
- Configure TypeScript for backend development
- Set up Prisma ORM with MySQL database schema
- Implement authentication middleware with Clerk
- Create photo upload endpoint with EXIF extraction
- Build report CRUD endpoints (create, read, delete)
- Add file upload handling with Multer
- Configure CORS and security middleware (helmet)
- Set up error handling and validation
- Create development environment configuration

Task 21 complete: Backend foundation ready for report submissions
2025-11-16 17:29:26 +00:00
7dc1ff740b Auto-show zoomed map when EXIF location data is detected
- Automatically display map when photo contains GPS coordinates
- Zoom to level 15 for EXIF locations (more detailed view)
- Add contextual header explaining location source
- Improve map container styling with shadow and colored header
- Show helpful message for EXIF vs manual location selection
2025-11-16 17:18:30 +00:00
51a8b4999d Make Why Clean page more impactful and visually engaging
- Add beach background image with gradient overlay
- Use larger, bolder headlines with emotional impact
- Add color-coded sections (blue, red, green, purple, orange)
- Include visual cards and grid layouts for better readability
- Add hover effects and transitions for interactivity
- Use emojis and icons more prominently
- Create compelling call-to-action with yellow highlight box
- Improve typography with larger text and better hierarchy
2025-11-16 17:15:20 +00:00
96e28e3017 Add Why Clean Our Beaches page with environmental facts
- Create new WhyCleanPage with comprehensive environmental information
- Include sections on marine life impact, wave power generation, economic impact, and human health
- Add button to homepage for easy access to environmental facts
- Update routing to include /why-clean path
- Use responsive button layout with flex-wrap for mobile support
2025-11-16 17:12:57 +00:00
8be807b379 Add Irish beach background image to landing page
- Use IMG_6703.jpeg as full-page background with parallax effect
- Add dark overlay for better text readability
- Update feature cards with semi-transparent backgrounds
- Enhance buttons with hover effects and transitions
2025-11-16 17:07:05 +00:00
520970993d chore: mark task 9 as complete 2025-11-16 16:52:01 +00:00
3aa7576487 feat: implement report submission and display (task 9)
- Created reportService for API interactions (upload, create, get, verify, dispute)
- Built ReportDetailModal component with photo gallery and verification UI
- Updated ReportForm with actual API submission and progress tracking
- Added error handling and success states
- Created ReportDetailDemo page to showcase modal functionality
- Added route for demo page at /demo/report-detail
- Exported services through index file for cleaner imports
- Documented implementation in SUBMISSION_IMPLEMENTATION.md

Requirements fulfilled: 1.8, 7.4
2025-11-16 16:35:05 +00:00
c4aad5d099 feat: implement litter report form with multi-step wizard
- Create comprehensive ReportForm component with 4-step wizard
- Add progress indicator showing current step
- Implement litter type categorization with descriptions
- Add quantity estimation with visual indicators
- Include optional description textarea with character limit
- Create environmental concerns section with severity levels
- Integrate PhotoUpload and LocationSelector components
- Add form validation with error messages
- Implement review step showing all submitted data
- Update ReportFormPage to use new ReportForm component
- Create barrel export for report components

Requirements: 1.6, 1.7, 9.1, 9.2
2025-11-16 16:26:32 +00:00
de06012d27 docs: add LocationSelector implementation summary documentation 2025-11-16 16:23:10 +00:00
3864d3aa37 fix: correct EXIF GPS data extraction using exifr.gps()
The previous implementation was using exifr.parse() with pick option,
which doesn't work for GPS coordinates since latitude/longitude are
computed values, not direct EXIF fields.

Changed to use exifr.gps() method which properly extracts and computes
GPS coordinates from EXIF GPSLatitude/GPSLongitude fields.

This fixes the issue where photos with GPS EXIF data were showing
'No GPS data' in the UI.
2025-11-16 16:22:17 +00:00
e18997ed95 feat: implement location selection interface with EXIF, GPS, and map picker
- Created LocationSelector component with three location input methods:
  * Auto-populate from photo EXIF data
  * Device GPS location capture with accuracy indicator
  * Interactive Leaflet map picker with draggable marker
- Added Ireland coordinate validation (lat: 51.4-55.4, lng: -10.5--5.5)
- Created coordinate utility functions for validation and formatting
- Added LocationSelectorDemo page for testing at /demo/location-selector
- Displays selected location with coordinates, source, and accuracy
- Provides clear error messages for validation failures
- Satisfies requirements 1.1, 1.2, 1.3, 8.2
2025-11-16 16:15:42 +00:00
ebdfc797ac feat: implement photo upload component with EXIF extraction
- Add PhotoUpload component with drag-and-drop interface
- Integrate exifr library for GPS and timestamp extraction
- Implement file validation (type, size)
- Add photo previews with metadata overlay
- Support multiple photo uploads (max 5 files, 5MB each)
- Display GPS indicators and extracted metadata
- Create demo page for testing component
- Satisfies requirements 1.2, 1.3, 1.4, 1.5, 8.3
2025-11-16 16:11:00 +00:00
8f297e1ec4 feat: implement heat map visualization with Leaflet.heat plugin
- Integrate Leaflet.heat plugin for heat map overlay
- Add heat map toggle control in MapFilters component
- Configure heat map intensity based on report quantity levels (minimal: 0.3, moderate: 0.5, significant: 0.7, severe: 1.0)
- Implement heat map layer management with proper cleanup
- Add custom gradient colors (blue to red) for visual intensity representation
- Configure heat map with radius: 25px, blur: 15, maxZoom: 17
- Add TypeScript type declarations for leaflet.heat
- Heat map respects existing filter state (date range, litter type, quantity)

Implements task 5: Create heat map visualization
Requirements: 3.1, 3.5
2025-11-16 16:05:31 +00:00
ba324b370e Initial Commit 2025-11-16 16:00:51 +00:00