- sbt new scala/scala3.g8
- mkdir server
- mv src server/
npm create [email protected]
- -> client
- -> vanilla
- -> javascript
cd client
npm install
npm run dev
cd client
npm install -D @scala-js/[email protected]
Have used RockTheJvm example and partially IdiomaticSoft
Create common dir to keep shared code between server and client
upheld by -core- in build.sbt
Configure multimodule project in build.sbt
upheld by -root- in build.sbt
Configure server
upheld by -server- in build.sbt
Configure client
upheld by -client- in build.sbt
Contains common DTOs between client(javascript) and server(scala)
- Change main.js - to not be confused with ScalaJs main.js
- Create a template page with this element
upheld by index.html
- Following the example from IdiomaticSoft
- download styles from StartBootstrap
- reference them in the project
- Create app.js that will load the css and ScalaJs:main.js which will contain the code implemented in scala on client side therefor ScalaJs library
- Use the code from IdiomaticSoft
-
Important
Start from the client because, when server is started first, client does not start.
-
Run Client
npm run dev
-
Run Server
sbt server/run
-
Refresh Client