A real-time, cross-platform emergency reporting system for Unisan citizens and agencies. UERRA enables fast, category-based report routing to appropriate authorities, provides emergency tips, and suggests equipment for responders.
- ๐ฏ Overview & Features
- โก Quick Start Guide
- ๐ง Complete Setup Guide
- ๐ฑ User Guides
- ๐ ๏ธ Development & Technical
- โ Troubleshooting
- ๐ Deployment & Production
- ๐ Features by Role
- ๐ค Contributing & Support
| Role | Capabilities | Dashboard Features |
|---|---|---|
| ๐ง Citizens | Submit reports (citizen-only), track status, emergency tips | Report emergency, view my reports, emergency hotlines |
| ๐ข Agencies | View/accept assigned reports, update status, equipment suggestions | Live map, assigned reports, update status, equipment guide |
| ๐๏ธ Municipal Admin | Oversee all reports, manage agencies/categories | Analytics, agency & category management, report oversight |
| โก Super Admin | Full system access, user/agency/category management | Complete system control, advanced analytics |
- ๐ฑ Real-time Emergency Reporting (citizen-only, with photo upload & GPS)
- ๐บ๏ธ Live Map Integration (agency dashboard, Mapbox or OSM)
- ๐ Auto-routing by category (FireโBFP, MedicalโHospital/RHU, CrimeโPNP, etc.)
- ๐ Analytics Dashboard (admin: reports, users, agencies)
- ๐ Role-based Authentication (Email/Password, Google OAuth)
- ๐ฌ Realtime Updates (Supabase subscriptions for reports)
- ๐ Emergency Hotlines (quick access, call/copy logic)
- ๐ก Emergency Tips (category-based, dynamic)
- ๏ฟฝ๏ธ Equipment Suggestions (agency dashboard, per category)
- ๐ฑ Mobile-First Responsive Design (all dashboards, dialogs, tables)
- ๐๏ธ Password Visibility Toggles (login/register)
- โก Loading States & Progress Indicators (auth, data, report submission)
- โ Real-time Form Validation (register, report form)
- ๐ฏ Smart OAuth Integration (Google, environment-aware)
- ๐ก๏ธ Enhanced Error Handling (auth, report, admin)
- ๐ Auto Profile Creation (first login, citizen default)
- ๐ง Email Verification Flow (register, login)
- ๐ผ๏ธ Modern Auth UI (dual-panel, branding)
โ ๏ธ Offline Detection (network status, OfflineHint)
# 1. Clone and install
git clone https://github.com/qppd/UERRA.git
cd uniapp
npm install
# 2. Set up environment
cp .env.example .env
# Edit .env with your Supabase credentials
# 3. Database setup (run in Supabase SQL Editor)
# Execute: database-schema.sql
# 4. Start development
npm run dev๐ That's it! Open http://localhost:5173 and start reporting emergencies.
- Node.js 18+ installed
- Supabase account created
- Project environment variables configured
- Database schema executed
- OAuth providers configured (optional)
Once setup is complete, users can immediately access:
- โ Email/Password Registration with validation and verification
- โ Google OAuth Login for quick social authentication
- โ GitHub OAuth Login for developer-friendly access
- โ Automatic Profile Creation with citizen role assignment
- โ Role-based Dashboard Access based on user permissions
- โ Responsive Mobile Experience optimized for emergency scenarios
๐ฆ Installation & Dependencies
- Node.js (v18+ recommended) - Download here
- npm (comes with Node.js)
- Supabase account - Sign up at supabase.com
- Mapbox account (optional) - For enhanced maps
# Clone the repository
git clone https://github.com/qppd/UERRA.git
cd uniapp
# Install all dependencies
npm install
# Verify installation
npm run dev| Component | Technology | Version | Purpose |
|---|---|---|---|
| Frontend | React | 19.1.0+ | User interface |
| Build Tool | Vite | 7.0.4+ | Development server & bundling |
| UI Library | Material-UI | 7.3.1+ | Component library |
| Backend | Supabase | 2.53.0+ | Database, auth, realtime |
| Maps | Mapbox GL | 3.14.0+ | Interactive maps |
| Charts | Recharts | 3.1.2+ | Data visualization |
| Code Quality | ESLint | 9.30.1+ | Linting and code standards |
๐๏ธ Database Configuration
- Go to Supabase Dashboard
- Click "New Project"
- Choose organization and set project name:
uerra-unisan - Wait for database to initialize
- Navigate to SQL Editor in Supabase dashboard
- Copy entire content from
database-schema.sql - Paste and click "Run"
- Verify tables created:
users,agencies,categories,reports,report_updates
Run this verification query:
-- Check all tables exist
SELECT table_name FROM information_schema.tables
WHERE table_schema = 'public'
ORDER BY table_name;
-- Verify users table structure
SELECT column_name, data_type, is_nullable
FROM information_schema.columns
WHERE table_schema = 'public' AND table_name = 'users'
ORDER BY ordinal_position;| Table | Purpose | Key Columns |
|---|---|---|
| users | User profiles with roles | id, email, role, agency_id |
| agencies | Emergency response agencies | id, name, type, contact, location |
| categories | Emergency types | id, name, assigned_agencies, emergency_tips |
| reports | Citizen emergency reports | id, user_id, category_id, location, status |
| report_updates | Status tracking timeline | id, report_id, status, notes, created_at |
- Fire Emergency โ Bureau of Fire Protection (BFP)
- Medical Emergency โ Hospital/Rural Health Unit (RHU)
- Crime/Security โ Philippine National Police (PNP)
- Natural Disaster โ Municipal Disaster Risk Reduction Management Office (MDRMMO)
- Road Accident โ PNP + Hospital
๐๏ธ Storage Setup
- Go to Storage in Supabase dashboard
- Click "Create bucket"
- Configure:
- Name:
photos - Public bucket: โ Enable
- File size limit: 5MB
- Allowed MIME types:
image/*
- Name:
-- Policy 1: Allow authenticated users to upload photos
CREATE POLICY "Allow authenticated users to upload photos"
ON storage.objects
FOR INSERT TO authenticated
WITH CHECK (bucket_id = 'photos');
-- Policy 2: Allow public viewing of photos
CREATE POLICY "Allow public viewing of photos"
ON storage.objects
FOR SELECT
USING (bucket_id = 'photos');
-- Policy 3: Allow users to update their own photos
CREATE POLICY "Allow users to update own photos"
ON storage.objects
FOR UPDATE TO authenticated
USING (auth.uid()::text = (storage.foldername(name))[1]);- Register/login to your app
- Submit a test emergency report with photo
- Check Storage โ photos bucket for uploaded file
๐ Authentication & OAuth Configuration
UERRA supports multiple authentication methods with enhanced security and user experience features.
- ๐ง Email/Password Authentication with validation and security checks
- ๐ Google OAuth Integration for quick social login
- ๐ GitHub OAuth Integration for developer-friendly authentication
- โ Email Verification for account security
- ๐๏ธ Password Visibility Toggle for better user experience
- ๐ Loading States with progress indicators
- ๐ก๏ธ Auto Profile Creation with role-based access control
- ๐ฑ Responsive Design optimized for all devices
- Go to Google Cloud Console
- Navigate to APIs & Services โ Credentials
- Create OAuth 2.0 Client ID (if none exists)
http://localhost:5173
http://localhost:5174
https://yourdomain.vercel.app
http://localhost:5173
http://localhost:5174
https://yourdomain.vercel.app
https://YOUR_SUPABASE_URL.supabase.co/auth/v1/callback
- Go to Authentication โ Providers โ Google
- Enable the provider: Toggle ON
- Enter Client ID and Client Secret from Google Console
- Configure Site URL:
https://yourdomain.vercel.app - Configure Redirect URLs:
http://localhost:5173/**,https://yourdomain.vercel.app/**
- Go to GitHub Settings
- Click "New OAuth App"
- Configure:
- Application name:
UERRA Emergency App - Homepage URL:
https://yourdomain.vercel.app - Authorization callback URL:
https://YOUR_SUPABASE_URL.supabase.co/auth/v1/callback
- Application name:
- Go to Authentication โ Providers โ GitHub
- Enable the provider: Toggle ON
- Enter Client ID and Client Secret from GitHub OAuth App
- Save configuration
Add to your .env file:
# Supabase Configuration (Required)
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_anon_key_here
# Maps Configuration (Optional)
VITE_MAPBOX_TOKEN=pk.your_mapbox_token_here- โ Email format validation
- โ Password strength requirements (8+ characters)
- โ Password confirmation matching
- โ Terms agreement checkbox
- โ Email verification process
- โ Automatic citizen role assignment
- โ Secure redirect handling for production/development
- โ Error handling with user-friendly messages
- โ Loading states during authentication
- โ Automatic profile creation on first login
- โ Clean URL management after OAuth callback
- โ Row-Level Security (RLS) policies
- โ JWT token management via Supabase Auth
- โ Secure session handling
- โ Protected route access based on user roles
๐ Environment Configuration
# Copy environment template
cp .env.example .env# Supabase Configuration (Required)
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_anon_key_here
# Mapbox for Maps (Optional - app works without it)
VITE_MAPBOX_TOKEN=pk.your_mapbox_token_here
# Development Settings
VITE_APP_ENV=development
VITE_DEBUG_MODE=true- Go to Supabase Dashboard
- Select your project
- Go to Settings โ API
- Copy Project URL and anon/public key
- Create account at Mapbox
- Go to Account โ Access Tokens
- Copy default public token or create new one
๐ง Citizen User Guide
- Create Account: Register with email/password, Google OAuth, or GitHub OAuth
- Email Verification: Check your email and verify your account for security
- Profile Setup: Automatic citizen role assignment and profile creation on first login
- Dashboard Access: Navigate your personalized citizen dashboard with modern UI
- Enhanced Form Validation: Real-time email format and password strength checking
- Password Visibility Toggle: Eye icons to show/hide password for better UX
- Confirmation Matching: Ensures password confirmation matches original
- Terms Agreement: Required checkbox for terms and conditions acceptance
- Loading States: Visual progress indicators during account creation
- Success Feedback: Clear confirmation messages with email verification instructions
- ๐ Google OAuth: One-click sign-in with your Google account
- ๐ GitHub OAuth: Developer-friendly authentication for GitHub users
- Smart Redirect Handling: Seamless flow between development and production environments
- Auto Profile Creation: Automatic citizen profile setup on first social login
- Fire emergencies (house fires, forest fires)
- Medical emergencies (accidents, health crises)
- Crime incidents (theft, violence, suspicious activity)
- Natural disasters (floods, landslides, severe weather)
- Road accidents (vehicle crashes, blocked roads)
-
Access Report Form
- Click "Report Emergency" button on dashboard
- Or use the "+" floating action button
-
Select Emergency Category
- Choose from predefined categories
- Each category auto-routes to appropriate agencies
-
Provide Details
- Title: Brief description (e.g., "House Fire on Main Street")
- Description: Detailed explanation of the situation
- Location: GPS auto-detected (can be manually adjusted)
- Photo/Video: Optional visual evidence
-
Submit Report
- Review all information
- Click "Submit Emergency Report"
- Receive confirmation with report ID
-
Track Progress
- Monitor status updates in real-time
- Receive notifications when agencies respond
- View response timeline in "My Reports"
Each category provides context-aware safety tips:
| Category | Sample Tips |
|---|---|
| Fire | Stay low to avoid smoke, Use stairs never elevators |
| Medical | Apply pressure to bleeding, Keep patient calm |
| Crime | Do not confront suspects, Move to safe location |
| Disaster | Move to higher ground, Stock emergency supplies |
| Accident | Turn on hazard lights, Check for injuries |
- ๐ Report Status Dashboard: Track all your reports
- ๐ Location Services: GPS-enabled emergency reporting
- ๐ Emergency Hotlines: Quick access to all agency numbers
- ๐ก Safety Tips: Category-specific emergency guidance
- ๐ฑ Mobile Optimized: Works seamlessly on all devices
๐ข Agency User Guide
- Account Assignment: Admin assigns you to an agency
- Role Configuration: Your account linked to specific agency (PNP, BFP, Hospital, etc.)
- Dashboard Access: Access agency-specific emergency dashboard
- Real-time Report Pins: All emergency reports displayed on map
- Color-coded Categories: Fire (red), Medical (green), Crime (blue), etc.
- Location Details: Exact GPS coordinates and addresses
- Cluster View: Multiple reports in same area grouped together
- Filter by Status: Pending, Acknowledged, In Progress, Resolved
- Priority Levels: Low, Medium, High, Critical
- Assigned Reports: Only your agency's relevant emergencies
- Bulk Actions: Update multiple reports simultaneously
Intelligent recommendations based on emergency type:
| Emergency Type | Suggested Equipment |
|---|---|
| Fire | Fire extinguisher, Hose, Ladder, Water tank, Protective gear |
| Medical | First aid kit, Stretcher, Oxygen tank, Defibrillator, Ambulance |
| Crime | Patrol vehicle, Communication radio, Investigation kit |
| Disaster | Rescue boat, Life vests, Emergency supplies, Communication equipment |
| Accident | Traffic cones, First aid kit, Tow truck, Ambulance |
- Receive Alert: New reports automatically appear on dashboard
- Assess Priority: Review details, location, and severity
- Acknowledge Report: Change status from "Pending" to "Acknowledged"
- Equipment Checklist: Review suggested equipment list
- Update Status: Mark as "In Progress" when responding
- Add Notes: Provide updates for citizen and other agencies
- Mark Resolved: Close report when emergency is handled
- Shared Reports: Some emergencies (road accidents) involve multiple agencies
- Update Visibility: All assigned agencies see status changes
- Communication Log: Track all updates and notes
- Handoff Capability: Transfer primary responsibility between agencies
๐๏ธ Admin User Guide
- Super Admin Assignment: Super admin grants you admin privileges
- Municipal Access: Overview of all emergency operations
- Management Capabilities: User, agency, and category management
- Real-time Statistics: Total reports, response times, resolution rates
- Trend Analysis: Weekly/monthly patterns and emergency frequency
- Category Breakdown: Which emergency types are most common
- Agency Performance: Response times and resolution efficiency
- Geographic Analysis: Which barangays have most emergencies
- Role Assignment: Assign users to agencies or admin roles
- Account Oversight: View all user profiles and activity
- Permission Control: Grant/revoke access to different features
- Agency Affiliation: Link agency personnel to their departments
- Agency Registration: Add new emergency response agencies
- Contact Information: Maintain phone numbers and addresses
- Coverage Areas: Define service territories
- Capability Matrix: What emergencies each agency handles
- Performance Metrics: Track agency response statistics
- Emergency Types: Create/modify emergency categories
- Auto-routing Rules: Define which agencies respond to what
- Emergency Tips: Update safety guidelines for citizens
- Equipment Lists: Maintain suggested equipment per category
- Priority Settings: Configure automatic priority assignment
- Export emergency data to CSV/Excel
- Generate performance reports for agencies
- Create statistical summaries for municipal planning
- Backup report data for records
- Customize app branding and colors
- Configure notification settings
- Manage system-wide announcements
- Update emergency hotline numbers
โก Super Admin Guide
- Complete Database Control: Direct access to all tables and data
- User Role Management: Assign any role to any user
- System Configuration: Modify core system settings
- Advanced Analytics: Deep insights into system performance
- Initial System Setup: Configure agencies, categories, and initial users
- Role Management: Assign municipal admins and agency personnel
- System Monitoring: Ensure optimal performance and uptime
- Data Backup: Regular backup and disaster recovery procedures
- Security Oversight: Monitor access patterns and security issues
- User Session Debugging: LogoutDebugPanel for authentication issues
- Database Query Tools: Direct SQL access for troubleshooting
- Performance Monitoring: Real-time system performance metrics
- Error Logging: Comprehensive error tracking and resolution
uniapp/
โโโ src/
โ โโโ components/ # All UI components (dashboards, dialogs, admin, etc.)
โ โโโ services/ # Business logic (e.g., CitizenReportService.js)
โ โโโ utils/ # Utility functions (auth, location, logout)
โ โโโ App.jsx # Main app, role-based routing
โ โโโ DashboardLayout.jsx # Sidebar, navbar, responsive layout
โ โโโ Login.jsx, Register.jsx # Auth forms
โ โโโ useAuthSession.js # Auth state hook
โ โโโ useUserProfile.js # User profile hook & upsert
โ โโโ supabaseClient.js # Supabase config
โ โโโ ... # Styles, assets, etc.
โโโ public/ # Static assets (icons, images)
โโโ database-schema.sql # DB setup
โโโ storage-policies.sql # Storage security
โโโ fix-*.sql # Migration scripts
โโโ package.json # Dependencies/scripts
โโโ ...
- Citizen: Can submit/view reports, see tips, hotlines. Only citizens can submit reports (enforced in UI & backend).
- Agency: Sees assigned reports, can update status, view map, get equipment suggestions.
- Admin: Manages agencies, categories, users, and sees analytics.
- Super Admin: Full access to all data, users, agencies, categories, and system settings.
Auto profile creation for new users (citizen by default). Role-based sidebar and dashboard content.
- Users: Can only view/edit their own profile
- Reports: Citizens see only their reports; agencies see assigned reports (by agency_id)
- Agencies/Categories: Read-only for all authenticated users
- Multiple Login Methods: Email/password + Google OAuth
- Session Management: Supabase JWT tokens, auto refresh
- Role-based Access: Dynamic dashboard, sidebar, and permissions
- Auto Profile Creation: Citizen by default, on first login
- Email Verification: Required for new accounts
- OAuth Callback Handling: Environment-aware redirects
- Loading/Error States: User-friendly feedback throughout
- Environment-aware Redirects: Dynamic OAuth redirect URLs for different environments
- CSRF Protection: Built-in Supabase security features
- Token Management: Secure JWT handling with automatic cleanup
- Logout Security: Enhanced logout with session cleanup and debug tools
| Screen Size | Layout | Features |
|---|---|---|
| Mobile (< 768px) | Single column, touch-optimized | Essential features, simplified navigation |
| Tablet (768-1024px) | Two-column, gesture-friendly | Full feature set, optimized spacing |
| Desktop (> 1024px) | Multi-column, sidebar navigation | Complete dashboard, advanced analytics |
- Report Updates: Live status changes across all dashboards
- New Report Alerts: Instant notifications to relevant agencies
- Multi-user Collaboration: Multiple agencies can update same report
- Connection Resilience: Automatic reconnection on network issues
- Report Statistics: Count by category, status, time period
- Response Metrics: Average response time per agency
- Geographic Distribution: Reports by location/barangay
- Trend Analysis: Weekly/monthly patterns
- ReportsGraph: Time-series trend visualization
- CategoryPie: Emergency type distribution
- StatsCards: Key performance indicators
- MapWithOverlayStats: Geographic data visualization
- Consistent Theming: Light/dark mode support
- Responsive Components: Mobile-first design approach
- Accessibility: WCAG 2.1 AA compliance
- Color Coding: Intuitive emergency category colors
- ๐ด Fire:
#ff4757(Red) - ๐ข Medical:
#2ed573(Green) - ๐ต Crime:
#3742fa(Blue) - ๐ก Disaster:
#ffa502(Orange) - ๐ Accident:
#ff6b6b(Light Red)
# Start dev server (hot reload)
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Lint code
npm run lint| File | Purpose | Key Settings |
|---|---|---|
vite.config.js |
Build config | React, dev server |
eslint.config.js |
Lint rules | React, code style |
package.json |
Dependencies | React, Supabase, MUI |
๐ Authentication Issues
Solution:
- Verify Supabase project URL and anon key in
.env - Check if user exists in Supabase Auth dashboard
- Try password reset flow
- Verify email confirmation (if enabled)
Solution:
- Check Google Cloud Console OAuth configuration
- Verify authorized redirect URIs include your domain (without
/auth/callback) - Ensure Supabase Google provider is enabled with correct Client ID/Secret
- Check Site URL and Redirect URLs in Supabase Auth settings
- Verify environment-specific redirect handling in OAuth flow
Solution:
- Check GitHub OAuth App configuration in Developer Settings
- Verify Authorization callback URL:
https://YOUR_SUPABASE_URL.supabase.co/auth/v1/callback - Ensure Supabase GitHub provider is enabled with correct credentials
- Check for CORS issues in browser developer tools
Solution:
- Check if RLS policies allow profile creation for authenticated users
- Use LogoutDebugPanel to examine auth state and user information
- Verify
upsertUserProfilefunction is working correctly - Check browser console for profile creation errors
- Manually trigger profile creation via "Create Profile" button
Solution:
- Check Supabase email settings and templates
- Verify redirect URL matches your application domain
- Check spam folder for verification emails
- Ensure email provider (SMTP) is properly configured in Supabase
Solution:
- Clear browser cache and localStorage
- Check OAuth redirect URL configuration for development vs production
- Verify clean URL management after OAuth callback
- Use LogoutDebugPanel to clear authentication state
- LogoutDebugPanel: Access authentication state inspection (development only)
- Browser Console: Check for OAuth callback and authentication errors
- Supabase Dashboard: Monitor auth logs, user sessions, and OAuth provider logs
- Network Tab: Inspect API calls during authentication flow
๐๏ธ Database Issues
Solution:
- Verify
database-schema.sqlwas executed completely - Check RLS policies are properly configured
- Ensure user has appropriate role assignments
- Verify Supabase connection in network tab
Solution:
- Check if
photosstorage bucket exists - Verify storage policies allow uploads
- Check file size limits (5MB default)
- Ensure file type is supported (images only)
Solution:
- Verify user has agency role and agency_id assigned
- Check if categories are properly linked to agencies
- Verify RLS policies allow agency users to see reports
- Check auto-routing configuration
-- Check database health
SELECT schemaname, tablename, attname, n_distinct, correlation
FROM pg_stats WHERE schemaname = 'public';
-- Monitor report counts by status
SELECT status, COUNT(*) FROM reports GROUP BY status;
-- Check user role distribution
SELECT role, COUNT(*) FROM users GROUP BY role;๐บ๏ธ Map & Location Issues
Solution:
- Check if Mapbox token is valid and added to
.env - Verify network connectivity to Mapbox services
- Check browser console for API errors
- Ensure token has appropriate permissions
Solution:
- Check if browser location permissions are granted
- Verify HTTPS is used (required for geolocation)
- Test on different devices/browsers
- Implement fallback to manual location entry
Solution:
- Verify coordinate format (latitude, longitude)
- Check PostGIS extension is installed
- Validate location data in database
- Test coordinate conversion functions
// Test geolocation in browser console
navigator.geolocation.getCurrentPosition(
position => console.log('Location:', position.coords),
error => console.error('Location error:', error)
);๐ฑ Performance & UI Issues
Solution:
- Optimize image compression for photos
- Implement pagination for large report lists
- Use React.memo for expensive components
- Add loading skeletons for better UX
Solution:
- Test on actual mobile devices
- Use Chrome DevTools device simulation
- Check Material-UI breakpoint configurations
- Verify touch targets meet accessibility standards
Solution:
- Check Supabase realtime configuration
- Verify network connectivity and WebSocket support
- Monitor browser console for connection errors
- Test connection resilience with network interruptions
// Monitor component render times
console.time('ComponentRender');
// ... component logic ...
console.timeEnd('ComponentRender');
// Monitor database query performance
const { data, error, count } = await supabase
.from('reports')
.select('*', { count: 'exact' })
.limit(10);
console.log('Query time:', performance.now());๐ Vercel Deployment
# Test production build locally
npm run build
npm run preview
# Verify all features work in production mode
# Check for console errors and warningsCreate vercel.json in project root:
{
"buildCommand": "npm run build",
"outputDirectory": "dist",
"framework": "vite",
"env": {
"VITE_SUPABASE_URL": "@supabase_url",
"VITE_SUPABASE_ANON_KEY": "@supabase_anon_key",
"VITE_MAPBOX_TOKEN": "@mapbox_token"
}
}- Connect GitHub repository to Vercel
- Configure environment variables in Vercel dashboard
- Set custom domain (optional)
- Deploy and test production environment
- Update Supabase site URL to production domain
- Update Google OAuth redirect URIs
- Test all features in production
- Monitor for any deployment-specific issues
# Production Supabase Configuration
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_production_anon_key
VITE_MAPBOX_TOKEN=pk.your_production_mapbox_token
VITE_APP_ENV=production๐ Production Monitoring
- Page Load Time: Target < 3 seconds
- First Contentful Paint: Target < 1.5 seconds
- Database Query Time: Target < 500ms
- Real-time Update Latency: Target < 1 second
- Daily Active Users: Track citizen and agency engagement
- Report Response Time: Average time from report to agency acknowledgment
- Resolution Rate: Percentage of reports marked as resolved
- System Uptime: Target 99.9% availability
- JavaScript Errors: Monitor client-side errors
- API Failures: Track Supabase operation failures
- Authentication Issues: Monitor login/logout problems
- Database Errors: Track query failures and timeouts
# API endpoint health check
curl -f https://your-app.vercel.app/api/health
# Database connectivity test
# (implement health endpoint that tests Supabase connection)
# Authentication flow test
# (automated test for login/logout cycle)๐ Security Best Practices
- โ Use HTTPS for all communications
- โ Implement proper session timeout
- โ Enable email verification for new accounts
- โ Use strong password requirements
- โ Monitor for suspicious authentication patterns
- โ Row Level Security (RLS) enabled on all tables
- โ Minimal API key permissions
- โ Regular security audits of database policies
- โ Backup and disaster recovery procedures
- โ Monitor for unusual query patterns
- โ Input validation on all forms
- โ File upload restrictions (type, size)
- โ CORS configuration for API endpoints
- โ Content Security Policy (CSP) headers
- โ Regular dependency security updates
- Identify: Monitor alerts and logs for security events
- Contain: Disable affected accounts or features
- Investigate: Analyze logs and determine impact
- Remediate: Fix vulnerabilities and restore service
- Review: Update security policies and procedures
- โ Emergency Report Submission with photo/video upload
- โ Real-time GPS Location detection and manual override
- โ Report Status Tracking with live updates
- โ Emergency Tips based on selected category
- โ Emergency Hotlines quick access directory
- โ Report History view all submitted reports
- โ Google OAuth and email/password authentication
- โ Mobile-responsive design for on-the-go reporting
- โ Live Map Dashboard with emergency report pins
- โ Report Management table with filtering and sorting
- โ Status Update System for tracking emergency response
- โ Equipment Suggestions based on emergency type
- โ Multi-agency Coordination for complex emergencies
- โ Priority Management with automatic priority assignment
- โ Communication Log for updates and notes
- โ Real-time Notifications for new assignments
- โ System Analytics dashboard with key metrics
- โ User Management with role assignment capabilities
- โ Agency Management for adding/editing response agencies
- โ Category Management for emergency types and routing
- โ Performance Monitoring for agency response times
- โ Data Export capabilities for reporting
- โ System Configuration for customization
- โ Comprehensive Reporting for municipal planning
- โ Complete System Access with database-level control
- โ Advanced User Management across all roles
- โ System Monitoring Tools for performance optimization
- โ Debug Utilities for troubleshooting issues
- โ Security Oversight with audit capabilities
- โ System Configuration at the deepest level
- โ Backup Management and disaster recovery
- โ Integration Management for third-party services
- Fork the repository on GitHub
- Clone your fork locally
- Install dependencies:
npm install - Set up environment variables
- Create feature branch:
git checkout -b feature/your-feature
- Follow ESLint configuration
- Use meaningful commit messages
- Write responsive, accessible code
- Test on multiple devices and browsers
- Document new features and APIs
- Update documentation for any new features
- Ensure all tests pass and no ESLint errors
- Test mobile responsiveness thoroughly
- Submit PR with detailed description
- Wait for code review and feedback
- Setup Issues: Check the Complete Setup Guide above
- Feature Questions: Review User Guides for your role
- Technical Problems: See Troubleshooting section
- API Documentation: Supabase docs at docs.supabase.com
- GitHub Issues: Report bugs and request features
- Discussions: Ask questions and share ideas
- Wiki: Community-contributed guides and tips
- System Administrator: For production issues
- Development Team: For feature requests and bugs
- Municipal IT: For deployment and infrastructure
This project is licensed under the MIT License. See the LICENSE file for details.
- React: MIT License
- Material-UI: MIT License
- Supabase: Apache 2.0 License
- Mapbox GL JS: Custom License (requires API key)
- ๐ Fire Emergency: Bureau of Fire Protection -
(042) 765-4321 - ๐ Medical Emergency: Unisan District Hospital -
(042) 111-2222 - ๐ฎ Police Emergency: Philippine National Police -
(042) 123-4567 - ๐ Disaster Management: MDRMMO -
(042) 333-4444 - ๐ฅ Health Services: Rural Health Unit -
(042) 555-6666
- ๐ National Emergency Hotline:
911 - ๐ Fire Department:
116 - ๐ฎ Police:
117 - ๐ Medical Emergency:
143
Built with โค๏ธ for the safety and security of Unisan citizens
Last updated: September 16, 2025
- โ Fixed emoji encoding issues in documentation
- โ Updated dependency versions to latest stable
- โ Enhanced mobile responsiveness across all components
- โ Improved database schema with better indexing
- โ Added comprehensive error handling and debug tools
- โ Expanded user guide documentation for all roles