Skip to content

About

Here is a Full-System for Bus Transport Management for our Local University Transportation "New Bus"

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

91 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🚌 New Bus App

Real-Time University Bus Management System

Live Demo API Docs License

Real-time Database Frontend PWA


A modern real-time bus tracking system built for university campuses
πŸ“ Live GPS Tracking β€’ πŸ”„ Real-time Updates β€’ πŸ“± Cross-platform β€’ 🎯 Role-based Access

πŸš€ Try Live Demo β€’ πŸ“š API Documentation β€’ πŸ› οΈ Setup Guide


πŸ“‹ Table of Contents


🎯 Overview

New Bus App is a comprehensive real-time bus management system designed for university campuses. It enables students to track buses in real-time, drivers to manage trips efficiently, and administrators to oversee the entire transportation network.

The system uses modern web technologies to deliver a seamless experience across all devices, with real-time updates powered by SignalR WebSocket connections.

🎯 Problem Solved

  • 🚌 Real-time Tracking: Students know exactly when their bus will arrive
  • πŸ“± Universal Access: Works on any device with a web browser
  • ⚑ Instant Updates: No more waiting - get live location updates instantly
  • 🎯 Role Management: Different experiences for students, drivers, and admins

✨ Key Features

πŸŽ“ For Students

Feature Description
πŸ“ Live Bus Tracking See real-time bus locations on interactive map
πŸ”” Smart Notifications Get alerts when bus approaches your stop
πŸ“± Mobile Friendly Full PWA support - works like a native app
πŸ—ΊοΈ Route Visualization See complete bus routes and stops

🚐 For Drivers

Feature Description
πŸ—ΊοΈ Trip Management Start/stop trips with live location sharing
πŸ“Š Passenger Tracking See students waiting at stops
πŸ“ GPS Integration Automatic location updates
🎯 Route Guidance Clear route information and stops

πŸ‘¨β€πŸ’Ό For Administrators

Feature Description
🚌 Fleet Management Manage all buses and drivers
πŸ“ˆ Analytics Dashboard Track usage patterns and performance
πŸ‘₯ User Management Control access and permissions
βš™οΈ System Configuration Customize routes, schedules, and settings

πŸ—οΈ System Architecture

πŸ“Š Click to expand architecture diagram
flowchart TB
    subgraph "Client Layer"
        S[πŸŽ“ Student App]
        D[🚐 Driver App]
        A[πŸ‘¨β€πŸ’Ό Admin Panel]
    end
    
    subgraph "API Gateway"
        API[REST API]
        HUB[SignalR Hub]
    end
    
    subgraph "Business Logic"
        AUTH[Authentication Service]
        TRIP[Trip Service]
        LOC[Location Service]
        NOTIFY[Notification Service]
    end
    
    subgraph "Data Layer"
        DB[(SQL Database)]
    end
    
    S -->|HTTP/WebSocket| API
    D -->|HTTP/WebSocket| HUB
    A -->|HTTP| API
    
    API --> AUTH
    HUB --> LOC
    HUB --> NOTIFY
    
    AUTH --> DB
    TRIP --> DB
    LOC --> DB
    NOTIFY --> DB
    
    LOC -.->|Real-time| S
    NOTIFY -.->|Push| D
Loading

Alternative View:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    CLIENT APPLICATIONS                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   Student   β”‚  β”‚   Driver    β”‚  β”‚     Admin       β”‚  β”‚
β”‚  β”‚     Web     β”‚  β”‚     Web     β”‚  β”‚    Dashboard    β”‚  β”‚
β”‚  β”‚   + PWA     β”‚  β”‚   + PWA     β”‚  β”‚                 β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  BACKEND INFRASTRUCTURE                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   REST API  β”‚  β”‚  SignalR    β”‚  β”‚   Auth Service  β”‚  β”‚
β”‚  β”‚             β”‚  β”‚    Hub       β”‚  β”‚   (JWT)         β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                              β”‚                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Trip Logic  β”‚  β”‚ Location    β”‚  β”‚ Notification    β”‚  β”‚
β”‚  β”‚   Service   β”‚  β”‚   Service   β”‚  β”‚    Service      β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    DATA STORAGE                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚
β”‚  β”‚           SQL Server Database          β”‚             β”‚
β”‚  β”‚         (Primary Data Store)          β”‚             β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ›οΈ Architecture Principles

