This module contains the web client application built using Kotlin/JS using React and MUI via kotlin-wrappers. The UI follows the patterns found in kotlin-mui-showcase.
Wrappers for other libraries (see package com.ustadmobile.wrappers ) created as per:
The api url endpoint is normally determined automatically by checking the browser location href. You
can override it by adding apiUrl=https://domain.myendpoint.com/path/
to the url (value must by
url encoded as normal).
Follow steps in the main project README to setup development environment and start the server.
Run the web app using Gradle:
Linux/MacOS
$ ./gradlew app-react:jsRun
Windows:
$ gradlew app-react:jsRun
See Kotlin/JS docs for further info on Gradle commands if required.
The browser will open the webpack development server on port 8080. Close that tab, and then open http://localhost:8087/ in a new tab. You should now see the web client.
Note: you can add –continuous to use continuous compilation to enable automatic continuous compilation.
The server module will handle all normal REST API requests and proxy any other requests to the webpack development server. This avoids browser Cross Origin Requests (CORS) restrictions that would happen if the rest API is on a different server or port to the server providing the web client (e.g. the webpack development server).
The production bundle is included as static assets when building the server for production.
The production Javascript bundle will only be include with app-ktor-server if the ktorbundleproductionjs argument is set as follows:
Linux/MacOS:
$ ./gradlew app-ktor-server:distZip -Pktorbundleproductionjs=true
Windows:
$ gradlew app-ktor-server:distZip -Pktorbundleproductionjs=true