/grpc-event-stream

NATS based Event stream project using gRPC as service transport. Showcase golang microservice project structure.

Primary LanguageGoMIT LicenseMIT

gRPC Event stream

Event stream based Go microservice project using Nats JetStream, PostgresSQL & gRPC. Exhibit project to show case usage of cloud native ecosystem & tools.

Prerequisites

  • Golang 1.19+
  • Docker 20+ (compose extension)
  • Protoc compiler 3.8+

Running

  • Clone project & fetch go dependency

    go mod download
  • Compile event protocol buffer file & gen gRPC code

    make proto
  • Run the PSQL & Nats using docker

    docker compose pull
    docker compose up -d
  • Run DB migrations create tables.

    migrate -database ${POSTGRESQL_URL} -path migrations up
  • Run all the microservices in seprate shell

    go run cmd/order-svc/main.go
    go run cmd/payment-svc/main.go
  • Run sample client event flow

    go run cmd/client/main.go