Principle Implementation
πŸ”„ Real-time First SignalR WebSocket for instant updates
πŸ“± Mobile-First PWA with offline capabilities
πŸ” Secure by Design JWT authentication + role-based access
⚑ Scalable Microservices-ready architecture
🎯 User-Centric Role-based interfaces and workflows

πŸ”„ Real-Time Communication

The heart of the system is the SignalR Hub that manages real-time communication between all users.

🌐 Connection Flow

sequenceDiagram
    participant Client as "Client App"
    participant Hub as "SignalR Hub"
    participant Auth as "Auth Service"
    participant DB as "Database"
    participant Users as "Other Users"
    
    Client->>Hub: WebSocket Connection
    Hub->>Auth: Validate JWT Token
    Auth-->>Hub: User Profile (ID, Role)
    
    alt Student Role
        Hub->>DB: Store student connection
        Hub->>Hub: Join "Students" group
    else Driver Role
        Hub->>DB: Store driver connection
        Hub->>Hub: Join "Drivers" group
    else Admin Role
        Hub->>DB: Store admin connection
    end
    
    Hub-->>Client: Connection Ready
    
    Note over Client,Users: Real-time communication begins
    Client->>Hub: Share Location
    Hub->>DB: Update location
    Hub->>Users: Broadcast to relevant group
Loading

πŸ“‘ Message Types

Message Type Direction Purpose
NewLocationFromDriver Driver β†’ Students Live bus location updates
NewLocationFromStudent Student β†’ Drivers Student waiting at stop
ArriveNewStation Driver β†’ Students Bus arrival notification
stoplocationfromstudent Student β†’ Drivers Student left stop
TripStatusUpdate Driver β†’ Admin Trip progress updates

πŸ› οΈ Technology Stack

Layer Technology Purpose
🎨 Frontend JavaScript Vanilla JS + PWA
HTML5 Modern web standards
CSS3 Responsive design
Leaflet Interactive maps
πŸ”§ Backend .NET Web API framework
SignalR Real-time communication
EF Core Database ORM
JWT Authentication
πŸ—„οΈ Database SQL Server Primary data store
πŸš€ Deployment Vercel Frontend hosting

πŸ“Š System Flow

🚌 Complete Trip Lifecycle

flowchart TD
    Start([Trip Start]) --> DriverLogin[Driver Logs In]
    DriverLogin --> StartTrip[Start Trip]
    StartTrip --> ShareLocation[Share Live Location]
    
    ShareLocation --> StudentConnect{Students Connected?}
    StudentConnect -->|Yes| StudentWait[Students See Location]
    StudentConnect -->|No| NoStudents[No Active Students]
    
    StudentWait --> CheckStation{Near Station?}
    NoStudents --> CheckStation
    
    CheckStation -->|Yes| NotifyStudents[Notify Students]
    CheckStation -->|No| ContinueRoute[Continue Route]
    
    NotifyStudents --> StudentBoard[Students Board]
    StudentBoard --> CheckStation
    ContinueRoute --> CheckStation
    
    CheckStation -->|Trip Complete| EndTrip[End Trip]
    EndTrip --> StopLocation[Stop Location Sharing]
    StopLocation --> End([Trip Complete])
Loading

🎯 User Interaction Flow

