potholes.live is a real-time pothole detection and mapping platform built for speed, privacy, and impact. It uses Yolo based custom trained ML model (edge inferenence), and a modern web stack to help users report and visualize road hazards.
- Real-time pothole detection using ONNX Runtime Web and a YOLO model
- Visual fingerprinting and deduplication to prevent duplicate reports
- Interactive Mapbox GL map with clustering and heatmaps
- GPS tracking and route recording with session statistics
- Supabase/Postgres backend with Row Level Security (RLS)
- Authentication via email, Google, and GitHub (Supabase Auth)
- Progressive Web App (PWA) support for mobile and desktop
- Serverless backend functions (Netlify) for secure token proxying and geocoding
- Share and social features for easy report sharing
- Frontend: React 18, TypeScript, Vite, Tailwind CSS, shadcn/ui
- AI/ML: ONNX Runtime Web, YOLOv8 model
- Mapping: Mapbox GL, react-map-gl
- Backend: Supabase (Auth, Postgres, PostGIS), Netlify Functions
- State: React Query (TanStack Query)
- Routing: React Router v6
src/
components/ # UI and app components
contexts/ # React contexts (Auth, etc.)
hooks/ # Custom React hooks
lib/ # Core logic: fingerprinting, geospatial, reporting, auth
pages/ # Route pages (Index, Profile, etc.)
workers/ # Web Workers for ML inference
public/
models/ # ONNX model files
onnxruntime/ # ONNX runtime WASM files
netlify/
functions/ # Serverless backend functions
scripts/ # Build and env scripts
[config files] # Vite, Tailwind, Netlify, etc.
- Pothole fingerprinting: Tracks each pothole by position, size, aspect ratio, and appearance across frames
- Deduplication logic: Uses quantized geospatial cells and visual similarity to avoid double-counting
- Offline queue: IndexedDB stores pending reports, syncing automatically when online
- Supabase RLS: All data protected by row-level security
- Mapbox token security: Tokens are proxied via serverless functions, never exposed directly
- Node.js 18+ or Bun
- Supabase project with PostgreSQL and PostGIS
- Mapbox account with access token
- Netlify account (for deployment)
- Google OAuth credentials (optional)
- GitHub OAuth app (optional)
Create a .env file in the root directory:
# Supabase Configuration
VITE_SUPABASE_URL=https://your-project-ref.supabase.co
VITE_SUPABASE_ANON_KEY=your_anon_key_here
# Mapbox
VITE_MAPBOX_TOKEN=your_mapbox_token
VITE_SHARE_PIN_URL=https://your-domain.com/icon-192.png
# Server-side only (no VITE_ prefix)
MAPBOX_ACCESS_TOKEN=your_mapbox_token
npm install
# or
bun install
npm run dev
# or
bun dev
# App runs at http://localhost:8080
npm run build
npm run build:dev
npm run preview
Use Netlify for serverless functions and static hosting. Set environment variables in the Netlify dashboard. The project is configured with netlify.toml for automatic builds.
- Create a Supabase project at https://supabase.com
- Enable Email authentication in Authentication → Providers
- (Optional) Enable Google OAuth and GitHub OAuth in Providers
- Run the database schema from
supabase-schema-minimal.sqlin the SQL Editor - Copy your Project URL and anon key from Settings → API
vite.config.ts- Vite bundler configurationtailwind.config.ts- Tailwind CSS configurationtsconfig.json- TypeScript configurationnetlify.toml- Netlify deployment settingscomponents.json- shadcn/ui components config
npm run dev- Start development servernpm run build- Production buildnpm run build:dev- Development buildnpm run lint- Run ESLintnpm run preview- Preview production build
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Mobile browsers with camera access
See CONTRIBUTING.md for guidelines.