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.
- Prerequisites
- Technologies Utilized
- Features
- Run Locally
- Deployment
- Configuration
- Project Structure
- How It Works
- Sample Calculation
- License
- Contact
Before setting up Date2Book, ensure you have the following installed and configured:
- Node.js (v18.x or later)
- npm or pnpm (package manager)
- Git (for version control)
- Resend Account (for email reminder functionality)
- Build Tool:
Vite 5
- UI Library:
React 18
- Programming Language:
JavaScript (ES6+)
- Styling:
Tailwind CSS 3
- State Management:
Zustand - Icons:
Lucide React
- Email Service:
Resend
- 📅 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.
To run Date2Book on your local machine, follow the steps below:
-
Clone the Repository:
git clone https://github.com/RanitDERIA/irctc-date2book.git
-
Install Dependencies:
npm installor
pnpm install -
Environment Setup: Create a
.envfile in the root directory and add your Resend configuration:# Resend API Configuration VITE_RESEND_API_KEY="re_your_api_key_here" -
Start the Development Server:
npm run dev -
Open Your Browser: Navigate to http://localhost:5173 to see the application running.
The application is optimized for deployment on Vercel, but can be deployed to any platform that supports Node.js.
Deploy to Vercel:
- Push your code to a GitHub repository.
- Connect your repository to Vercel.
- Configure the
VITE_RESEND_API_KEYenvironment variable in the Vercel project dashboard. - Deploy! Vercel will automatically build and deploy your application.
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
- Select Journey Date: User inputs their planned date of travel.
- Calculation: The app subtracts
60 daysfrom the journey date (standard IRCTC advance reservation period). - Display: Shows the exact date and time (usually
8:00 AM IST) when booking opens. - Action: User can set a Google Calendar reminder or request an email notification via
Resend.
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
This project is licensed under the MIT License - see the LICENSE file for details.
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





