Skip to content

Latest commit

 

History

History
113 lines (87 loc) · 3.69 KB

readme.adoc

File metadata and controls

113 lines (87 loc) · 3.69 KB

Webmodelica Developer Documentation

💡
The API documentation is available at API-Doc. This document is available at Documentation.

1. Setup

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.

2. Creating users for development

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.

3. Release new versions

⚠️
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:

  1. write the new version into project/version.txt. sbt reads this file to set the version.

  2. fully compiles and packages the backend through sbt into target/universal/webmodelica-<new version>.txz

  3. fully builds the frontend into ui/build

  4. commits and tags the version.txt file

  5. builds both docker images for backend and frontend

  6. replaces the versions in deployment/docker-compose.prod.yml

  7. pushes the commits and tags onto GitHub

  8. pushes the images onto DockerHub

Usage:

$ bash scripts/release.sh <new version number>
$ bash scripts/release.sh 0.6.5

4. TBD

  • project path mapper

  • authentication flow

  • redux, flux

  • display UI marked components