Coder Social home page Coder Social logo

ptrdom / play-grpc-slinky-grpcweb Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 24 KB

Template project for full-stack Scala web development based on gRPC-web.

License: MIT License

Scala 79.38% HTML 2.26% JavaScript 18.36%
scala scalajs slinky grpc grpc-web akka-grpc play-framework

play-grpc-slinky-grpcweb's Introduction

Play 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:

  • ~serverDev
  • ~clientDev

Using IntelliJ (tested with 2020.3):

  • Enable sbt shell for compilation.
  • Use Run/Debug configurations provided in /.run.

~serverDev starts back-end based on Play Framework in watch mode. It serves both HTTP and gRPC endpoints for front-end to consume. ~clientDev starts webpack dev server with HMR enabled for Scala.js, specifically Slinky, front-end development. After running these commands and opening localhost:9000, back-end returns index page with script definition that wires-in front-end.

Production mode

Using sbt:

  • Start sbt with production flag enabled - sbt "-Denv=prod"
  • server/docker:publishLocal

In production mode, optimized front-end bundle is packaged and stored in back-end's assets, then served with aggressive caching enabled by fingerprinting.

Slinky IntelliJ support

https://slinky.dev/docs/installation/ describes how to add support @react for macro. If documented approach fails, manual plugin installation can be done by downloading https://mvnrepository.com/artifact/me.shadaj/slinky-core-ijext .jar and manually installing it as IntelliJ plugin through Settings -> Plugins -> Install Plugin from Disk.... Tested with IntelliJ IDEA 2020.3.1 and Slinky 0.6.6.

Built on:

play-grpc-slinky-grpcweb's People

Contributors

ptrdom avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mavenrain

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.