- Having a minimal Client-Server Setup, using Scala.
- Using Slinky on the Client side.
- Having a decent UI.
git clone https://github.com/pme123/slinky-todos.git
docker run --publish 8883:8883 --name todos pame/slinky-todos:0.2.0
Open the Browser http://localhost:8883/.
sbt server/run
This starts the Web Server on Port 8883.
This copies the client assets to the classpath of the server. So make sure you run
build
before.Or use the client as described in the next chapter.
sbt dev
This will watch all your changes in the client and automatically refresh your Browser Session.
Open in the Browser http://localhost:8024.
sbt release
Creates an optimized Client bundle and adds it to the Server Library.
The whole distribution you can find here: ./server/target/universal/stage
.
You can start the server like this:
- Mac / Linux:
./server/target/universal/stage/bin/slinky-todos-server
- Windows:
./server/target/universal/stage/bin/slinky-todos-server
sbt server/docker:publishLocal
If you want to build another distribution check here for the possibilities: sbt-native-packager
This example is more or less a mashup from different Github projects:
The Communication between client and server I took from this excellent tutorial.
- see Scala.js SPA-tutorial
- and the according Source Code: scalajs-spa-tutorial
I just translated the React Code from this project to Scala/Slinky. I made some simplifications, like skipping 'redux' and 'routing'
- See here the Demo: react-antd-todo.netlify.app
- And the Project react-antd-todo
This project has also a Demo for Ant Design. So after spending some time, trying to figure it out - I found there all code snippets I needed.
- See here the Demo: Ant Design Demo
- And the Project: SlinkyDemos
A simple project that contains only the client side.
- Autowire:
Autowire is a pair of macros that allows you to perform type-safe, reflection-free RPC between Scala systems.
- BooPickle:
BooPickle is the fastest and most size efficient serialization (aka pickling) library that works on both Scala and Scala.js.
- Slinky
Write React apps in Scala just like you would in ES6
- Scalably Typed
The Javascript ecosystem for Scala.js! I used the facades for Ant Design
- Ant Design
A design system for enterprise-level products. Create an efficient and enjoyable work experience.
- http4s
Typeful, functional, streaming HTTP for Scala.