Skip to content

Setting up your dev environment

Slin Lee edited this page Mar 9, 2021 · 20 revisions

Prerequisites

  • Install Vagrant
  • Install VirtualBox
  • Clone the Webapp repo
  • Set environment variables
    • Copy the 'vagrant-user-env.sh.example' file: cp vagrant-user-env.sh.example vagrant-user-env.sh
    • Fill in the variables in vagrant-user-env.sh.

These instructions are meant to be run in the root folder once you clone the pathmind-webapp repo.

If you have Vagrant installed (vagrantup.com), you can set up a local environment with this command:

> vagrant up

This will build a VM and install all the prerequisites and set up the local database.

You can edit files normally using your favorite IDE outside the VM, and then run the server with these commands:

> vagrant up                     // This boots the vm
> vagrant ssh                    // This logs you into the VM
> ./start-pathmind.sh            // Builds and runs the Webapp and Updater

This might vary system by system, but you can connect to the webserver at 127.0.0.1:8080

Optional: The script runs the webapp and updater in a tmux session. Check out tmux documentation to better view the logs or start/restart those processes.


start-pathmind.sh does the following things for you:

  1. Build the shared libraries: mvn clean install -DskipTests
  2. Build and run pathmind-webapp: pathmind-webapp> mvn spring-boot:run
  3. Build and run pathmind-updater: pathmind-updater> mvn spring-boot:run

The web app and updater need to both be running for the app to work.


Troubleshooting tips:

  • vagrant provision will run the setup script again. This is good if for some reason the environment variables aren't set up correctly, etc
  • In more extreme cases, you can start from scratch with vagrant destroy and then vagrant up
  • Make sure your VM has enough RAM allocated to it. This shouldn't be the case anymore, but if you see a JAVA OOM error/Heap Space error you can increase the ram for the VM.

The Vagrantfile can be found here if you're interested

Clone this wiki locally