Skip to content

A real-time roadside assistance platform connecting Walmart delivery drivers for instant help, live tracking, and rewards.

Notifications You must be signed in to change notification settings

JK-77/HelpOnRoute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— HelpOnRoute - Driver Support Platform

Helping each other on the road to ensure on-time deliveries.

Connect with nearby Walmart delivery partners for instant roadside assistance.

TypeScript React Node.js PostgreSQL Socket.io


πŸ“– Overview

HelpOnRoute is a real-time roadside assistance platform designed for Walmart delivery drivers. The platform enables drivers to request help when they encounter issues on the road and allows other nearby drivers to offer assistance. Built with modern web technologies, it features real-time location tracking, instant notifications, and a reward system.

Key Features

  • πŸ” User Authentication - Secure signup and login for drivers
  • πŸ—ΊοΈ Real-time Mapping - Interactive map with Leaflet showing driver locations
  • πŸ“ Location Tracking - Live location updates for active drivers
  • πŸ†˜ Help Request System - Create, accept, and resolve help requests
  • πŸ’¬ Real-time Communication - Instant notifications via Socket.io
  • πŸ† Reward System - Earn coins for helping fellow drivers
  • πŸ“Έ Image Upload - Upload vehicle issue photos (via Cloudinary)
  • πŸš— Driver Profiles - View profile, vehicle details, and help history
  • πŸ”” Status Management - Track driver availability (Available/Busy/Helping)

πŸ› οΈ Tech Stack

Frontend

  • React 19 - Modern UI framework
  • TypeScript - Type-safe development
  • Vite - Fast build tool
  • React Router - Client-side routing
  • Leaflet - Interactive maps
  • Tailwind CSS - Utility-first styling
  • Framer Motion - Smooth animations
  • Axios - HTTP client
  • Socket.io-client - Real-time communication

Backend

  • Node.js - Runtime environment
  • Express 5 - Web framework
  • TypeScript - Type-safe development
  • Prisma - ORM for PostgreSQL
  • PostgreSQL - Relational database
  • Socket.io - Real-time bidirectional communication
  • Cloudinary - Image storage
  • Multer - File upload handling
  • JWT - Authentication

Additional Tools

  • OpenRouteService - Route calculation API
  • @turf/turf - Geospatial calculations

πŸ“ Project Structure

HelpOnRoute-main/
β”œβ”€β”€ client/                 # React frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ Components/     # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/          # Page components
β”‚   β”‚   β”œβ”€β”€ socket/         # Socket.io client setup
β”‚   β”‚   β”œβ”€β”€ model/          # Modal components
β”‚   β”‚   └── App.tsx         # Main app component
β”‚   └── package.json
β”‚
└── server/                 # Node.js backend application
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ controllers/     # Request handlers
    β”‚   β”œβ”€β”€ routes/         # API routes
    β”‚   β”œβ”€β”€ socketHandler/ # Socket.io handlers
    β”‚   β”œβ”€β”€ config/         # Configuration files
    β”‚   └── index.ts        # Server entry point
    β”œβ”€β”€ prisma/
    β”‚   └── schema.prisma   # Database schema
    └── package.json

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • PostgreSQL database
  • npm or yarn

Installation

  1. Clone the repository

    git clone https://github.com/JK-77/HelpOnRoute.git
    cd HelpOnRoute
  2. Install server dependencies

    cd server
    npm install
  3. Install client dependencies

    cd ../client
    npm install
  4. Set up environment variables

    Create a .env file in the server directory:

    DATABASE_URL="postgresql://user:password@localhost:5432/helponroute"
    JWT_SECRET="your-secret-key"
    CLOUDINARY_CLOUD_NAME="your-cloud-name"
    CLOUDINARY_API_KEY="your-api-key"
    CLOUDINARY_API_SECRET="your-api-secret"
  5. Set up the database

    cd server
    npx prisma migrate dev
    npx prisma generate
  6. Run the development servers

    Terminal 1 (Server):

    cd server
    npm run dev

    Server runs on http://localhost:3000

    Terminal 2 (Client):

    cd client
    npm run dev

    Client runs on http://localhost:5173


πŸ“± Usage

For Drivers Requesting Help

  1. Sign up or log in to your account
  2. Navigate to Dashboard
  3. Fill in your issue details and upload a photo (optional)
  4. Your location is automatically tracked
  5. Wait for a nearby driver to accept your request
  6. Accept offers from other drivers
  7. Mark request as resolved when help is complete

For Drivers Offering Help

  1. Log in to your account
  2. Navigate to Help Dashboard
  3. View all pending help requests on the map
  4. Click on any request to see details
  5. Accept a request to start helping
  6. Navigate to the requester's location
  7. Help is marked as resolved when complete
  8. Earn coins for successful help!

πŸ—„οΈ Database Schema

Driver Model

  • Personal information (name, email, phone)
  • Location (latitude, longitude)
  • Status (AVAILABLE, BUSY, HELPING)
  • Profile data (image, vehicle number)
  • Reward system (coins, help count)

HelpRequest Model

  • Requester and helper information
  • Issue description and image
  • Location coordinates
  • Status (PENDING, ACCEPTED, RESOLVED)
  • Timestamps

πŸ”Œ API Endpoints

Authentication

  • POST /api/auth/signup - Register new driver
  • POST /api/auth/signin - Login driver

Drivers

  • GET /api/drivers - Get all drivers
  • PUT /api/driver/:id - Update driver location/status
  • GET /api/driver/:id - Get driver details

Help Requests

  • POST /api/request/create - Create help request
  • GET /api/request/pending - Get all pending requests
  • PUT /api/request/:id/accept - Accept help request
  • PUT /api/request/:id/resolve - Resolve help request

Socket Events

  • send-help-request - Broadcast new help request
  • receive-help-request - Receive help requests
  • accept-help - Accept help request
  • help-accepted - Notification when help is accepted
  • help-resolved - Mark help as resolved

🎨 Features in Detail

Real-time Location Tracking

  • Drivers' locations are continuously updated and broadcasted
  • Visual representation on interactive map
  • Route calculation between requester and helper

Reward System

  • Drivers earn coins for successful help
  • Track help count in profile
  • Gamification encourages community support

Image Upload

  • Upload vehicle issue photos
  • Cloudinary integration for reliable storage
  • Visual aid for helpers to understand the issue

πŸ” Security Features

  • JWT-based authentication
  • Password hashing
  • CORS configuration
  • Input validation
  • Secure file uploads

🚧 Future Enhancements

  • In-app messaging between drivers
  • Push notifications
  • Rating and review system
  • Emergency contact integration
  • Vehicle diagnostics integration
  • Payment gateway for rewards
  • Advanced analytics dashboard
  • Mobile app (React Native)

πŸ“ License

This project is licensed under the MIT License.


πŸ‘₯ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


πŸ“§ Contact

For questions or support, please open an issue on GitHub.


Made with ❀️ for Walmart delivery drivers

Happy Driving! πŸš—πŸ’¨

About

A real-time roadside assistance platform connecting Walmart delivery drivers for instant help, live tracking, and rewards.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages