×
Back to book

SpringBot: Setting Up Your Development Environment: Windows

Setting up your SpringBot development environment for Windows 10.

The following steps will walk you through the process of setting up your development environment for Windows 10

Approximate setup time is 30-40 minutes.

For this process, we recommend Chocolatey to manage packages and Powershell for the command prompt.

Powershell

To run Powershell as an Administrator:

  1. Press the Windows Key

  2. Start typing "powershell"

  3. Right click on the "Windows Powershell" app and choose "Run as Administrator"

Chocolatey

Chocolatey is a package manager for windows. The following steps are to be run in Powershell.

  1. To install Chocolatey, copy and paste the following text into your terminal:

    Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  2. Check that your install has succeeded, copy and paste the following text into your terminal:

    choco --version

    You should see something like the following,

    $ choco --version
    0.10.15

Java

  1. To install JDK 11 on Windows, copy and paste the following into your choice of terminal and press enter.

    choco install adoptopenjdk --version 11.0.2.9 -y

    Depending on your Internet speed, this may take a while as packages are downloaded and installed. When the process is finished you should see something like this:

    This is the Adopt Open JDK Build.

  2. To check that the install has succeeded, restart your terminal session or run refreshenv, and copy and paste the following text into your terminal:

    java  --version

    You should see something like the following,

    $ java --version
    openjdk 11.0.2 2019-01-15
    OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.2+9)
    OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.2+9, mixed mode)

Node and Angular

  1. To install Node, copy and paste the following into your terminal and press enter:
choco install nodejs --version 8.9.3 -y
  1. Refresh environment variables (or restart your terminal session) and check installation

Run the following commands:

refreshenv
node --version

You should see something like the following,

$ node --version
v8.9.3

Ensure that your node version is 8.9.3.

  1. Check that we have the correct version of NPM, copy and paste the following text into your terminal:
npm --version

You should see something like the following,

$ npm --version
5.5.1
  1. (Optional) Install Angular CLI globally. This step is recommended for ease of use, but not strictly necessary. If you omit this step, all Angular CLI commands can be achieved by invoking the local version by prefixing all commands with npx, e.g. ng serve would become npx ng serve.

To install Angular on Windows copy and paste the following into your choice of terminal and press enter.

npm install -g @angular/cli@7.3.1

After this has finished, runningng version should provide the following output:

PostgreSQL

SpringBot is primarily built around using the PostgreSQL database, though it can use others. To run a SpringBot application, you must have a database setup.

  1. To install, copy the following into your terminal and press enter:
choco install postgresql --params '/Password:bots' --params-global -y

Once completed, you will see something like the following,

Install pgAdmin

pgAdmin is a useful database explorer that works with PostgreSQL. You can download it for free from from the pgAdmin website, or you can use the Direct Download Link

Create databases and roles

From here you can either use pgAdmin or the command line to create and manage your databases but this guide will use pgAdmin to interface with the database.

If you aren't connected already, connect to the Postgres server using the password defined in the PostgreSQL install command above (bots).

  1. Right click on the local PostgreSQL server and select 'Connect Server':

  2. Enter the password and press "OK"

We now need to create a new user and database in Postgres to allow Codebots target application to interact with.

  1. Create a new "Login/Group Role". Right click on the "PostgreSQL" server and select "Create" > "Login/Group Role...":

  2. Under the "General" tab, enter the "Name" codebots"

  3. Click the "Definition" tab and enter the "Password" bots:

  4. Click the "Privileges" tab and set the "Superuser?" and "CanLogin" toggle to "Yes":

  5. Click "Save" to create the new Role.

Now to create the new database:

  1. Right click on "Databases" and select "Create" > "Database...":

  2. Under the "General" tab, enter the "Database" codebots" and select the "Owner" codebots:

  3. Click the "Definition" tab and select the "Encoding" UTF8 and "Template" template0:

  4. Click "Save" to create the new Database.

If everything was executed properly you would have successful create database and user called codebots, like the image below.

Gradle

  1. To install Gradle on Windows copy the following into your terminal and press enter:

    choco install gradle --version 5.2.1 -y

    When this is complete you should see the successful install message.

  2. Check that we have the correct version of Gradle, restart your terminal session or run refreshenv and copy and paste the following text into your terminal:

    gradle --version

    You should see something like the following,

    $ gradle --version
    
    Welcome to Gradle 5.2.1!
    
    ....

This completes the server setup required to run your SpringBot application! You can now setup your local development environment to start editing your SpringBot application, then run your application.