Skip to content

Vidhi-0603/RideNow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— RideNow

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.

-Landing Page

✨ Features

For Riders (Users)

  • πŸ” 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

For Captains (Drivers)

  • πŸ” 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

Core Capabilities

  • ⚑ 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

πŸ› οΈ Tech Stack

Frontend

  • 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

Backend

  • 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

External APIs

  • Geoapify Geocoding API - Convert addresses to coordinates
  • Geoapify Routing API - Calculate routes, distances, and travel times
  • Geoapify Places API - Address autocomplete and suggestions

πŸ“‹ Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local or Atlas)
  • Geoapify API Key (free tier available at Geoapify)

πŸš€ Installation & Setup

1. Clone the Repository

git clone https://github.com/Vidhi-0603/RideNow.git
cd RideNow

2. Backend Setup

cd Backend
npm install

Create 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_key

Start the backend server:

<<<<<<< HEAD

npm start

The backend will run on http://localhost:5000

3. Frontend Setup

cd Frontend
npm install

Create a .env file in the Frontend folder:

VITE_BASE_URL=your_backend_url

Start the frontend development server:

npm start

The frontend will run on http://localhost:3000

πŸ“ Project Structure

=======

Project Structure

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

πŸ”‘ API Endpoints

Authentication

  • POST /api/users/register - Register new user
  • POST /api/users/login - User login
  • GET /api/users/profile - Get user profile
  • GET /api/users/logout - User logout
  • POST /api/captains/register - Register new captain
  • POST /api/captains/login - Captain login
  • GET /api/captains/profile - Get captain profile
  • GET /api/captains/logout - Captain logout

Rides

  • POST /api/rides/create - Create new ride request
  • GET /api/rides/get-fare - Calculate ride fare
  • POST /api/rides/confirm - Confirm ride by captain
  • GET /api/rides/start-ride - Start ride with OTP
  • POST /api/rides/end-ride - Complete ride

Maps & Location

  • GET /api/maps/get-distance-time - Calculate distance and time
  • GET /api/maps/get-suggestions - Get address suggestions

πŸ—ΊοΈ Geoapify Integration

RideNow uses Geoapify's free APIs for all mapping and location features:

πŸ”„ Real-Time Features

RideNow uses Socket.IO for real-time communication:

WebSocket Events

  • join - User/Captain joins their room
  • update-location-captain - Captain sends location updates
  • ride-requested - Notify captains of new ride requests
  • ride-confirmed - Notify user when captain accepts
  • ride-started - Notify user when ride begins
  • ride-ended - Notify both parties when ride completes

πŸ“± Screenshots

User Interface

  • 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 Interface

  • Captain dashboard with nearby ride requests
  • Accept/decline ride interface
  • Navigation to pickup and drop locations
  • OTP verification screen
  • Ride completion interface

Screenshots

Mobile View:


πŸ”’ Security Features

  • 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

🎯 Future Enhancements

  • Payment gateway integration
  • Ride rating and review system
  • Push notifications
  • Ride scheduling
  • Multi-stop rides
  • Ride sharing options

Author

Vidhi-0603


πŸ™ Acknowledgments

  • Leaflet - Open-source mapping library
  • Geoapify - Free geocoding and routing APIs
  • Socket.IO - Real-time communication
  • Inspired by Uber's ride-hailing platform

License

MIT


Additional Resources


Getting Started

  1. Clone the repository.
  2. Set up .env files in both Backend and Frontend folders with your Geoapify API key and MongoDB URI.
  3. Install dependencies in both folders:
    cd Backend && npm install
    cd ../Frontend && npm install

About

A ride-hailing application built with modern technologies that allows users to book rides and track drivers in real-time. The project replicates core Uber functionalities, including authentication, live location tracking, fare estimation, and ride management.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages