SafePath is a crime-aware routing app for Chicago. It fetches recent crime data, builds risk buffers, and offers direct vs safety‑optimized routes.
- Real-time crime data (Chicago Open Data)
- Direct vs optimized (avoid risk polygons) routing
- Leaflet interactive map
- Turf.js geospatial buffers & unions
- Address geocoding (Nominatim)
- OpenRouteService directions
Next.js (App Router) • React • TypeScript • Leaflet / react-leaflet • Turf.js • Tailwind CSS • Axios
- Chicago Crime Data: https://data.cityofchicago.org/resource/ijzp-q8t2.json
- Nominatim Geocoding: https://nominatim.openstreetmap.org/search
- OpenRouteService Directions: https://api.openrouteservice.org
- OSM Tiles: https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
Create .env.local (not committed) using .env.example.
npm run dev - start dev npm run build - production build npm start - run production
Do not expose API keys in client code—proxy via Next.js route handlers.
- Caching & rate limit handling
- User auth + saved safe routes
- Heatmap & severity weighting