A sample app made using React to book cars for intercity travel.
- Clone this repo to your local machine using
$ git clone https://github.com/boffti/cfu.git
- Replace the
XXX
of the<Script>
tag inclient\public\index.html
with your Google Places API Key. - Replace the
key
andsecret
inserver.js
with your RazorPay API Key and Secret. This can be done with a.env
file placed in the root of server dir. The variables areREACT_APP_RZP_KEY
andREACT_APP_RZP_SECRET
.
- Install all the Frontend and Backend dependencies.
Backend
$ cd cfu
$ cd server
$ npm install or yarn install
Frontend
$ cd cfu
$ cd client
$ npm install or yarn install
To run the Node server and the client app server,
cd
into project root dir.
$ cd cfu
$ cd server
$ npm run dev or yarn dev
This will serve both the backend and front end.
App is served on localhost:3000
.
Node server running on localhost:5000
.
The credentials to Login in the app -
- username -
admin
- password -
admin
A docker compose file has been written.
Install Docker from here
To configure docker, perform the following steps -
- Change the proxy in
server/package.json
"proxy" : "http://cfy_server:5000/"
- Build the images and start the containers
$ docker-compose up --build
- Material Design
- Backend NodeJS and Express
- Destination Autocomplete using Google Places API
- Calendar Date Picker
- RazorPay payments integration for checkout
- Basic Unit test scripts have been written for a couple of components.
$ cd cfu
$ npm test or yarn test
https://github.com/boffti
-
How did you calculate the distance between the origin and the destination?
Ans - Using the haversine function which determines the great-circle distance between two points on a sphere given their longitudes and latitudes. Haven't used any API for this yet.
-
Do I have to give my real details to check the RazorPay Booking Payment feature?
Ans - NO. Just give any dummy values for the payment fields as it is running in Test Mode. Booking ID will be generated after Fake Payment.
Reach out to me at one of the following places!
- Twitter at
@aneeshmelkot
- MIT license
- Copyright 2020 © Aneesh Melkot