This is just a minimalistic sample application to demonstrate my coding practice in Golang and MongoDB. This application is a subset of the needs of a cab booking platform like Gobar/Gola.
- A user should be able to request a booking for a cab from pickup location A to pickup location B
- A user should be able to view his past bookings
- A user should be able to get cabs that are nearby.
- Writing middleware for proper http error statuses
- Using gin
P.S. an actual cab booking platform has way more detail than you could think of. That usually includes of plenty of other necesary microservices, a messaging queue, socket connections, VRP engine and ofcourse some statistics to generate the price estimate.
dbinit.js
git clone github.com/Glitchfix/golagobar
cd golagobar
go get ./...
make run
make build
./golagobar
{
"database": {
"database": "golagobar",
"host": "DBHOST",
"port": "DBHOST",
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"authsource": "YOUR_AUTHENTICATION_SOURCE_DB"
},
"server": {
"host": "HOST_IP",
"port": "PORT"
}
}