## Database migrations Install `goose`: ```bash go get -u github.com/pressly/goose/cmd/goose ``` Note: Up migration are automatically executed when the application is run. ```bash goose -dir db create sql # Create migration in db folder goose -dir db postgres "${DB_DATASOURCE_NAME}" up # Migrate the DB to the most recent version available goose -dir db postgres "${DB_DATASOURCE_NAME}" down # Roll back the version by 1 goose help # See all available commands ``` ## gRPC installation Install gRPC: ```bash go get -u google.golang.org/grpc ``` Download pre-compiled binaries for your platform(protoc--.zip) from here: https://github.com/google/protobuf/releases On macOS or Linux: - Unzip `protoc--.zip` - Move `bin/protoc` to `/usr/local/bin/` - Move `include/google` to `/usr/local/include` Then use `go get -u` to download the following packages: ```bash go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger go get -u github.com/golang/protobuf/protoc-gen-go ``` This will place three binaries in your `$GOBIN`; * `protoc-gen-grpc-gateway` * `protoc-gen-swagger` * `protoc-gen-go` Make sure that your `$GOBIN` is in your `$PATH`. ## API code generation Generate Go and Swagger APIs: ```bash make api ```