A Scala 3 fullstack app: Cask (JVM server) + ScalaJS + Laminar (client), as a cross-project with shared code. Scaffolded from a Hello World template.
build.sbt # cross-project: js / jvm / shared
shared/ # code compiled for both platforms
jvm/ # Cask web server + static assets (HTML, CSS, service worker)
js/ # ScalaJS + Laminar client
scripts/ # dev + build helpers
sbt fastLinkJS # compile the client into jvm/.../static/dist/main.js
sbt jvm/run # start the server
# open http://localhost:8080sbt bloopInstall # once, and after editing build.sbt
npm install # once (jsdom for tests, vite for asset bundling)
./scripts/dev-watch.sh # edit & save — the browser hot-reloads itselfbloop test jvm # JVM tests
sbt js/test # JS tests
./scripts/run-all-tests.sh # everythingbloop compile jvm/bloop compile js- All warnings are errors (
-Werror). Fix warnings immediately.
nixpacks.toml builds the client with fullLinkJS, bundles assets, and stages
the server via sbt-native-packager (./target/universal/stage/bin/main).