Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hirofumi/protoroutes

Protocol Buffers based RPC between Play Framework and Scala.js
https://github.com/hirofumi/protoroutes

playframework protocol-buffers sbt-plugin scala scalajs scalapb

Last synced: 29 days ago
JSON representation

Protocol Buffers based RPC between Play Framework and Scala.js

Awesome Lists containing this project

README

        

# protoroutes

[![Build Status](https://travis-ci.org/hirofumi/protoroutes.svg?branch=master)](https://travis-ci.org/hirofumi/protoroutes)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.hirofumi/sbt-protoroutes/badge.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.hirofumi%22%20protoroutes)

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](https://github.com/btlines/grpcgateway).

## Examples

* [a fork](https://github.com/hirofumi/Full-Stack-Scala-Starter/tree/protoroutes) of [Full-Stack-Scala-Starter](https://github.com/Algomancer/Full-Stack-Scala-Starter)
* [scripted tests](./modules/plugin/src/sbt-test/sbt-protoroutes)