Skip to content

karamk2k/bus_reservation

Repository files navigation

Bus Reservation System

A web-based bus reservation system built with Laravel 11, jQuery, and AJAX for efficient and interactive user experience.

Features

  • Bus Routes: View available routes with start and end points.
  • Bus Schedules: View bus schedules including departure and arrival times.
  • Search Functionality: Search for trips based on route, bus, or schedule.
  • Real-time Interaction: AJAX requests for fetching data dynamically without page reloads.
  • Admin Panel: Admins can manage routes, buses, and schedules.
  • Ticket Booking: Users can book bus tickets, view bookings, and cancel tickets.
  • Real-time Availability: Dynamic seat availability check via AJAX.
  • User Profile: Users can view and manage their bookings and personal details.

Tech Stack

  • Frontend: HTML, CSS, Tailwind CSS, jQuery, AJAX
  • Backend: Laravel 11.x
  • Database: MySQL or any other preferred relational database
  • Authentication: Laravel's built-in authentication system (for user login, registration, and roles)
  • Email Notifications: Sends booking and cancellation confirmations via email.
  • Event-driven Architecture: Use Laravel events and listeners to handle ticket bookings and cancellations.
  • APIs: You can expand the system by integrating third-party APIs for route or bus data.

Security

  • Sanitization & Validation: Ensure all user input is properly validated and sanitized to prevent SQL injection, cross-site scripting (XSS), and other security vulnerabilities.
  • CSRF Protection: Laravel automatically protects against CSRF attacks. Ensure all form submissions use Laravel's @csrf directive.
  • Authentication: Use Laravel’s built-in authentication for secure user login and registration. Implement user roles such as admin and user for access control.
  • HTTPS: Ensure that your application is deployed with SSL encryption to secure data transmitted between the client and server.
  • Password Hashing: Use Laravel's built-in hashing functions to securely store user passwords in the database.

Setup

Prerequisites

  1. PHP >= 8.1
  2. Composer (for managing PHP dependencies)
  3. Node.js and NPM for asset compilation (CSS/JS minification)
  4. MySQL or any other relational database
  5. Laravel 11.x

Installation

Clone the Repository:

git clone https://github.com/yourusername/bus-reservation-system.git
cd bus-reservation-system

Install PHP Dependencies

composer install

Install NPM Dependencies:

npm install

Configure the Environment:

Copy .env.example to .env and configure your database and other environment variables:

cp .env.example .env
php artisan key:generate

Set up your MySQL database in the .env file:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=bus_reservation
DB_USERNAME=root
DB_PASSWORD=

Migrate the Database:

Run the migrations to set up the required tables:

php artisan migrate

Compile Assets:

To compile your CSS and JavaScript, run:

npm run dev

Run the Server

To start the Laravel development server, run the following command:

php artisan serve

Open the app in your browser at http://127.0.0.1:8000.

About

A web-based bus reservation system built with Laravel 11, jQuery, and AJAX for an efficient and interactive user experience

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages