A full-featured ride-hailing application built with the MERN stack that replicates core Uber functionalities. RideNow allows users to book rides and captains (drivers) to accept and fulfill ride requests in real-time with live location tracking and interactive maps.
- π Secure authentication and registration
- πΊοΈ Interactive map interface with Leaflet
- π Real-time location-based ride booking
- π Address autocomplete and suggestions
- π° Instant fare estimation before booking
- π View nearby available captains on the map
- π± Live captain location tracking during rides
- π’ OTP-based ride verification
- π Ride history and details
- π― Route visualization and turn-by-turn directions
- π Secure authentication with vehicle details
- πΊοΈ Interactive captain dashboard with map view
- π¬ Real-time ride request notifications
- β Accept or decline ride requests
- π§ Optimized routing to pickup and drop locations
- π’ OTP verification system
- π Automatic location updates via WebSocket
- π΅ Earnings tracking
- π Ride history management
- β‘ Real-time bidirectional communication with Socket.IO
- πΊοΈ Free and open-source mapping with Leaflet
- π Geocoding and routing powered by Geoapify API
- π Live location tracking and updates
- π JWT-based authentication
- πͺ Secure cookie-based sessions
- π± Responsive design for mobile and desktop
- β¨ Smooth animations with GSAP
- React - UI library for building interactive interfaces
- Leaflet - Open-source JavaScript library for interactive maps
- React-Leaflet - React components for Leaflet maps
- Context API - State management
- Axios - HTTP client for API requests
- Socket.IO Client - Real-time WebSocket communication
- GSAP - Animation library
- React Router - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Node.js - JavaScript runtime
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- Socket.IO - Real-time bidirectional communication
- JWT - JSON Web Tokens for authentication
- bcrypt - Password hashing
- cookie-parser - Cookie parsing middleware
- cors - Cross-Origin Resource Sharing
- dotenv - Environment variable management
- Geoapify Geocoding API - Convert addresses to coordinates
- Geoapify Routing API - Calculate routes, distances, and travel times
- Geoapify Places API - Address autocomplete and suggestions
- Node.js (v14 or higher)
- MongoDB (local or Atlas)
- Geoapify API Key (free tier available at Geoapify)
git clone https://github.com/Vidhi-0603/RideNow.git
cd RideNowcd Backend
npm installCreate a .env file in the Backend folder:
PORT=4000
FRONTEND_URL=your_frontend_url
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
GEOAPIFY_API_KEY=your_geoapify_api_keyStart the backend server:
<<<<<<< HEAD
npm startThe backend will run on http://localhost:5000
cd Frontend
npm installCreate a .env file in the Frontend folder:
VITE_BASE_URL=your_backend_urlStart the frontend development server:
npm startThe frontend will run on http://localhost:3000
=======
RideNow/
β
βββ Backend/
β βββ controllers/ # Request handlers
β βββ models/ # Database schemas
β βββ routes/ # API routes
β βββ services/ # Business logic & external API calls
β βββ middlewares/ # Authentication & validation
β βββ config/ # Configuration files
β βββ app.js # Express app setup
β βββ server.js # Server entry point
β
βββ Frontend/
β βββ src/
β β βββ components/ # Reusable React components
β β βββ pages/ # Page components
β β βββ context/ # Context API providers
β β βββ auth/ # Authentication utilities
β β βββ api/ # API service functions
β β βββ utils/ # Helper functions
β βββ public/
β βββ package.json
β
βββ README.md
POST /api/users/register- Register new userPOST /api/users/login- User loginGET /api/users/profile- Get user profileGET /api/users/logout- User logoutPOST /api/captains/register- Register new captainPOST /api/captains/login- Captain loginGET /api/captains/profile- Get captain profileGET /api/captains/logout- Captain logout
POST /api/rides/create- Create new ride requestGET /api/rides/get-fare- Calculate ride farePOST /api/rides/confirm- Confirm ride by captainGET /api/rides/start-ride- Start ride with OTPPOST /api/rides/end-ride- Complete ride
GET /api/maps/get-distance-time- Calculate distance and timeGET /api/maps/get-suggestions- Get address suggestions
RideNow uses Geoapify's free APIs for all mapping and location features:
RideNow uses Socket.IO for real-time communication:
join- User/Captain joins their roomupdate-location-captain- Captain sends location updatesride-requested- Notify captains of new ride requestsride-confirmed- Notify user when captain acceptsride-started- Notify user when ride beginsride-ended- Notify both parties when ride completes
- Landing page with call-to-action
- User/Captain authentication
- Interactive map with real-time location
- Ride booking flow with fare estimation
- Live tracking during rides
- Captain dashboard with nearby ride requests
- Accept/decline ride interface
- Navigation to pickup and drop locations
- OTP verification screen
- Ride completion interface
- Landing Page
- User Login Page
- Captain Login Page
- Location Search Suggestions
- Rider Home Page
- Nearby Captains
- Location Tracking
Mobile View:
- Waiting For Captain
- Sharing OTP
- Live Ride Location After Ride Started
- Location Tracing
- Ride Details After Completion
- Password hashing with bcrypt
- JWT-based authentication
- HTTP-only cookies for session management
- Protected API routes with middleware
- Input validation and sanitization
- CORS configuration for secure cross-origin requests
- Payment gateway integration
- Ride rating and review system
- Push notifications
- Ride scheduling
- Multi-stop rides
- Ride sharing options
- Leaflet - Open-source mapping library
- Geoapify - Free geocoding and routing APIs
- Socket.IO - Real-time communication
- Inspired by Uber's ride-hailing platform
MIT
- Clone the repository.
- Set up
.envfiles in bothBackendandFrontendfolders with your Geoapify API key and MongoDB URI. - Install dependencies in both folders:
cd Backend && npm install cd ../Frontend && npm install