Skip to content

About

Precision IRCTC booking calculator engineered with React, Tailwind, and Zustand. Includes automated serverless notifications and local-first logic.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

GitHub repo size GitHub stars GitHub forks

Twitter Follow LinkedIn



Date2Book Logo

Date2Book - IRCTC Booking Window Calculator

Date2Book is an intelligent web application that helps Indian railway passengers never miss their train ticket booking windows. Built with React and Vite, it automatically calculates when IRCTC booking opens (60 days in advance) and provides seamless calendar integration and email reminders via Resend, ensuring you book your tickets on time, every time.

➥ Live Demo


Date2Book Demo Screenshot

Calculator Interface Results Page Calendar Integration Dark Mode About Page

Table of Contents

Prerequisites:

Before setting up Date2Book, ensure you have the following installed and configured:

Technologies and Services Utilized:

  • Build Tool: Vite Vite 5
  • UI Library: React.js React 18
  • Programming Language: JavaScript JavaScript (ES6+)
  • Styling: Tailwind Tailwind CSS 3
  • State Management: Zustand Zustand
  • Icons: Lucide Lucide React
  • Email Service: Resend Resend

Features:

  • 📅 Accurate Booking Calculation: Automatically calculates booking open date 60 days before journey date (excluding DOJ).
  • 🌓 Dark/Light Mode: Beautiful Maybach-inspired themes with smooth transitions.
  • 📧 Email Reminders: Get notified 24 hours before booking opens via Resend integration.
  • 🗓 Calendar Integration: Seamlessly add reminders to your preferred calendar application (Google/Apple/Outlook).
  • 📱 Responsive Design: Fully optimized for mobile, tablet, and desktop devices.
  • ⚡ Instant Results: Real-time calculation without page reloads.

Run Locally:

To run Date2Book on your local machine, follow the steps below:

  1. Clone the Repository:

    git clone https://github.com/RanitDERIA/irctc-date2book.git
  2. Install Dependencies:

    npm install
    

    or

    pnpm install
    
  3. Environment Setup: Create a .env file in the root directory and add your Resend configuration:

    # Resend API Configuration
    VITE_RESEND_API_KEY="re_your_api_key_here"
    
  4. Start the Development Server:

    npm run dev
    
  5. Open Your Browser: Navigate to http://localhost:5173 to see the application running.

Deployment:

The application is optimized for deployment on Vercel, but can be deployed to any platform that supports Node.js.

Deploy to Vercel:

  1. Push your code to a GitHub repository.
  2. Connect your repository to Vercel.
  3. Configure the VITE_RESEND_API_KEY environment variable in the Vercel project dashboard.
  4. Deploy! Vercel will automatically build and deploy your application.

Project Structure:

irctc-date2book/
├── api/                        # Serverless / API functions
│   └── sendReminder.js
├── public/                     # Static assets (manifests, favicons)
├── README-images/              # Images used in documentation
├── src/                        # Source code
│   ├── assets/                 # Images and icons
│   ├── components/             # Reusable React components
│   │   ├── layout/             # Header, Footer, Layout wrappers
│   │   │   ├── Footer.jsx
│   │   │   └── Navbar.jsx
│   │   ├── sections/           # Page sections / feature components
│   │   │   ├── CalculatorCard.jsx
│   │   │   ├── CalendarIntegration.jsx
│   │   │   ├── EmailReminder.jsx
│   │   │   ├── HeroSection.jsx
│   │   │   └── ResultDisplay.jsx
│   │   └── ui/                 # Base UI elements (Buttons, Cards)
│   │       ├── CalendarButton.jsx
│   │       ├── InfoCard.jsx
│   │       └── ThemeToggle.jsx
│   ├── pages/                  # Top-level route pages
│   │   ├── AboutPage.jsx
│   │   ├── HomePage.jsx
│   │   └── ResultPage.jsx
│   ├── store/                  # Zustand state store
│   │   └── useStore.js
│   ├── styles/                 # Global styles & animations
│   │   ├── animations.css
│   │   └── index.css
│   ├── utils/                  # Utilities & helper functions
│   │   ├── calendarLinks.js
│   │   ├── dateCalculations.js # Core calculation logic
│   │   └── icsGenerator.js
│   ├── App.jsx                 # Main application component
│   └── main.jsx                # Application entry point
├── index.html                  # HTML entry point
├── tailwind.config.js          # Tailwind CSS configuration
├── vite.config.js              # Vite configuration
├── postcss.config.js           # PostCSS configuration
├── vercel.json                 # Vercel deployment config
└── package.json                # Dependencies and scripts

How It Works:

  1. Select Journey Date: User inputs their planned date of travel.
  2. Calculation: The app subtracts 60 days from the journey date (standard IRCTC advance reservation period).
  3. Display: Shows the exact date and time (usually 8:00 AM IST) when booking opens.
  4. Action: User can set a Google Calendar reminder or request an email notification via Resend.

Sample Calculation:

Scenario: You want to travel on December 25th.
Input (Journey Date): 25th December
Algorithm: 25 Dec − 60 days
Result: 26th October @ 8:00 AM IST

License:

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

Contact:

If you want to get in touch or have any questions regarding this project, feel free to reach out:

📧 Email: bytebardderia@gmail.com 💼 LinkedIn: Ranit Deria

🐦 Twitter: @DeriaRanit 💻 GitHub: @RanitDERIA

For any inquiries, suggestions, or bug reports, you can also:

  • 🐛 Open an issue on GitHub
  • 💬 Start a discussion in the repository
  • 📩 Send a direct message via social media

⭐ Star this repository if you find it helpful!

Made with ❤️ by Ranit Deria

About

Precision IRCTC booking calculator engineered with React, Tailwind, and Zustand. Includes automated serverless notifications and local-first logic.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages