Skip to content

Shivamy45/Public-Transport

Repository files navigation

Public Transport Management System (TransitGo)

Project Rationale and Executive Summary

TransitGo represents a cutting-edge, centralized platform designed to revolutionize the public transport experience. Developed with the latest web technologies, including Next.js 15.5 and React 19, this system bridges the information gap between transit operators and passengers. It provides a real-time, interactive interface for tracking bus fleets, optimizing commute planning, and managing transit operations with unprecedented efficiency.

The primary objective of this initiative was to engineer a high-performance, scalable web application that leverages reactive geospatial data visualization to solve the complex logistical challenge of real-time urban mobility.


Core Functional Components

This platform integrates several sophisticated functionalities to deliver a seamless user experience:

  • Real-Time Geolocation Tracking
    Leveraging Mapbox GL and Firebase Firestore, the system renders the live position of transit vehicles with sub-second latency. This allows passengers to visualize bus movements on an interactive map in real-time, significantly reducing wait-time uncertainty.

  • Dynamic Route Visualization
    The application utilizes the Mapbox Directions API to project precise route paths and estimated arrival times (ETAs). This component dynamically adjusts to traffic conditions (where supported) and route deviations, ensuring accurate information delivery.

  • Reactive User Interface
    Built on React 19 and Tailwind CSS 4, the frontend ensures a fluid, responsive experience across all devices. The interface employs advanced state management to handle high-frequency data updates without compromising render performance.

  • Role-Based Access Control
    Secure authentication via Firebase Auth segregates functionality between administrators (fleet management) and passengers (view-only access), ensuring data integrity and operational security.


System Architecture Diagram

The system adopts a modern serverless-first architecture, utilizing Next.js for the frontend and API layer, coupled with Firebase for backend services and Mapbox for geospatial intelligence.

+-------------------------------------------------------+
|                   Client Side (Browser)               |
| +---------------------------------------------------+ |
| |                  Next.js Framework                | |
| | (React 19 / Tailwind CSS 4 / Framer Motion)       | |
| +-------------------------+-------------------------+ |
|            ^              |             ^             |
|            | Real-time    |             | Map Tiles   |
|            | Listener     |             | & Routes    |
|            v              v             v             |
+-------------------+  +---------------+  +-------------+
|    Firebase       |  | Next.js API   |  |   Mapbox    |
| - Firestore DB    |  | (Serverless)  |  |     API     |
| - Authentication  |  +---------------+  +-------------+
+-------------------+

🛠️ Technology Stack

💻 Core Framework & Language

  • Next.js App Router Architecture
  • React Server & Client Components
  • JavaScript

🎨 Styling & UI

  • Tailwind CSS Utility-First Styling
  • Framer Motion Fluid Transitions
  • Lucide React

🌍 Geospatial & Backend

  • Mapbox Interactive Maps
  • Firebase Real-time Database

🔧 Build & Tooling

  • Turbopack
  • ESLint

Build and Deployment Instructions

Prerequisites

  • Node.js (v18+ recommended)
  • NPM or Yarn
  • Firebase Project Credentials
  • Mapbox Public Access Token

1. Environment Configuration

Create a .env.local file in the root directory and populate it with your secure credentials:

# Mapbox Configuration
NEXT_PUBLIC_MAPBOX_TOKEN=pk.eyJ1...

# Firebase Configuration
NEXT_PUBLIC_FIREBASE_API_KEY=AIza...
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-app.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-app-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-app.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=123...
NEXT_PUBLIC_FIREBASE_APP_ID=1:123...

2. Installation & Development

Install Dependencies

Execute the following command to install all required packages:

npm install
# or
yarn install

Run Development Server

Start the high-performance local development server using Turbopack:

npm run dev

Access the application at: http://localhost:3000


3. Production Build

To generate an optimized production build:

npm run build

To start the production server:

npm start

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors