Group: Java Jedi
demo_full.mp4
- User service: This service is responsible for managing user accounts, including login, registration, and profile management.
- Booking service: This service is responsible for managing bookings, including creating, fetching, cancelling, and reviewing bookings.
- Schedule service: This service is responsible for managing schedules, including fetching, creating, and updating schedules.
- Payment service: This service is responsible for processing payments for bookings.
- Route service: This service is responsible for providing information about the bus routes, including origin, destination, duration, and amount.
- The user interacts with the user interface to log in, view their booking, and book a new bus.
- The user service fetches the user account from the database.
- The booking service fetches the booking of the user from the database, or creates a new booking if one does not exist.
- The schedule service fetches the schedule from the database, or creates a new schedule if one does not exist.
- The payment service processes the payment for the booking.
- The review and cancellation APIs are handled by the booking service.
- The ticket is generated by the schedule service and the route service.
- Security: The system should be secure to protect the user's data.
- Scalability: The system should be scalable to handle a large number of users.
- Availability: The system should be available to users 24/7.
This class is the base class for all the other classes in the code. It defines the protected properties userAPI
, bookingAPI
, routeAPI
, scheduleAPI
, and paymentAPI
, which are the URLs for the different APIs.
registerUser()
: Registers a new user.loginUser()
: Logs in a user.bookRide()
: Books a ride for a user.cancelRide()
: Cancels a ride for a user.reviewRide()
: Reviews a ride for a user.getAllUsers()
: Gets all the users.
This class extends the API
class and provides methods for interacting with the user API.
registerUser()
: Registers a new user.loginUser()
: Logs in a user.bookRide()
: Books a ride for a user.cancelRide()
: Cancels a ride for a user.reviewRide()
: Reviews a ride for a user.getAllUsers()
: Gets all the users.
This class extends the API
class and provides methods for interacting with the booking API.
getBookingAPI()
: Gets the URL for the booking API.getBookingbyUserID()
: Gets all the bookings for a user.cancelBooking()
: Cancels a booking.reviewBooking()
: Reviews a booking.
This class extends the API
class and provides methods for interacting with the route API.
addRoute()
: Adds a new route.getRouteByID()
: Gets a route by its ID.getRouteByOrigin()
: Gets all the routes that start at a given origin.getRouteByOriginAndDestinnation()
: Gets all the routes with given origin and destination.getAllOrigins()
: Gets all the origins.getAllDestinations()
: Gets all the origins.getAllRoutes()
: Gets all the routes.
This class extends the API
class and provides methods for interacting with the schedule API.
makeSchedule()
: Creates a new schedule.getScheduleByRouteID()
: Gets a schedule by its route ID.getAllSchedules()
: Gets all the schedules.
This class extends the API
class and provides methods for interacting with the payment API.
makePayment()
: Creates a new payment.getPaymentByBookingID()
: Gets a payment by its booking ID.getAllPayments()
: Gets all the payments.
-
id: integer, primary key
-
name: varchar
-
email: varchar
-
password: varchar
- id: integer, primary key
- user_id: integer, foreign key to User.id
- schedule_id: integer, foreign key to BusSchedule.id
- status: varchar
- id: integer, primary key
- user_id: integer, foreign key to User.id
- rating: integer
- comment: varchar
- id: integer, primary key
- booking_id: integer, foreign key to Booking.id
- user_id: integer, foreign key to User.id
- reason: varchar
- id: integer, primary key
- origin: varchar
- destination: varchar
- distance: double
- duration : time
- available_seats : int
- id: integer, primary key
- bus_route_id: integer, foreign key to BusRoute.id
- departure_time: timestamp
- arrival_time: timestamp
- amount: float
- id: integer, primary key
- booking_id: integer, foreign key to Booking.id
- amount: float
- fare_id: integer, primary key
- basic_cost: double
- cout_per_km: double
- slot_id: integer, primary key
- slot: timestamp
- Java Development Kit 20 Download Link
- MySQL Community Server 8 Download Link
- Node (v18.16.0)
- Angular (v16.0.2)
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
CREATE DATABASE training;
USE training;
INSERT INTO bus_route (route_id, destination, origin, distance, duration, available_seats)
VALUES (107, 'Delhi', 'Agra', 220, '04:00:00', 30),
(109, 'Varanasi', 'Agra', 612, '10:00:00', 30),
(110, 'Varanasi', 'Delhi', 821, '13:00:00', 30),
(112, 'Agra', 'Delhi', 220, '04:00:00', 30),
(113, 'Delhi', 'Varanasi', 821, '13:00:00', 30),
(115, 'Agra', 'Varanasi', 612, '10:00:00', 30);
INSERT INTO route_fare (fare_id, basic_cost, cost_per_km)
VALUES (1, 500, 0.5);
INSERT INTO route_slot (slot_id, slot)
VALUES (1, '10:00:00'),
(2, '12:00:00'),
(3, '14:00:00'),
(4, '16:00:00'),
(5, '18:00:00');