A modern web-based railway reservation system with a beautiful GUI, implementing core Data Structures and Algorithms concepts using React and Node.js.
- 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
- 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
- Linked List Implementation: Custom
LinkedListclass for managing bookingsBookingNodeclass with next pointer- Insert, delete, find, and traverse operations
- Arrays: Train data storage and seat tracking
- Linear Search: Train and booking lookup algorithms
- Dynamic Memory: Node creation and deletion
- State management with React hooks
- Component-based architecture
- Real-time data synchronization
- Backend: Node.js, Express.js
- Frontend: React (Vite), CSS3
- Data Structures: Custom Linked Lists, Arrays
- API: RESTful endpoints
GET /api/trains- Get all trainsGET /api/bookings- Get all bookingsGET /api/bookings/:pnr- Search booking by PNRPOST /api/book- Book a ticketDELETE /api/bookings/:pnr- Cancel booking
The application runs automatically. Click the "Run" button or use:
npm run devThis starts both the backend server (port 3000) and frontend (port 5000) concurrently.
- 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
/
├── 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
- View Trains: See all available trains with seat availability
- Book Ticket: Select a train, fill passenger details, get instant PNR
- My Bookings: View all current reservations in a table
- Search PNR: Enter PNR to view booking details
- Cancel: Click cancel button to remove booking and get refund
The system features proper state management, error handling, and a beautiful user interface!