https://github.com/rtewari056/train-ticket-booking-system
Train Ticket Booking System powered by Vite.js
https://github.com/rtewari056/train-ticket-booking-system
css expressjs html javascript jwt mysql nodejs reactjs vitejs
Last synced: 3 months ago
JSON representation
Train Ticket Booking System powered by Vite.js
- Host: GitHub
- URL: https://github.com/rtewari056/train-ticket-booking-system
- Owner: rtewari056
- Created: 2023-01-24T14:12:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-25T11:31:48.000Z (over 3 years ago)
- Last Synced: 2025-01-30T21:28:58.341Z (over 1 year ago)
- Topics: css, expressjs, html, javascript, jwt, mysql, nodejs, reactjs, vitejs
- Language: JavaScript
- Homepage:
- Size: 411 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 🚀 Screenshots
This application is deployed on DigitalOcean. Please check it out :smile: [here](https://spritle.rohittewari.live).
### Login Page

### Super Admin Registration Page

### Super Admin Dashboard Page

### Profile Page

### Ticket Booking Page

### Agent Registration Page

## 📖 Prerequisites
In order to run the project you need `node>=16`, `npm>=8` and `MySQL>=8.0` installed on your machine.
## 🚩 Getting Started
### 1. Open MySQL Command Line Client and run the below `SQL commands` defined in `/server/src/db/init.sql` file:
```sql
-- Create a database named spritle
CREATE DATABASE IF NOT EXISTS spritle;
-- Use the database to make changes to it
USE spritle;
-- Drop table 'user' if exists
DROP TABLE IF EXISTS user;
-- Create a table named 'user' inside 'spritle' database
CREATE TABLE user (
name VARCHAR(30) NOT NULL,
email VARCHAR(45) NOT NULL,
mobile VARCHAR(20) NOT NULL UNIQUE,
password VARCHAR(100) NOT NULL,
birthday DATE NOT NULL,
address VARCHAR(200) NOT NULL,
profilePic VARCHAR(200) DEFAULT "https://res.cloudinary.com/devcvus7v/image/upload/v1674454463/ticket_booking_system/avatar.png",
ticket_count INT NOT NULL DEFAULT 0,
is_super_admin BOOLEAN DEFAULT 0,
is_verified BOOLEAN DEFAULT 0,
verification_token VARCHAR(50),
PRIMARY KEY (email)
);
```
### 2. Now, open a terminal session in project `root` directory and install dependencies:
```bash
npm install # Server dependencies
cd client
npm install # Client dependencies
```
### 3. Rename `.env.example` into `.env` and put all the creadentials:
```bash
# In the root directory put your creadentials:
# Server configaration
PORT=5000
# Token configaration
ACCESS_TOKEN_PRIVATE_KEY="YOUR_JWT_SECRET"
ACCESS_TOKEN_EXPIRE=60 # In mins
# MySQL configaration
DB_HOST=localhost
DB_USER=
DB_NAME=spritle
DB_PORT=3306
DB_PASSWORD=
DB_CONNECTION_LIMIT=10
# SMTP configaration (Sendinblue Email Service)
SMTP_HOST=
SMTP_PORT=587
SMTP_USER=
SMTP_PASSWORD=
EMAIL_FROM=no-reply@TicketBookingSystem.com # The email address of the sender
# Now go to client folder and put your cloudinary creadentials:
VITE_CLOUDINARY_CLOUD_NAME=
VITE_CLOUDINARY_UPLOAD_PRESET=
```
### 4. Run project:
In the project `root` directory, open two terminal sessions and run both commands separately:
```bash
npm run client
npm run server
```
### 5. Now, open your browser and go to `http://localhost:5173`
## 👤 Developer
[Rohit Tewari](https://github.com/rtewari056)
## 📬 Contact
If you want to contact me, you can reach me through below handles.