Skip to content

Files

Latest commit

e78c37f · May 5, 2021

History

History
46 lines (34 loc) · 1.67 KB

Readme.md

File metadata and controls

46 lines (34 loc) · 1.67 KB

Vets

Vets is a concept flutter app that allows farmers to search for veterinary officers in their area, checkout their services and schedule appointments .This is the backend for the flutter app (https://github.com/ndirangug/vet_flutter). It is a grpc service built with go. The grpc service runs CRUD operations against a postgresql database.

Technologies Used

  • Golang
  • GRPC
  • Docker was used to continerize the application and deploy it to Google Cloud Run.
  • Makfile was used to automate some repetitive tasks on local dev environement

Cloud Deployment

The Go grpc service is deployed to a Google Cloud Run instance and CI pipeline has been setup with Google Cloud Build and Github.A Heroku Postgres Instance has been used for the database.

Test the grpc service on cloud run

The grpcurl tool may be used to send requests to the hosted grpc service on cloud run

# server reflection
$ grpcurl  vet-backend-fybfguvuua-uc.a.run.app:443 list

# example get a veterinry officers within  given radius of a particular location
$ grpcurl  -d '{"location":{"lat":-1.2939299460360305, "long": 36.799532813964184}, "radius": 300}'  vet-backend-fybfguvuua-uc.a.run.app:443 vet_backend.VetsBackend/GetVeterinariansInLocation

The grpui tool may also be used to graphicly explore the service and play with it

$ grpcui  vet-backend-fybfguvuua-uc.a.run.app:443 

Test on localhost

Prerequsites

  • Go 1.15
  • Postgresql 13

Run Server

# Setup Database locally
$ make migrate
$ make seed

# start the grpc service
$ make serve