flowchart LR
    subgraph "Student Journey"
        S1[Login] --> S2[View Map]
        S2 --> S3[Track Bus]
        S3 --> S4[Get Notifications]
        S4 --> S5[Board Bus]
    end
    
    subgraph "Driver Journey"
        D1[Login] --> D2[Start Trip]
        D2 --> D3[Share Location]
        D3 --> D4[Manage Stops]
        D4 --> D5[End Trip]
    end
    
    subgraph "Admin Journey"
        A1[Login] --> A2[View Dashboard]
        A2 --> A3[Manage Fleet]
        A3 --> A4[Monitor Trips]
        A4 --> A5[Generate Reports]
    end
    
    S3 -.->|Real-time| D3
    D4 -.->|Notifications| S4
    D5 -.->|Trip Data| A4
Loading

πŸ‘₯ User Roles

πŸŽ“ Student

Primary Goal: Track buses efficiently

Key Actions:

  • πŸ“ View live bus locations
  • πŸ”” Receive arrival notifications
  • πŸ—ΊοΈ See routes and stops
  • πŸ“± Use on any device

Permissions:

  • βœ… View bus locations
  • βœ… Receive notifications
  • ❌ Manage trips
  • ❌ Access admin data

🚐 Driver

Primary Goal: Manage trips safely

Key Actions:

  • 🚌 Start/stop trips
  • πŸ“ Share live location
  • πŸ‘€ See waiting students
  • πŸ“Š Track trip progress

Permissions:

  • βœ… Manage own trips
  • βœ… Share location
  • βœ… View student locations
  • ❌ Access other drivers

πŸ‘¨β€πŸ’Ό Admin

Primary Goal: Oversee system

Key Actions:

  • 🚌 Manage fleet
  • πŸ‘₯ Control users
  • πŸ“ˆ View analytics
  • βš™οΈ Configure system

Permissions:

  • βœ… Full system access
  • βœ… User management
  • βœ… Analytics access
  • βœ… System configuration

πŸš€ Quick Start

🎯 Try It Now

  1. 🌐 Live Demo: newbus.vercel.app
  2. πŸ“š API Docs: newbus.tryasp.net/swagger

πŸ› οΈ For Developers

# Clone the repository
git clone https://github.com/Yusuf-Hussien/New-Bus-App.git
cd New-Bus-App

# Quick setup (requires .NET 8 + SQL Server)
dotnet restore
dotnet run --project Backend/NewBusProject/NewBusAPI

# Frontend (any HTTP server)
cd Frontend
python -m http.server 5500
# or
npx http-server -p 5500

πŸ“– Detailed Setup: See Documentation/SETUP.md for complete installation guide


πŸ“š Documentation

Document Description
πŸš€ Setup Guide Complete installation & configuration
🚒 Deployment Production deployment options
πŸ§ͺ Testing Testing strategies & guidelines
πŸ“‘ API Reference Interactive API documentation
πŸ”§ Configuration Environment setup & variables

πŸ“· System Screenshots

πŸŽ“ Student Dashboard

Student Dashboard Real-time bus tracking with interactive maps and proximity alerts

🚐 Driver Dashboard

Driver Dashboard Trip management with live location sharing and passenger tracking

πŸ‘¨β€πŸ’Ό Admin Panel

Admin Panel Comprehensive fleet management and system analytics


πŸ‘₯ Team

Role Name
πŸ“Š Business & System Analysis Ahmed Abdelhady
πŸ–ŒοΈ UI/UX & Visual Design Amr Desouki
🎨 Frontend Developer Ahmed Ibrahim
πŸ‘¨β€πŸ’» Backend & Real-Time Features Kareem Ayman
πŸ”§ Backend & DevOps (Team Lead) Yusuf Hussien

University Project β€’ Hurghada University β€’ 2025-2026


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


🚌 Built with ❀️ for smarter campus transportation

Live Demo API

⭐ Star this repo if it helped you!

About

Here is a Full-System for Bus Transport Management for our Local University Transportation "New Bus"

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages