IDE Setup - IntelliJ Community Edition

Setup, run and debug your SpringBot application with IntelliJ Community Edition.


Every developer has their own preferences when it comes to the tools they use. This guide will walk through the process of setting up and using IntelliJ (Community Edition) to work with a SpringBot application. Since the Community Edition of IntelliJ doesn’t natively support TypeScript or JavaScript, you may choose to include some available Enterprise plugins or purchase IntelliJ Ultimate.

IntelliJ Community Edition

  1. Download and install the latest version of IntelliJ Community Edition
  2. After install, Open IntelliJ and click “Skip Remaining and Set Defaults”
    Image
  3. You should now be presented with the following screen:

Image

Select Open and navigate to the repository folder
  1. We need to import the Gradle module. This can be done File -> New -> Module from Existing Sources… Select the serverside and click open.
  2. In next the popup window pick Import module from external model and highlight Gradle then click finish

Image

  1. On the bottom right of the screen there should be a small popup. Select Import Gradle Project

Image

Running the Server-Side

  1. Click Add Configuration
  2. Add a new configuration by clicking the + icon and select Gradle
  3. In Gradle Project, click the folder icon and select the your project’s name
  4. Type bootRun in the Tasks textfield
  5. In the Environment Variables copy and paste the following: SPRING_PROFILES_ACTIVE=dev;DATA_SOURCE_USERNAME=codebots;DATA_SOURCE_PASSWORD=bots;DATA_SOURCE_URL=jdbc:postgresql://localhost:5432/codebots
    Image
  6. Now you can successful run the serverside through the IDE.

Running the Server-Side in Debug

Running the server-side in debug is as simple as clicking the bug icon instead of the play button. You can also use IntelliJ’s breakpoints to step through the application.

Running the Client-Side

You can use the terminal within IntelliJ to run the client-side.

  1. To open the terminal go to View -> Tools Window -> Terminal
  2. Make sure you change directory to the clientside
  3. If this is the first time running the client-side, you will need to run npm install first
  4. Use npx ng serve to run the clientside

Running the Client-Side in Debugger

Since Typescript and Javascript support is not supported by free plugins, you can use Chrome to debug the client-side. You can add debugger in your code base at the line you want to focus on, and this will trigger your browser to add a breakpoint in that same spot.

Last updated: 16 December 2019


Start modelling your app today.