The client subproject is responsible for rendering and handling user input.
boards-client uses the following libraries, which will be installed automatically by sbt:
- Laminar for client-side rendering.
- Airstream, which is required by Laminar, is a library for functional reactive programming.
- Circe for automatic serialisation/deserialisation to/from JSON.
- views/ for top-level views, each corresponding to an entire page of the website.
- components/ for reusable web components created using Laminar.
- util/ for assorted helper functions.
- imports/ for collections of standard import groups to avoid repeating them in every file.
Perhaps the most interesting view is that for the game itself, along with its constituent components.
This subproject is compiled exclusively to Javascript using Scala.js, and is served to the client's browser. A single .js file is produced for the entire application. All pages use the same template, which does nothing but delegate to the appropriate client-side view. All rendering is done on the client, the server only provides code and data.