Skip to content

dhruvinjs/Uber-Clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uber Project

This repository contains the implementation of an Uber-like application built using the MERN (MongoDB, Express.js, React, Node.js) stack. The project simulates the key features of a ride-hailing platform, including user and driver registration, ride booking, real-time tracking, and payment processing.


Features

  • User and Driver Registration
    • Users and drivers can sign up with personal and vehicle details.
  • Login and Authentication
    • Secure login using JWT-based authentication.
  • Ride Booking
    • Users can book rides by specifying pickup and drop-off locations.
  • Real-time Tracking
    • Track rides in real-time using live location updates.
  • Ride Management
    • Drivers can accept or reject rides.
  • OTP Verification
    • Secure ride start with OTP-based validation.
  • Fare Estimation
    • Calculate ride fares based on distance and vehicle type.
  • Payment Processing
    • Support for online and cash payments.
  • Recent Trip History
    • View past trips for both users and drivers.

Tech Stack

Frontend:

  • React.js: For building the user interface.
  • CSS: For styling the components.
  • GoMaps API: For location and map functionalities.

Backend:

  • Node.js: For server-side logic.
  • Express.js: For handling API endpoints.
  • MongoDB: For database storage.
  • Multer: For handling file uploads (e.g., driver identity proofs).

Additional Libraries:

  • Axios: For making HTTP requests.
  • JWT: For authentication and authorization.
  • Socket.io: For real-time location updates.

Project Snippets

Landing Page

User Login Page

alt text

Captain login Page

alt text

User Dashboard

alt text

Ride Options

alt text

Captain Popup For Ride

alt text

Captain otp for Starting Ride

alt text

Rider Details

alt text

Captain Map

alt text

User Map

alt text

User Payment With rating

alt text

Sos Form for user

alt text


Installation

Prerequisites

  • Node.js installed on your machine.
  • MongoDB database setup.

Steps to Run Locally

  1. Clone the repository:

    git clone <repository-url>
  2. Navigate to the project directory:

    cd uber-project
  3. Set up the backend:

    • Navigate to the backend directory:
      cd backend
    • Install dependencies:
      npm install
    • Create a .env file with the following variables:
      PORT=3000
      DB_URI=your-mongodb-connection-string
      JWT_SECRET=your-secret-key
    • Start the server:
      npm start
  4. Set up the frontend:

    • Navigate to the frontend directory:
      cd ../frontend
    • Install dependencies:
      npm install
    • Start the development server:
      npm start
  5. Access the application:

    • Frontend: http://localhost:3000
    • Backend: http://localhost:5000

Folder Structure

uber-project/
  |-- backend/
  |     |-- controllers/
  |     |-- models/
  |     |-- routes/
  |     |-- server.js
  |
  |-- frontend/
  |     |-- src/
  |         |-- pages/
  |         |-- components/
  |         |-- App.js
  |-- README.md

Key Endpoints

Backend

  • User Registration: POST /user/register
  • Driver Registration: POST /driver/register
  • Login: POST /login
  • Ride Booking: POST /rides
  • Real-time Tracking: GET /tracking

Frontend

  • Landing Page
  • User Login and Signup
  • Driver Login and Signup
  • Ride Booking Page
  • Live Tracking Page
  • Payment Page

License

This project is licensed under the MIT License.


Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes.
  4. Submit a pull request.

About

Creating a fully functional uber clone using Mern Stack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages