💡
|
The API documentation is available at API-Doc. This document is available at Documentation. |
Setting up a development machine requires a few steps:
-
first install the required software:
-
docker and docker-compose
-
node and npm
-
sbt
-
a TypeScript editor (e.g.: VS Code)
-
a Scala editor (e.g.: VS Code or IntelliJ Idea)
-
-
setup authentication providers as described in the repositories README:
cp deployment/config/auth-svc.settings.sample.yml deployment/config/auth-svc.settings.yml
-
start the development compose file in a separate terminal:
docker-compose -f deployment/docker-compose.yml up
-
fire up the sbt console:
sbt
-
inside sbt, run the application:
run
-
start the frontend dev server in a separate terminal:
cd ui && npm start
Now you can access the application at http://localhost:3000
.
|
in development mode, the traefik proxy - that is available at localhost:9000 -
assumes that the backend is running at localhost:8888 and the ui is running at localhost:3000 .
|
❗
|
Don’t do this in production! |
You can create a user by directly POSTing to the user-svc container.
One’s the containers are started, the user-svc is available at localhost:9012/api/v1/users
.
Using this route, you can create a user through HTTPie:
http --json -v\
POST localhost:9012/api/v1/users\
Service:auth\
user:='{"username":"test", "first_name":"Test", "email":"[email protected]"}'
Then you can login using username=test
in the developer login. Either through the wb interface at: http://localhost:9000/api/v1/auths/developer
or using HTTPie:
http -v --form\
POST localhost:9000/api/v1/auths/developer/callback\
username=test
ℹ️
|
In production at staging-webmodelica use either CAS or GitHub login. |
|
before you can publish a new release, you need a DockerHub account and write access to the thmmote group! |
There is a script (project/release.sh
) available for generating new releases.
This script does the following:
-
write the new version into
project/version.txt
. sbt reads this file to set the version. -
fully compiles and packages the backend through sbt into
target/universal/webmodelica-<new version>.txz
-
fully builds the frontend into
ui/build
-
commits and tags the
version.txt
file -
builds both docker images for backend and frontend
-
replaces the versions in
deployment/docker-compose.prod.yml
-
pushes the commits and tags onto GitHub
-
pushes the images onto DockerHub
Usage:
$ bash scripts/release.sh <new version number>
$ bash scripts/release.sh 0.6.5