Safe Path is a web application for pedestrians and cyclists that helps find the cleanest air route between two points. By analyzing real-time PM2.5 concentrations, it routes you through parks and residential areas, avoiding high-pollution highways and busy roads. You can check it here - https://ambushhere.github.io/green-path/
- Dual API Integration: Combines data from WAQI (aqicn.org) and OpenAQ.org for the most comprehensive air quality coverage.
- Intelligent Routing: Uses a custom steering algorithm to nudge routes toward low-pollution zones.
- Route Comparison: Visual side-by-side comparison of standard vs. clean routes, including an "AQI Exposure Score" and calculated savings.
- Travel Modes: Specialized routing profiles for both walking and cycling.
- Premium UI: Modern dark theme with a glassmorphism design for a professional and sleek look.
- Node.js (v18 or higher)
- npm or yarn
git clone https://github.com/ambushhere/green-path.git
cd green-pathnpm installnpm run devThe application will be available at http://localhost:5173
npm run buildThis creates an optimized production build in the dist folder.
npm run previewThis lets you test the production build locally before deployment.
npm run dev- Start development server with hot reloadnpm run build- Build for productionnpm run preview- Preview production build locallynpm run lint- Check code quality with ESLintnpm run test- Run unit tests with Vitestnpm run proxy- Run local API proxy server on port 8787
Copy .env.example to .env and set values as needed.
VITE_API_PROXY_BASE_URL- Optional proxy base URL (example:http://localhost:8787)VITE_ROUTING_API_BASE_URL- Optional direct routing API overrideVITE_GEOCODING_API_BASE_URL- Optional direct geocoding API overrideVITE_AIR_QUALITY_API_BASE_URL- Optional direct air quality API overrideVITE_WAQI_API_BASE_URL- Optional WAQI base overrideVITE_WAQI_TOKEN- Optional WAQI token for direct browser callsVITE_GEOCODING_LANGUAGE- Preferred geocoding language (defaulten)
See proxy/README.md for proxy-side environment variables like WAQI_TOKEN.
npm run proxyThen set:
VITE_API_PROXY_BASE_URL=http://localhost:8787Detailed proxy docs: proxy/README.md
- Framework: React 19 + TypeScript + Vite
- Styling: Tailwind CSS
- UI Components: Radix UI
- Maps: Leaflet.js + React-Leaflet + OpenStreetMap
- Routing: OSRM (Open Source Routing Machine)
- Geocoding: Nominatim (OpenStreetMap)
- Air Quality APIs: WAQI API & OpenAQ API
- Forms: React Hook Form
- HTTP Client: Axios
Created with care for people with allergies, asthma, and parents with strollers.