Skip to content

Build and deploy

hlg edited this page Jul 28, 2025 · 2 revisions

This guide shows how to build and deploy Bimvie.ws testing. This has been tested in 02/2025.

Prerequisites

Directories

Clone the BIMvie.ws (if you have not yet), BIMsurfer (old) and BIMserver Javascript API repositories.

git clone https://github.com/opensourceBIM/BIMvie.ws.git
git clone https://github.com/opensourceBIM/BIMsurfer-before2019.git
cd BIMsurfer-before2019
git checkout V1
cd ..
git clone https://github.com/opensourceBIM/BIMserver-JavaScript-API.git

Within the BIMvie.ws, create a new folder called deps and subfolder bimserverjsapi and bimsurfer-v1. Copy the *.js files from BIMserver Javascript API and BIMsurfer to these subfolders respectively.

cd BIMvie.ws
mkdir deps
mkdir deps/bimserverjsapi
mkdir deps/bimsurfer-v1
cp ../BIMserver-JavaScript-API/*.js deps/bimserverjsapi
cp -R ../BIMsurfer-before2019/api deps/bimsurfer-v1
cp -R ../BIMsurfer-before2019/lib deps/bimsurfer-v1

Adjust the paths

We need to adjust index.html and settings.js for the locations of BIMsurfer and BIMserver Javascript API.
NOTE: If you have chosen different folder names above other than deps/bimserverjsapi and deps/bimsurfer-v1, please use those.

Inside index.html, replace the following paths:

  • ../bimserverjavascriptapi/bimserverclient.js with ../deps/bimserverjsapi/bimserverclient.js
  • ../bimserverjavascriptapi/bimserverapipromise.js with ../deps/bimserverjsapi/bimserverapipromise.js

Inside settings.js, replace the following paths:

  • "/apps/bimserverjavascriptapi"; with "../deps/bimserverjsapi";
  • "../bimsurfer"; with "../deps/bimsurfer-v1";

NOTE:
These should not be committed, as they are specific to a particular build or deployment.

Deploy Bimvie.ws

Test on local machine

You can test BIMvie.ws on your local machine with any webserver, for example using python3 -m http.server. With this setup, you have to tell BIMvie.ws the URL of the BIMserver through an URL parameter api_address.

For example, if you run the BIMvie.ws on port 8000 (python3 default) and BIMserver on port 8082 (BIMserver default), you use the URL http://localhost:8000/?api_address=http://localhost:8082. The URL is stored in a cookie and you don't have to enter it again as long as you don't delete the cookie.

Build as a JAR file

Alternatively, you can bake the Javascript into BIMserver plugin JAR and then install it into your local Maven repo.

npm install
node_modules/.bin/grunt
mvn install

As an alternative to mvn install you can just do mvn package and find the BIMvie.ws plugin JAR in the target directory. You can then install the plugin into BIMserver. With this setup, BIMvie.ws and BIMserver come from the same server and you do not have to cater for the URL parameter. Instead, you select the web module from the BIMserver UI and BIMserver will provide its URL to the BIMvie.ws itself.

Clone this wiki locally