Developer Docs

Building and Deploying SpringBot



When the client-side is built, the transpiled files are placed inside of the directory they are to be served from.

Perform the following steps to build your client-side.

  1. Open a terminal in the clientside directory projectName/clientside
  2. Install dependencies, enter: npm install
  3. Run the build step, enter: npx ng build --prod --optimization=false Note: We are currently temporarily disabling optimization due to some small issues that it causes.

You will now have all the build artefacts for the client-side in serverside/src/main/resources/static.


Before bundling your application, ensure that all properties are set in the relevant profiles, found at

To avoid adding sensitive URLs and passwords to the git repo, we recommend reading them from environment variables. You can do so by adding properties like the following snippet.


This properties file tries to read environment variables named DATA_SOURCE_URL, DATA_SOURCE_USERNAME, DATA_SOURCE_PASSWORD, and HIBERNATE_DDL. The text that follows the environment variable name and colon : is the default value which is used if the environment variable has not been set when the serverside is run. E.g. user will be the default username if DATA_SOURCE_USERNAME has not been set as an environment variable.

To complete this process for deployment, follow the instructions to build the server-side. This will cause the client-side and server-side to be bundled together.

For Windows, use gradlew.bat in place of gradlew in all commands.

You have the option to build two different types of artifacts. A JAR or a WAR.


Go to server-side folder

./gradlew bootJar

./gradlew.bat bootJar


Go to server-side folder

./gradlew bootWar

./gradlew.bat bootWar

Both artefacts can be found in /build/libs.

Running the Complete Application

For development, it is suggested to run both sides separately to take advantage of the tooling available for both technologies.

  1. Setup environment (See Setting Up Your Development Environment: Linux for details).
  2. Build Client-side (See above)
  3. Build Server-side (See above)
  4. Export any environment variables required for your environment (test, dev, prod)


export DATA_SOURCE_USERNAME=codebots

If you intend on running the application with the same configuration on the same computer or virtual machine, you may want to create a script to repeat this step every time you launch.

  1. Create a file named containing the environment variables you wish to set
  2. Before running the server, run source
  3. Run java -jar ${artifact-name}.jar (this could also be a WAR).

Unlike running the server-side and client-side individually running the JAR and WAR files use the port 8080. Go to localhost:8080

If you wish to run the application using the production profile, you will need to set up https and create an SSL certificate. This can be done with apache2 using a reverse proxy to redirect to localhost:8080.

On this page