Overview
The Reports System enables citizens to report municipal issues (potholes, broken streetlights, etc.) with photos and location data. Administrators can review, prioritize, and update report statuses in real-time.Report Categories
Alumbrado
Street lighting issues
Baches
Potholes and road damage
Limpieza
Cleaning and waste issues
Agua
Water supply problems
Alcantarillado
Sewage and drainage issues
Parques
Parks and recreation areas
Señalización
Traffic signs and signals
Seguridad
Public safety concerns
Ruido
Noise complaints
Otro
Other issues
Data Model
Report Structure
Reports Store (reportes.store.ts)
State Management
Creating Reports
Image Upload
Reports can include photos uploaded to Supabase Storage:Updating Report Status (Admin)
Fetching Reports with Filters
Real-Time Updates
The system supports real-time updates using Supabase Realtime:Geolocation Integration
Reports include precise location data using the MapSelector component. See Geolocation System for details.Location Data Structure
Usage Examples
Creating a Report
Admin Report Management
Report State Workflow
The report lifecycle follows ISO/IEC 25010 principles (maximum 5 states):Best Practices
Image Optimization
Image Optimization
Compress images before upload to reduce storage costs and improve load times. Recommended max size: 1200px width, 85% JPEG quality.
Location Validation
Location Validation
Always validate that latitude and longitude are within Manta’s boundaries (-1.1 to -0.8, -80.9 to -80.5) before accepting reports.
Real-Time Updates
Real-Time Updates
Subscribe to changes when the component mounts and unsubscribe when it unmounts to prevent memory leaks.
Error Logging
Error Logging
Log detailed errors (code, message, details) to help debug Supabase issues. Use structured logging for better observability.
Storage Configuration
Configure Supabase Storage bucket policies:
Related Resources
Geolocation
MapSelector component and location services
Supabase Storage
File upload and management documentation
