Deployed Site- https://cabook-cab-services.netlify.app/
Assignment Submission for Scaler SDE Intern Full-Stack Assignment - Cab System
Frontend is build in React JS and for backend I've used Firebase. The website is deployed using netlify.
Project Description- The site lets you book cabs form one location to another and calculates the shortest distance between two places using the best route possible and sends confirmation email on successful booking. You can choose the pick-up and drop from the locations available with no predefined routes.
The site gives you the sumary of the trip with estimated cost for the trip inclusive of taxes. To calculate the cost for the trip, the fare of the cab per minute is multiplied with the shortest time it will take to reach from pickup to destination. This is calculated using the Dijkstra's algorithm for calculating shortest path between two nodes of a graph- REFER to lines no. 130-221 in HomePage.js file for code
On confirmation, a confirmation mail is sent to the user email by using the SMTP protocol with elastic mail as host. REFER to lines no. 232-244 of HomePage.js file for code
Then the booking details are also sent to the firebase realtime database which are to be printed in the bookings screen. REFER to line no. 257 in HomePage.js
Also I've set the value of the cab in the options array to be 0 to filter it out while booking another cab and show it as booked.
The cabs that are already chosen by the user are shown as booked and so not available to choose from.The user can also delete their booking by clicking on the delete button with the bookings.Then the cab will be again available to be booked.
The user can also book another cab from the other four options if one is already booked by them.
The website is also made responsive using basic media queries.So it is compatible for phone as well as desktop screens (i.e. compatible for all screen sizes)
In the project directory, you can run: