项目作者: ptrdom

项目描述 :
Template project for full-stack Scala web development based on gRPC-web.
高级语言: Scala
项目地址: git://github.com/ptrdom/akka-grpc-slinky-grpcweb.git
创建时间: 2021-01-10T13:20:23Z
项目社区:https://github.com/ptrdom/akka-grpc-slinky-grpcweb

开源协议:MIT License

下载


Akka gRPC Slinky gRPC-web

This template project was the result of investigation into full-stack Scala web development experience with following requirements:

  • Compile time type safety
  • Streaming API
  • Quick hot reload in development
  • Single deployment in production

Decision to base the implementation on gRPC-Web came after testing out popular
implementations of REST(autowire,
endpoints4s) and GraphQL
(sangria,
caliban)
and realisation that none of existing solutions satisfy each requirement,
while gRPC‘s basic functionality has all the required features.

How to run

Development mode

Using sbt:

  • startServerDev
  • startClientDev

Using IntelliJ (tested with 2021.3):

  • Use server dev start and client dev start Run/Debug configurations provided in /.run.

startServerDev starts back-end based on Akka HTTP in watch mode.
It serves gRPC endpoints for front-end to consume on localhost:9000.

startClientDev starts webpack dev server with HMR enabled for front-end development with
Scala.js and Slinky. Opening localhost:8080 in the browser will serve index.html.

IntelliJ’s sbt shell must be enabled to make sbt plugins run during compile -
integrated Scala compile server won’t trigger them.

Production mode

Using sbt:

  • serverProd/run

Using IntelliJ (tested with 2021.3):

  • Use server prod run Run/Debug configuration provided in /.run.

In production mode, optimized front-end bundle and all assets are packaged together with the back-end,
then served with aggressive caching enabled by fingerprinting. Server serves both HTTP and gRPC
endpoints.

Docker image publishing is implemented with sbt-native-packager.

Slinky IntelliJ support

https://slinky.dev/docs/installation/ section IntelliJ Support describes how to add support for @react macro.

Built on: