Skip to content

The famous TODO List as a client-server example with Slinky

License

Notifications You must be signed in to change notification settings

pme123/slinky-todos

Repository files navigation

Todo List with Slinky

Goals

  • 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

Screenshot.png

Try it out

docker run --publish 8883:8883 --name todos pame/slinky-todos:0.2.0

Open the Browser http://localhost:8883/.

Usage in Dev

Server Development

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.

Client Development

sbt dev

This will watch all your changes in the client and automatically refresh your Browser Session.

Open in the Browser http://localhost:8024.

Production Build

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

Docker

sbt server/docker:publishLocal

If you want to build another distribution check here for the possibilities: sbt-native-packager

Thanks to

This example is more or less a mashup from different Github projects:

Scala.js SPA-tutorial

The Communication between client and server I took from this excellent tutorial.

React Ant Design Todo List

I just translated the React Code from this project to Scala/Slinky. I made some simplifications, like skipping 'redux' and 'routing'

Scalably Slinky Demo

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.

My Scalably Slinky example

A simple project that contains only the client side.

Technologies

Shared

  • 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.

Client

  • 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.

Server

  • http4s

    Typeful, functional, streaming HTTP for Scala.

About

The famous TODO List as a client-server example with Slinky

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published