A smart route planning application that helps users find the safest routes between two locations using real-time data and advanced safety algorithms.
cursorful-video-1752731923529.mp4
- Smart Route Planning: Find the safest routes between pickup and destination locations
- Live GPS Tracking: Real-time location tracking with visual indicators
- Google Maps Integration: Interactive map with route visualization
- Safety Analysis: Route recommendations based on crime data, lighting, and emergency services proximity
- Modern UI: Clean, responsive design with loading states and error handling
-
Navigate to the backend directory:
cd safer-routes-backend/safer-routes-api -
Install dependencies:
npm install
-
Start the server:
node index.js
The backend will run on
http://localhost:3000
-
Navigate to the frontend directory:
cd safer-location-frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
The frontend will run on
http://localhost:5173
- Start Backend: Make sure the backend server is running on port 3000
- Open Frontend: Navigate to
http://localhost:5173in your browser - Enable Location: Allow location permissions for GPS tracking
- Plan Route: Enter pickup and destination locations, then click "Find Safest Route"
- View Results: See the route displayed on the map with distance and duration information
- React 18 with TypeScript
- Vite for build tooling
- Tailwind CSS for styling
- Lucide React for icons
- Axios for API calls
- Google Maps JavaScript API for mapping
- Node.js with Express
- OpenRouteService API for route calculation
- Geocoding API for location services
GET /- Health check endpointPOST /v1/api/carRoute- Calculate safer route between two locations- Body:
{ "origin": "location1", "destination": "location2" } - Response:
{ "route": [[lng, lat], ...], "Distance": "X km", "Duration": "X min" }
- Body:
- The app requires a Google Maps API key configured in the SaferLocation component
- Backend uses environment variables for API keys (stored in
.envfile) - Frontend and backend must both be running for full functionality
- The application is designed for local development
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is part of the Enactus initiative for creating safer transportation solutions.