Warning: this is currently not working and really should be a private repo, but I've run out of private GHA minutes so... here we are
Warning: this will take some time, as we need to build NGINX Unit from scratch, and install LLVM. Sit back, have a beverage
-
Build a docker container
Release version (slow):
$ docker build . --build-arg scalanative_mode=release-fast --build-arg scalanative_lto=none -t sn-bindgen-web
Debug version (slightly faster):
$ docker build . --build-arg scalanative_mode=debug --build-arg scalanative_lto=none -t sn-bindgen-web
-
Run it
docker run -p 9999:9999 sn-bindgen-web:latest
-
Open
http://localhost:9999
and enjoy.
-
Install NGINX Unit: https://unit.nginx.org/installation/
-
Install LLVM: https://releases.llvm.org/
-
Set
LLVM_BIN
env variable to the location ofbin
folder in LLVM installation -
Run
sbt devServer/run
Warning: first run will be very slow. Subsequent ones will be somewhat slow.
Alternatively, you can keep launch SBT and run
devServer/reStart
in there - this will make sure that your SBT shell remains usable, and the server will be run in the background. -
Open
http://localhost:9999
and enjoy.
The frontend module is set up using Vite.js.
cd modules/frontend
npm install
- Run the backend (see above), it has to be running on port 9999 (default)
as Vite is configured to proxy the
/api/*
requests tohttp://localhost:9999/api/*
- In a separate SBT shell, run
~frontend/fastLinkJS
- this continuously rebuilds the Scala.js frontend npm run dev
- will run the Vite server- Open http://localhost:5173 and you can now edit frontend without restarting the backend, with live reload