A real-time train ticket availability checking system for Indian Railways that helps users monitor ticket status for future dates.
- Real-time ticket availability checking
- Support for multiple train classes (1A, 2A, 3A, SL, etc.)
- Multiple days availability status
- Detailed train information including:
- Train numbers and names
- Arrival/Departure times
- Distance and duration
- Running days
- Fare breakdown
- Response time tracking
- API call optimization
- Backend:
- Node.js
- Express
- TypeScript
Axiosfor API calls
- Node.js (v18 or higher)
npmoryarn- TypeScript
- Clone the repository:
git clone https://github.com/yourusername/ticket-notify.git
cd ticket-notify- Install dependencies:
npm install- Start the development server:
npm run devThe application will be available at http://localhost:3000
Access train availability by using the following URL pattern:
http://localhost:3000/today/{FROM_STATION_CODE}/{TO_STATION_CODE}Example:
http://localhost:3000/today/BSB/NDLSticket-notify/
├── src/
│ ├── models/ # TypeScript interfaces
│ │ ├── TrainDetails.ts
│ │ └── TrainInterfaces.ts
│ ├── utils/ # Utility functions
│ │ ├── rail-api.ts # API integration
│ │ ├── date.ts # Date handling
│ │ └── sleep.ts # Delay utility
│ ├── server.ts # Express server setup
│ └── index.ts # Application entry point
├── public/ # Static assets
└── tests/ # Test files
The application returns ticket availability information in a structured format:
Train Ticket Status on {DATE} (today + {DAYS} days) 🤩
==============================
🚂 {TRAIN_NUMBER} - {TRAIN_NAME}
📍 {FROM_STATION} -> {TO_STATION}
{CLASS_CODE}
{DATE} -> {AVAILABILITY_STATUS}
npm start- Starts the production servernpm run dev- Starts the development server with hot-reload
- Create relevant interfaces in
src/models/ - Add utility functions in
src/utils/ - Update server routes in
src/server.ts
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to Indian Railways for providing the data
- Special thanks to all contributors
This application is for educational purposes only. Please refer to official IRCTC website for actual bookings.