An assignment having some functionalities of a cab booking application built using Spring, Hibernate, and a bit of frontend...
Prerequisites: Maven, JDK 1.8, MySQL Database Ensure that you have MySQL running locally on port 3306 and the datbase user exists with access rights to cab_service_db
These properties can be configured in application.properties of "cab-booking-service" project spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/cab_service_db spring.datasource.username=aakash spring.datasource.password=aakash
There is no need to run the SQL scripts as I have added test-scripts within Flyway itself to intialize database with test data
Steps to run this application
- Clone the repository
- To run the service, Run "mvn spring-boot:run" command inside "cab-booking-service" directory using a command prompt.
- The service will start on port 8080
- To run the client, Open another console and run the same command "mvn spring-boot:run" inside "cab-booking-client" directory.
- The client will start on port 8081
- Open web browser and access http://localhost:8081/booking
- You can use the "cab-booking-service/test-data.txt" file to test the application
--- Points to be noted. ---
- The user's default location has been made to point at 19.2309696,72.9824377 (Everest World, Thane, Maharashtra) coordinates since the test data has coordinates around this point.
- The coordinates of the cab drivers are inserted in the SQL script itself in point number 4, there is no mechanism yet to capture live coordinates or to simulate coordinates changing in the backend every few seconds.
- I have used OpenLayers to have the map visualization
- LocationIQ's free service has been used on the frontend to have Geocoding enabled in the application.
The cab-booking-service has APIs for the following functionalities:
- Create Cab Driver
- Create Customer
- Book a cab
- Get available cab drivers near a location
- Show all cab booking statuses
- Update Driver Location
- Get particular driver's details
"Cab-Service.postman_collection.json" postman collection has all these requests.