A privacy-safe QR-based vehicle alert and escalation system that allows anyone to notify vehicle owners without exposing phone numbers.
- Privacy-First Design: No phone numbers exposed to scanners
- QR Code Generation: Unique encrypted QR codes for each vehicle
- Instant Notifications: Real-time alerts when QR code is scanned
- ETA Response System: Owners can respond with 2, 5, or 10-minute arrival times
- Smart Escalation: Automatic escalation if owner doesn't respond
- Rate Limiting: Prevents spam (max 3 scans per device per hour)
- Geo-Validation: Location-based proximity checks
- Device Tracking: Hashed device IDs to prevent abuse
- Automatic Blocking: Devices exceeding rate limits are blocked
- Level 1 (5 min): SMS reminder sent to owner
- Level 2 (10 min): VoIP call initiated
- Level 3 (15 min): Automatic admin complaint registration
- React 18 with TypeScript
- Tailwind CSS for styling
- Lucide React for icons
- Supabase client for authentication and real-time updates
- Supabase Database (PostgreSQL)
- Supabase Authentication (Email/Password)
- Supabase Edge Functions (Deno runtime)
- Row Level Security (RLS) for data protection
- register-vehicle: Vehicle registration and QR generation
- scan-notify: QR scan notification with rate limiting
- respond-eta: ETA response handling
- escalation-handler: Automated escalation processing
- profiles: User profiles with notification preferences
- vehicles: Vehicle information and QR codes
- notifications: Scan notifications and responses
- rate_limits: Device-based rate limiting
- escalations: Escalation tracking
- admin_complaints: Admin complaint system
- Node.js 18+
- npm or yarn
- Supabase account (already configured)
- Install dependencies:
npm install-
Environment variables are already configured in
.env -
Run development server:
npm run dev- Build for production:
npm run build- Sign up for an account
- Add vehicle details (make, model, color, nickname)
- Download generated QR code
- Print and place QR code on vehicle dashboard
- Receive real-time notifications when scanned
- Respond with ETA (2, 5, or 10 minutes)
- Scan QR code on vehicle
- Optionally add message and location
- Submit notification to owner
- Wait for owner's ETA response
- Access admin dashboard
- View all escalated complaints
- Update complaint status (investigating, resolved)
- Add admin notes to complaints
- Maximum 3 scans per device per vehicle per hour
- Automatic device blocking for abuse
- Hashed device IDs for privacy
- Scanner location captured (with permission)
- Proximity validation (configurable radius)
- Location included in notification to owner
- Notification list updates automatically
- Status changes reflected immediately
- No page refresh needed
The escalation-handler edge function should be scheduled to run periodically (e.g., every 2 minutes) to check for:
- Pending notifications without response
- Expired ETAs
- Unresolved escalations
POST /functions/v1/register-vehicle- Register new vehicleGET /functions/v1/register-vehicle- Get user's vehicles
POST /functions/v1/scan-notify- Send notification (public)POST /functions/v1/respond-eta- Respond with ETA (authenticated)
POST /functions/v1/escalation-handler- Process escalations (scheduled)
All tables have RLS policies ensuring:
- Users can only see their own data
- Public can create notifications (with rate limits)
- Admins have elevated access to complaints
- Phone numbers stored encrypted
- QR codes use UUIDs, not predictable IDs
- Device IDs are hashed before storage
- No personal info exposed to scanners
- Email/password authentication via Supabase
- JWT-based session management
- Secure edge function authorization
The application is production-ready with:
- Optimized Vite build
- TypeScript for type safety
- Comprehensive error handling
- Real-time database subscriptions
- Responsive design for all devices
Potential features for future development:
- SMS/Email notifications via Twilio/SendGrid
- VoIP calling integration
- Push notifications
- Mobile app (React Native)
- Analytics dashboard
- Multi-language support
- Vehicle groups/fleets
- Custom escalation rules
For issues or questions, contact your system administrator.
Built with UrbanRelay - Privacy-Safe Vehicle Alert System