Moke is a template project for moke-kit that helps you quickly build gRPC/TCP/HTTP microservices with IoC (Inversion of Control). The template provides:
- Interactive command-line client
- Load testing tools
- Protocol buffer management:
- Proto file generation
- Proto file publishing to buf Schema Registry
- SDK generation for multiple languages
# Optional: Create ./deployment/docker-compose/.env for custom configuration
docker compose -f ./deployment/docker-compose/infrastructure.yaml up -dgo run ./cmd/demo/service/main.go- Build the interactive client:
go build -o client.exe ./cmd/demo/client/main.go- Run the client:
# View available commands
./client.exe help
# Run specific clients
./client.exe grpc # gRPC client
./client.exe tcp # TCP clientNote: For HTTP testing, use Postman to connect to localhost:8081
- Install k6
- Run the tests:
k6 run ./tests/demo/demo.js- Install buf
- Generate proto files:
buf generate- Publish to buf Schema Registry:
# Login to BSR (requires account)
# See: https://buf.build/docs/tutorials/getting-started-with-bsr#prerequisites
buf registry login username
# Push proto files
buf push- Visit https://buf.build/gstones/moke-layout/sdks
- Select your target language
- Follow the provided instructions to import the SDK into your project