Skip to content

akiibot/OneTap-Bus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OneTap Bus Logo

🚌 OneTap Bus

Your one-tap solution to find buses in Dhaka
A modern, full-featured bus route finder, fare calculator, and seat reservation platform built for daily commuters in Dhaka city.


πŸ“– About

OneTap Bus is a simple and reliable bus search and fare information platform designed for daily commuters in Dhaka, Bangladesh. It helps users quickly find available bus routes, bus names, and estimated fares between two locations β€” without any confusion.

Built with local routes and real commuting needs in mind, OneTap Bus aims to make public transport information easier to access, faster to understand, and practical for everyday travel across Dhaka.


✨ Features

πŸ” Route Search & Fare Calculation

  • Search buses by source and destination stops
  • Dynamic fare calculation based on distance between stops
  • Student fare discount option for eligible passengers
  • View the full route with all intermediate stops

🚌 Bus Profiles

  • Detailed bus profile pages with image gallery
  • Bus type badges (AC / Non-AC)
  • Company information and route visualization
  • Interactive route map powered by Leaflet.js with OpenStreetMap tiles

🎟️ Seat Reservation System

  • Visual seat layout with real-time availability
  • Interactive seat selection (Available β†’ Selected β†’ Booked)
  • Date-based booking to prevent double reservations
  • Driver seat indicator for realistic bus layout

πŸ’³ Payment Gateway (Simulated)

  • Credit/Debit Card payment form
  • Mobile Banking support (bKash, Nagad)
  • Animated payment processing with loading spinner
  • Secure booking confirmation flow

🎫 E-Ticket Generation

  • Digital e-ticket with full journey details
  • QR code for ticket verification
  • PDF download powered by html2pdf.js
  • Passenger name, seat numbers, travel date, and route info

⭐ Ratings & Reviews

  • Star rating system (1–5 stars)
  • Written reviews with user attribution
  • Average rating display on bus profiles
  • Admin moderation (comment visibility toggle & deletion)

πŸ‘€ User Authentication

  • User registration with role-based access (Passenger / Admin)
  • Secure admin registration with authentication key
  • Session-based login/logout
  • Profile management with avatar upload

πŸ›‘οΈ Admin Panel

  • Manage buses and routes
  • View and moderate user reviews
  • Toggle comment visibility
  • Delete inappropriate comments

🌐 Bilingual Support

  • Full English and বাংলা (Bengali) language support
  • Session-based language switching
  • All UI strings internationalized via lang.php

πŸ“± Responsive Design

  • Mobile-friendly layout with CSS media queries
  • Dark-themed modern UI with glassmorphism effects
  • Parallax hero sections with mouse-tracking animations
  • Smooth scrolling and micro-interactions

πŸ› οΈ Tech Stack

Layer Technology
Frontend HTML5, CSS3, Vanilla JavaScript
Backend PHP 8.x
Database MySQL / MariaDB
Maps Leaflet.js + OpenStreetMap
PDF Generation html2pdf.js
QR Codes QR Server API
Server Apache (XAMPP)

πŸ—„οΈ Database Schema

The application uses a relational MySQL database (bus_fare) with the following tables:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    users     β”‚     β”‚     bus      β”‚     β”‚ bus_company   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ id (PK)      β”‚     β”‚ bus_id (PK)  │────▢│ company_id   β”‚
β”‚ name         β”‚     β”‚ name         β”‚     β”‚ name         β”‚
β”‚ email        β”‚     β”‚ type (ac/..) β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ password     β”‚     β”‚ company_id   β”‚
β”‚ role         β”‚     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚
       β”‚              β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚              β”‚    route     β”‚
       β”‚              β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
       β”‚              β”‚ route_id(PK) β”‚
       β”‚              β”‚ bus_id (FK)  β”‚
       β”‚              β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                     β”‚
       β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚              β”‚ route_stop   │────▢│    stop      β”‚
       β”‚              β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
       β”‚              β”‚ route_id(FK) β”‚     β”‚ stop_id (PK) β”‚
       β”‚              β”‚ stop_id (FK) β”‚     β”‚ stop_name    β”‚
       β”‚              β”‚ stop_order   β”‚     β”‚ latitude     β”‚
       β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚ longitude    β”‚
       β”‚                                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
  β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚  bookings    β”‚     β”‚ bus_rating   β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ id (PK)      β”‚     β”‚ id (PK)      β”‚
  β”‚ user_id (FK) β”‚     β”‚ user_id (FK) β”‚
  β”‚ bus_id (FK)  β”‚     β”‚ bus_id (FK)  β”‚
  β”‚ seat_number  β”‚     β”‚ rating       β”‚
  β”‚ booking_date β”‚     β”‚ comment      β”‚
  β”‚ source_id    β”‚     β”‚ created_at   β”‚
  β”‚ dest_id      β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ fare_policy  β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ id (PK)      β”‚
  β”‚ base_fare    β”‚
  β”‚ per_stop     β”‚
  β”‚ student_disc β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Getting Started

