This is a full-stack web application designed for managing bike service bookings. The application includes functionalities for users to book services and for admins to manage bookings.
- Installation
- Database Configuration
- Database Schema
- Sample Data
- Usage
- Features
- Technologies Used
- Best Practices
- License
Before you begin, ensure you have met the following requirements:
- You have installed the latest version of Node.js and npm.
- You have a running MySQL database instance.
git clone https://github.com/yourusername/bike-service-web-app.git
cd bike-service-web-appcd Backend
npm installDB_HOST=your_host
DB_USER=your_username_in_tidb
DB_PASSWORD=your_password
DB_NAME=your_db_name_in_tidbcloud.com
DB_PORT=4000
npm run devStartEnter into your sql editor in https://tidbcloud.com and there create a cluster you will get credentials enter this in .env files
bookings:
CREATE TABLE Bookings (
bookingId CHAR(36) NOT NULL PRIMARY KEY,
userId CHAR(36) NOT NULL,
bookedDate DATE NOT NULL,
state VARCHAR(50) NOT NULL,
vehicleNo VARCHAR(50) NOT NULL,
vehicleModel VARCHAR(50) NOT NULL
);users:
CREATE TABLE Users (
userId CHAR(36) NOT NULL PRIMARY KEY,
userName VARCHAR(255) NOT NULL UNIQUE,
userPassword VARCHAR(255) NOT NULL,
userMobile VARCHAR(255) NOT NULL,
displayName VARCHAR(255) NOT NULL,
doorNo VARCHAR(20) NOT NULL,
street VARCHAR(255) NOT NULL,
city VARCHAR(255) NOT NULL,
state VARCHAR(255) NOT NULL,
postalCode CHAR(6) NOT NULL,
userRole VARCHAR(20) DEFAULT 'Customer'
);services:
CREATE TABLE Services (
servId CHAR(36) NOT NULL PRIMARY KEY,
servName VARCHAR(255) NOT NULL,
fee DECIMAL(10,2) NOT NULL,
timeTaken VARCHAR(255) NOT NULL,
description TEXT,
createdTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updateTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
category VARCHAR(255) DEFAULT 'General'
);bookings_services:
CREATE TABLE BookingServices (
bookingId CHAR(36) NOT NULL,
serviceId CHAR(36) NOT NULL,
PRIMARY KEY (bookingId, serviceId)
);###sample date
users:
userPassword userMobile displayName doorNo street city state postalCode userRole
$2b$10$BzSzQ8SDV1lKTWR3do7IieQzIaDs.QctErh6LRAd.1.8yku27p6am 12345678 Guruprasath V X-145 xxx, North housing unit, Selvapuram, Coimbatore Coimbatore Tamil Nadu 641026 Adminservices:
servId servName fee timeTaken description createdTime updateTime category
c01e5d23-8313-4818-9065-bce728e5a117 oil change 30.2 5 Oil change will be taken 2024-08-06 15:28:54 2024-08-06 15:45:48 General
f1bd3656-1bf1-4433-925b-2a024c974a53 Water Wash 100 1:30 Clean your bikes with clear water 2024-08-06 15:35:11 2024-08-06 15:35:48 Generalbookings can only be done through website
cd ../client
npm installREACT_APP_BASE_URL_API=http://localhost:8080/api
npm start