In the root directory:
npm create vite@latestand the project is named frontend.
npm install
npm run devand the project is served at http://localhost:5173/
-
Added
sbtconfiguration. -
Added
Main.scalafor code in scala.js -
Run
~fastLinkJSinsbtandnpm run devon another terminal
-
Added
laminaras a dependency -
Changed
Main.scalato use laminar- It seems that something needs a
@mainentrypoint because leaving the code at top-level does not compile.
- It seems that something needs a
-
Added configuration in
build.sbt -
Minimal "test" on browser console (in many tabs) by:
let ws = new WebSocket('ws://localhost:8080/subscribe')
ws.onmessage = function(e) { console.log(e) }
ws.send("potato")-
Added dependency on 'laminext'
-
Added proxy in `vite.config.js' for the websocket endpoint on the server
-
To run in development mode
- on
sbtrunbackend/run - on
sbtrunfrontend/fastLinkJS - in
frontendfoldernpm run dev
- on
-
Added the plug-in to sbt configuration
-
Now to start the
backend:-
on
sbtrunbackend/reStart(or~backend/reStartto trigger restarting the app with changes) -
you also have
reStopandreStatus
-
-
on
sbtrunfrontend/fullLinkJS -
copy
frontend/index.htmlandfrontend/target/scala-3.4.0/frontend-opt/main.jsandfrontend/public/*tobackend/src/main/resources/public -
change the
public/index.htmlto point to themain.jsin thepublicfolder -
on
sbtrunbackend/reStart -
open
http://localhost:8080
-
on
sbtrunbackend/assemblyand theuberjarfile is atbackend/target/scala-3.4.0/code-to-screen-standalone.jar -
you can run in by
java -jar code-to-screen-standalone.jar
-
run
docker build -t code-to-screen-scala .to build an image -
docker run --detach --publish 8080:8080 --name code-to-screen-1 code-to-screen-scala
-
added
fly.tomlfile -
run
fly auth loginand thenfly deploy- NOTE: Added --deput=false and --ha=false; the first one because it failes otherwise and the second one to deploy only on one machine