Uber like Mini Api To GetNearByCabs, View all your bookings And Do a Booking.
First of All Create a database in postgres and put its credentials in .env file
My .env file looks like this
API_SECRET= #Used when creating a JWT. It can be anything
DB_HOST=yourdbip
DB_DRIVER=postgres
DB_USER=yourdbusername
DB_PASSWORD=yourpassword
DB_NAME=yourdbname
DB_PORT=5432 #Default postgres port
The .env file should be in top most directory of repository.
To run clone the project and type
go run main.go
in terminal.
First of All we need to login :
Put the JWT Token to the Authorization header and you are logged in.
Now comes fun part you can view all the users
Create A New User
Update A User
Delete A User
Get Nearby Cabs For This you need to give you need to give your current location and NearByRange in kilometers.
Get All Bookings of a User (Only logged in user can access)
Create A New Booking (Only logged in user can book)