Skip to content

Rockstar-Dev-Tamil/TrainTIcketGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Railway Reservation System - Web Application

A modern web-based railway reservation system with a beautiful GUI, implementing core Data Structures and Algorithms concepts using React and Node.js.

Features

User Interface

  • Modern Web GUI: Beautiful, responsive interface built with React
  • Real-time Updates: Live seat availability and booking status
  • Multiple Views: Trains, Booking, My Bookings, and Search tabs
  • Visual Feedback: Success/error messages and loading states

Functionality

  • View Trains: Browse all available trains with routes and fares
  • Book Tickets: Select train, enter passenger details, instant booking
  • Cancel Bookings: Cancel tickets with PNR and automatic refunds
  • Search by PNR: Find booking details quickly
  • Seat Management: Automatic seat allocation and tracking

Data Structures & Algorithms

Backend (Node.js/Express)

  1. Linked List Implementation: Custom LinkedList class for managing bookings
    • BookingNode class with next pointer
    • Insert, delete, find, and traverse operations
  2. Arrays: Train data storage and seat tracking
  3. Linear Search: Train and booking lookup algorithms
  4. Dynamic Memory: Node creation and deletion

Frontend (React)

  • State management with React hooks
  • Component-based architecture
  • Real-time data synchronization

Tech Stack

  • Backend: Node.js, Express.js
  • Frontend: React (Vite), CSS3
  • Data Structures: Custom Linked Lists, Arrays
  • API: RESTful endpoints

API Endpoints

  • GET /api/trains - Get all trains
  • GET /api/bookings - Get all bookings
  • GET /api/bookings/:pnr - Search booking by PNR
  • POST /api/book - Book a ticket
  • DELETE /api/bookings/:pnr - Cancel booking

How to Run

The application runs automatically. Click the "Run" button or use:

npm run dev

This starts both the backend server (port 3000) and frontend (port 5000) concurrently.

Sample Trains

  • 101 - Rajdhani Express (Delhi → Mumbai) - ₹1500
  • 102 - Shatabdi Express (Delhi → Chandigarh) - ₹800
  • 103 - Duronto Express (Kolkata → Delhi) - ₹1200
  • 104 - Garib Rath (Mumbai → Bangalore) - ₹900
  • 105 - Jan Shatabdi (Chennai → Hyderabad) - ₹600

Project Structure

/
├── server.js              # Express backend with DSA implementations
├── client/                # React frontend
│   ├── src/
│   │   ├── App.jsx       # Main React component
│   │   └── App.css       # Styling
│   └── vite.config.js    # Vite configuration
├── package.json          # Dependencies and scripts
└── README.md            # This file

Usage

  1. View Trains: See all available trains with seat availability
  2. Book Ticket: Select a train, fill passenger details, get instant PNR
  3. My Bookings: View all current reservations in a table
  4. Search PNR: Enter PNR to view booking details
  5. Cancel: Click cancel button to remove booking and get refund

The system features proper state management, error handling, and a beautiful user interface!

About

The Railway Reservation System is a web-based app that lets users view trains, check seat availability, book or cancel tickets, and search bookings using a PNR number. It uses DSA concepts like linked lists, arrays, and linear search for efficient data handling, offering a modern UI with real-time seat visualization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors