https://github.com/richardktran/kootha
Realtime Quiz Application, example for microservice by Golang | Grpc | Kafka
https://github.com/richardktran/kootha
clean-architecture golang grpc kafka microservice system-design
Last synced: about 2 months ago
JSON representation
Realtime Quiz Application, example for microservice by Golang | Grpc | Kafka
- Host: GitHub
- URL: https://github.com/richardktran/kootha
- Owner: richardktran
- Created: 2024-12-09T15:31:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-18T14:55:43.000Z (about 1 year ago)
- Last Synced: 2025-04-19T00:40:29.010Z (about 1 year ago)
- Topics: clean-architecture, golang, grpc, kafka, microservice, system-design
- Language: Go
- Homepage:
- Size: 262 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Setup Protobuf and gRPC
## Install protobuf compiler
For MacOS:
```bash
brew install protobuf
```
## Install protoc-gen-go
```bash
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
```
## Update your PATH so that the protoc compiler can find the plugins:
```bash
export PATH="$PATH:$(go env GOPATH)/bin" >> ~/.zshrc
```
## Run Hashicorp Consul in Docker
```bash
docker run -d -p 8500:8500 -p 8600:8600/udp --name=dev-consul hashicorp/consul:latest agent -server -ui -node=server-1 -bootstrap-expect=1 -client=0.0.0.0
```
## Run Kafka in Docker
Build the image and run the container
```bash
cd docker/kafka
docker compose up -d
```
Access Kafka
```bash
docker exec -it kafka bash
cd /opt/kafka/bin/
```
Create Topic
```bash
./kafka-topics.sh --bootstrap-server localhost:9092 --create --topic test
```
Send a message to the topic (Open a new terminal)
```bash
./kafka-console-producer.sh --bootstrap-server localhost:9092 --topic test
```
Consume messages from the topic (Open a new terminal)
```bash
./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
```