hirofumi / protoroutes   0.1.0-M1

GitHub

Protocol Buffers based RPC between Play Framework and Scala.js

Scala versions: 2.12
Scala.js versions: 0.6
sbt plugins: 1.x

protoroutes

Build Status Maven Central

Protoroutes is an sbt plugin which can generate the following from .proto file.

  • Play Framework's Router which handles Protocol Buffers and JSON requests
  • Scala.js client which communicates with the Router
++---------------++
||               ||  protoroutes   +-----------------+
||               || =============> | Scala.js client |
||               ||                +-----------------+
||               ||                     ^                    +-----------------+
||               ||                     | +----------------->| REST API client |
||               ||                     | |                  +-----------------+
||               ||       REST API (PB) \ / REST API (JSON)
|| service.proto ||                      |
||               ||                      v
||               ||  protoroutes   +----------------+
||               || =============> | Play Router    |
||               ||                +----------------+
||               ||                | Your own       |
||               ||                | implementation |
||               ||                | of `service`   |
||               ||  ScalaPB       +----------------+
||               || =============> | gRPC Interface |
||               ||                +----------------+
++---------------++                      ^
                                    gRPC |                   +-----------------+
                                         +------------------>| gRPC client     |
                                                             +-----------------+

The idea of protoroutes is based on btlines/grpcgateway.

Examples