- We have developed this REST API for an Online Cab Booking application. This API performs all the fundamental CRUD operations of any Online Cab Booking platform with user validation at every step.
- This project is developed by team of 5 Back-end Developers during project week in Masai School.
- Java
- Spring Framework
- Spring Boot
- Spring Data JPA
- Hibernate
- MySQL
- Login, Logout Module
- Driver Module
- Customer Module
- Admin Module
- TripBooking Module
- Customer, Driver and Admin authentication & validation with session uuid having.
- Admin Features:
- Administrator Role of the entire application
- Only registered admins with valid session token can add/update/delete driver or customer from main database
- Admin can access the details of different customers, drivers and trip bookings
- Customer Features:
- Registering themselves with application, and logging in to get the valid session token
- Viewing list of available cabs and booking a trip
- Only logged in user can access his trip history, profile updation and other features.
- Before running the API server, you should update the database config inside the application.properties file.
- Update the port number, username and password as per your local database config.
server.port=8021
spring.datasource.url=jdbc:mysql://localhost:3306/cabdb;
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
https://localhost:8021/
http://localhost:8021/swagger-ui.html
POST /customer/login
: Logging in customer with valid mobile number & passwordGET /customer/availablecabs
: Getting the list of all the available cabsGET /customers/cabs
: Getting All the cabsGET /customers/checkhistory
: Getting the history of completed trPUT /customer/update/{mobile}
: Updates customer details based on mobile numberPATCH /customer/updatepassword/{mobile}
: Updates customer's password based on the given mobile numberPOST /customer/booktrip
: Customer can book a cabPOST /customer/updatetrip
: Customer can modify or update the tripPOST /customer/logout
: Logging out customer based on session tokenDELETE /customer/delete
: Deletes logged in userDELETE /customer/complete/{tripid}
: Completed the trip with the given tripidDELETE /customer/canceltrip
: Cancel the trip with the given tripid
POST /admin/register
: Register a new admin with proper data validation and admin sessionPOST /admin/login
: Admin can login with mobile number and password provided at the time of registationGET /admin/logout
: Logging out admin based on session tokenGET /admin/listoftripsbycustomer
: Get list of trips of by a customer idGET /admin/listoftrips
: Get list of trips of all the tripsGET /admin/listocustomers
: Get list of all the customersGET /admin/listodrivers
: Get list of all the driversPUT /admin/update/{username}
: Updates admin detaisl by passed user nameDELETE /admin/delete
: Deletes the admin with passed id
POST /driver/register
: Register a new driver with proper data validation and admin sessionPOST /driver/login
: Driver can login with mobile number and password provided at the time of registationPOST /driver/status/{?}
: Changes the status of the driver either Online or OfflineGET /driver/logout
: Logging out driver based on session tokenGET /driver/driverlist
: Gets list of all the driversGET /driver/bestdriver
: Gets the best driver whose rating is over 4.5PUT /driver/update
: Updates the driver details
POST localhost:80211/login/customer
- Request Body
{
"mobileId": "85022457580",
"password": "Clickme@007"
}
- Response
{
"sessionId": 3,
"token": "0ad57094",
"userId": 9,
"userType": "customer",
"sessionStartTime": "2022-06-10T10:48:20.0109626",
"sessionEndTime": "2022-06-10T11:48:20.0109626"
}