Prerequisites

  • XAMPP (Apache + MySQL + PHP)
  • PHP 8.0 or higher
  • MySQL / MariaDB
  • A modern web browser

Installation

  1. Clone the repository

    git clone https://github.com/akiibot/OneTap-Bus.git
  2. Move to your web server directory

    # Move or clone directly into htdocs
    mv OneTap-Bus /path/to/xampp/htdocs/OneTap-Bus
  3. Create the database

    CREATE DATABASE bus_fare CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  4. Import the schema

    mysql -u root -p bus_fare < schema_dump.sql
  5. Configure database connection
    Edit db.php if your MySQL credentials differ from the defaults:

    define('DB_HOST', 'localhost');
    define('DB_USER', 'root');
    define('DB_PASS', '');
    define('DB_NAME', 'bus_fare');
  6. Start XAMPP (Apache + MySQL)

  7. Visit the app

    http://localhost/OneTap-Bus/
    

πŸ“ Project Structure

OneTap-Bus/
β”œβ”€β”€ admin/                  # Admin panel pages
β”‚   β”œβ”€β”€ buses.php           # Bus management
β”‚   β”œβ”€β”€ dashboard.php       # Admin dashboard
β”‚   β”œβ”€β”€ header.php          # Admin header/nav
β”‚   └── routes.php          # Route management
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ buses/              # Bus images (per bus ID)
β”‚   β”œβ”€β”€ images/             # Site images (hero, team, icons)
β”‚   └── default-avatar.png  # Default user avatar
β”œβ”€β”€ db.php                  # Database connection config
β”œβ”€β”€ lang.php                # Bilingual language strings (EN/BN)
β”œβ”€β”€ header.php              # Global header & navigation
β”œβ”€β”€ footer.php              # Global footer
β”œβ”€β”€ index.php               # Homepage (search + bus list)
β”œβ”€β”€ result.php              # Search results page
β”œβ”€β”€ bus.php                 # Bus profile (gallery, map, seats, reviews)
β”œβ”€β”€ payment.php             # Payment gateway (card + mobile banking)
β”œβ”€β”€ book_seat.php           # Booking API endpoint
β”œβ”€β”€ ticket.php              # E-ticket display + PDF download
β”œβ”€β”€ my_bookings.php         # User booking history
β”œβ”€β”€ signin.php              # Login page
β”œβ”€β”€ sign-up.php             # Registration page
β”œβ”€β”€ about.php               # About page with team section
β”œβ”€β”€ rate_bus.php             # Review submission handler
β”œβ”€β”€ fetch_seats.php          # Seat availability API
β”œβ”€β”€ schema_dump.sql          # Full database schema
β”œβ”€β”€ style.css               # Main stylesheet
β”œβ”€β”€ auth.css                # Authentication pages styles
└── parallax.js             # Parallax effect script

πŸ‘₯ Team

Member Role
Yeanul Haque Khan Akib Developer
Sumaiya Islam Aritra Developer
Tahmid Islam Developer

πŸ“„ License

This project is open source and available under the MIT License.


Made with ❀️ for the commuters of Dhaka πŸ‡§πŸ‡©

About

🚌 OneTap Bus - A modern bus route finder, fare calculator & seat reservation platform for Dhaka commuters. PHP, MySQL, Leaflet.js.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors