Skip to content

Glitchfix/golagobar

Repository files navigation

Gola/Gobar

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.

How to run

Step 1

Initialize your mongo database with commands in the file below
dbinit.js

Step 2

On your terminal
git clone github.com/Glitchfix/golagobar
cd golagobar
go get ./...

Step 3

Create config.json file and configure as per sample given below

Step 4

Run the following commands after setting up your config
make run
OR
make build
./golagobar

Sample config.json file

{
  "database": {
    "database": "golagobar",
    "host": "DBHOST",
    "port": "DBHOST",
    "username": "YOUR_USERNAME",
    "password": "YOUR_PASSWORD",
    "authsource": "YOUR_AUTHENTICATION_SOURCE_DB"
  },
  "server": {
    "host": "HOST_IP",
    "port": "PORT"
  }
}

Click on the postman icon to see API documentation

N|Click on me

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages