Skip to content

RenXenoverse11/roadsidehero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ง Roadside Hero - Emergency Roadside Assistance App

Overview

Roadside Hero is a comprehensive emergency roadside assistance application that connects users with nearby service providers for towing, flat tire repair, battery jump start, fuel delivery, and lockout services.

Features โœจ

User Features

  • ๐Ÿ” User Authentication (Login/Register)
  • ๐Ÿ“ Live Location Tracking
  • ๐Ÿš— Service Request Forms
    • Towing (10-15 mins)
    • Flat Tire Repair (8 mins)
    • Battery Jump Start (5-10 mins)
    • Fuel Delivery (10-20 mins)
    • Lockout Service (15-20 mins)
  • ๐Ÿ“ Real-time Request Tracking
  • ๐Ÿ‘จโ€๐Ÿ’ผ Nearby Providers Discovery
  • โญ Provider Ratings & Reviews
  • ๐Ÿ“‹ Request History
  • ๐Ÿ‘ค User Profile Management

Provider Features (Ready for expansion)

  • Provider Dashboard
  • Status Management
  • Request Acceptance System
  • Real-time Tracking Updates

Tech Stack

  • Backend: PHP 7.4+
  • Database: MySQL
  • Frontend: HTML5, CSS3, Bootstrap 5.3
  • Icons: Bootstrap Icons
  • Server: XAMPP (Apache + MySQL)

Installation & Setup

Prerequisites

  • XAMPP installed and running
  • MySQL running on localhost
  • PHP 7.4 or higher

Step-by-Step Installation

  1. Extract the project to XAMPP

    C:\xampp\htdocs\roadside_hero\
    
  2. Create the Database

    • Open phpMyAdmin: http://localhost/phpmyadmin
    • Import setup.sql file:
      • Create a new database named roadside_hero
      • Go to Import tab
      • Select setup.sql and click Import

    OR run via MySQL command line:

    mysql -u root -p < setup.sql
  3. Access the Application

    • Open browser and go to: http://localhost/roadside_hero
    • You'll be redirected to login page
    • Click "Sign Up" to create an account

Test Credentials

Sample User: (Create your own via signup)

  • Email: user@demo.com
  • Password: password123

Sample Providers (in database):

  • Joe's Auto Repair
  • Rapid Towing Co.
  • Quick Fix Services

File Structure

roadside_hero/
โ”œโ”€โ”€ index.php                 # Redirect to login/dashboard
โ”œโ”€โ”€ login.php                 # User login page
โ”œโ”€โ”€ register.php              # User registration
โ”œโ”€โ”€ config.php                # Database config & session management
โ”œโ”€โ”€ dashboard.php             # Main dashboard (after login)
โ”œโ”€โ”€ request_service.php       # Service request form
โ”œโ”€โ”€ tracking_request.php      # Real-time request tracking
โ”œโ”€โ”€ my_requests.php           # User request history
โ”œโ”€โ”€ profile.php               # User profile & settings
โ”œโ”€โ”€ providers.php             # Browse nearby providers
โ”œโ”€โ”€ logout.php                # Logout & session destroy
โ”œโ”€โ”€ db_connect.php            # Deprecated (use config.php)
โ”œโ”€โ”€ setup.sql                 # Database schema & sample data
โ””โ”€โ”€ README.md                 # This file

Database Schema

Users Table

  • id, fullname, email, password_hash, phone, latitude, longitude, location_name, created_at

Service Requests Table

  • id, user_id, service_id, provider_id, vehicle_type, problem_description, photo_url, current_latitude, current_longitude, location_address, status, estimated_arrival, created_at, updated_at

Providers Table

  • id, business_name, service_type, email, password_hash, phone, latitude, longitude, rating, reviews, status, created_at

Services Table

  • id, service_name, service_icon, estimated_time

Request Tracking Table

  • id, request_id, provider_latitude, provider_longitude, status_message, created_at

Usage Guide

For Users:

  1. Register/Login

    • Create account with email and password
    • Login to access dashboard
  2. Request Service

    • Click service button on dashboard (Towing, Flat Tire, etc.)
    • Fill in vehicle problem description
    • Select vehicle type (Sedan, SUV, Motorcycle)
    • Optionally upload issue photo
    • Submit request
  3. Track Request

    • View real-time location of provider
    • See ETA and distance
    • Call provider directly
    • View request details
  4. View History

    • Click "My Requests" to see all past requests
    • View request status and details
    • Click to track completed requests
  5. Browse Providers

    • Click "See All" on dashboard or go to providers page
    • View provider ratings and reviews
    • Filter by service type
    • Call or book directly

For Developers:

Adding New Services

Edit setup.sql to add more services:

INSERT INTO services (service_name, service_icon, estimated_time) VALUES
('Your Service', 'icon-name', 'X-Y MIN');

Adding New Providers

INSERT INTO providers (business_name, service_type, email, password_hash, phone, latitude, longitude, rating, reviews, status) VALUES
('Provider Name', 'Service Type', 'email@provider.com', '$2y$10$hash', 'phone', lat, long, rating, reviews, 'available');

Session Management

All protected pages use requireLogin() function:

<?php
include 'config.php';
requireLogin();  // Redirects to login if not logged in
$user = getCurrentUser($conn);
?>

Security Features

โœ… Password Hashing (PASSWORD_DEFAULT) โœ… Prepared Statements (SQL Injection Prevention) โœ… Session Management โœ… Input Validation โœ… CORS-ready headers

Future Enhancements

  • ๐Ÿ—บ๏ธ Real Google Maps Integration
  • ๐Ÿ’ณ Payment Gateway Integration
  • ๐Ÿ“ฑ Mobile App Version
  • ๐Ÿ‘ฎ Provider Authentication System
  • โญ Review/Rating System
  • ๐Ÿ”” Push Notifications
  • ๐Ÿ’ฌ In-app Chat
  • ๐Ÿ“Š Analytics Dashboard
  • ๐Ÿค– AI-based Provider Matching
  • ๐Ÿ“ธ Photo Upload to Cloud Storage

Troubleshooting

Database Connection Error

  • Ensure MySQL is running
  • Check database credentials in config.php
  • Verify database roadside_hero exists

Login Not Working

  • Clear browser cookies
  • Check email and password
  • Ensure user was registered successfully

Services Not Showing

  • Run setup.sql to populate sample data
  • Check services table in database

Map Not Displaying

  • Placeholder maps are used for demo
  • Will need Google Maps API key for production

API Endpoints (Ready for expansion)

  • POST /api/register - User registration
  • POST /api/login - User login
  • POST /api/request-service - Submit service request
  • GET /api/tracking/{id} - Get request tracking data
  • GET /api/providers - Get nearby providers

Performance Considerations

  • Database indexes on frequently queried fields
  • Session-based caching for user data
  • Prepared statements for query efficiency
  • Auto-refresh on tracking page (5 seconds)

Support & Contact

For issues or questions, please contact:

License

Copyright ยฉ 2026 Roadside Hero. All rights reserved.


Developed with โค๏ธ for safe and efficient emergency roadside assistance

๐Ÿš— Emergency Roadside Assistance - Available 24/7

About

On-demand roadside assistance web app with real-time map tracking, service requests, and nearby provider matching.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages