https://github.com/adityaparida21/railway_booking
The Railway Booking System is a full-stack web app for booking railway tickets. It features real-time train search, seat availability, user authentication, and booking confirmation. Built with React, Express, and MySQL, it provides a seamless ticket booking experience.
https://github.com/adityaparida21/railway_booking
mysql-database nodejs railway-app react vitejs
Last synced: about 1 month ago
JSON representation
The Railway Booking System is a full-stack web app for booking railway tickets. It features real-time train search, seat availability, user authentication, and booking confirmation. Built with React, Express, and MySQL, it provides a seamless ticket booking experience.
- Host: GitHub
- URL: https://github.com/adityaparida21/railway_booking
- Owner: adityaparida21
- License: mit
- Created: 2024-11-09T14:58:02.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-11-13T02:26:47.000Z (11 months ago)
- Last Synced: 2025-03-01T14:42:56.681Z (8 months ago)
- Topics: mysql-database, nodejs, railway-app, react, vitejs
- Language: JavaScript
- Homepage: https://railway-booking.netlify.app/
- Size: 475 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Railway Booking System ๐
A full-stack web application for booking railway tickets with real-time seat availability tracking and user management. The project uses React for the frontend, Express.js for the backend, and MySQL for the database.
## ๐ Live Demo
- Live Web-App: [Railway Booking App](https://railway-booking.netlify.app/)
## โจ Features- ๐ User authentication (Register/Login)
- ๐ซ Real-time train search
- ๐บ Seat availability checking
- ๐๏ธ Multiple coach types (Sleeper, AC1, AC2, AC3, etc.)
- ๐ฑ Responsive design
- ๐ซ Ticket booking and confirmation
- ๐ฅ User profile management
- ๐งพ Transaction History## ๐ ๏ธ Tech Stack
### Frontend
- React.js
- Vite
- CSS3
- JavaScript (ES6+)
- Axios for API calls### Backend
- Node.js
- Express.js
- MySQL2
- CORS
- Dotenv### Database
- MySQL## ๐ Deployment
### Frontend (Netlify)
1. Connected to GitHub repository
2. Build settings:
- Base directory: `frontend`
- Build command: `npm run build`
- Publish directory: `dist`
3. Environment variables set in Netlify dashboard### Backend (Railway)
1. Deployed using Railway platform
2. Auto-deploys enabled with GitHub integration
3. Environment variables configured in Railway dashboard### Database (FreeSQLDatabase)
- Hosted on FreeSQLDatabase platform
- Connection details securely stored in backend environment variables## ๐ป Local Development Setup
### Prerequisites
- Node.js (v14 or higher)
- npm or yarn
- MySQL### Frontend Setup
```bash
# Navigate to frontend directory
cd frontend# Install dependencies
npm install# Create .env file
cp .env.example .env# Start development server
npm run dev
```### Backend Setup
```bash
# Navigate to backend directory
cd backend# Install dependencies
npm install# Create .env file
cp .env.example .env# Start server
npm run dev
```### Environment Variables
#### Frontend (.env)
```env
VITE_API_URL=your_backend_url
```#### Backend (.env)
```env
DB_HOST=your_db_host
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=your_db_name
DB_PORT=your_db_port
PORT=5000
```## ๐ API Endpoints
### Authentication
- POST `/register` - Register new user
- POST `/login` - User login### Trains
- POST `/form` - Search trains
- GET `/search` - Get available trains### Transactions
- POST `/transaction` - Get user's booking history
- GET `/get_booking` - Get latest booking details## ๐ Database Schema
### Tables
1. `customers` - User information
2. `train` - Train details
3. `coaches` - Coach availability
4. `berth` - Berth allocation
5. `transaction` - Booking history tracking### Database Setup
You can use the `railway_schema.sql` file located in the repository to create the necessary tables and insert data into your local or online MySQL database. Simply execute the SQL script in your database management tool (e.g., MySQL Workbench, phpMyAdmin, or via the command line) to set up the required schema and populate the data.
## ๐ค Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐จโ๐ป Authors
- Aditya Parida - [GitHub Profile](https://github.com/adityaparida21)
## ๐ Acknowledgments
- Thanks to Netlify for hosting the frontend
- Thanks to Railway for hosting the backend
- Thanks to FreeSQLDatabase for providing the database hosting