Skip to content

Development Environment Setup

umov edited this page Aug 30, 2017 · 75 revisions

Required Software

Java

The XCoLab is written in Java. You will need to install JDK 8 if you don't already have it, you can get it here.

Mysql

In order to run the XCoLab locally, you will need to install MySQL. If you're on macOS with homebrew, see below for instructions, otherwise see MySQL's getting started guide.

  1. Install MySQL

    brew install mysql
    mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
  2. Make sure MySQL is running

    # Install the brew services untility
    brew tap homebrew/services
    
    # now you can start/stop/restart mysql easily (persists across restarts)
    brew services start mysql

Setup for Development

  1. Clone the XCoLab GitHub repository: https://github.com/CCI-MIT/XCoLab.

  2. Create a database that uses "utf8mb4 collation" encoding and specify a user & password:

    mysql -u root -p -e 'CREATE DATABASE xcolab CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'
  3. Copy the file conf/application.properties to ~/.xcolab.application.properties and edit it to match your local configuration for mysql:

    cp conf/application.properties ~/.xcolab.application.properties
    
  4. Configure your database schema and initial data. You can use our database starter scripts to get started with a new XCoLab instance:

    cat sql/starter/xcolab-schema.sql | mysql -u root -p xcolab
    cat sql/starter/xcolab-data.sql | mysql -u root -p xcolab
    

Running a build and starting the servers

Using the command line

  1. You can build all artifacts by running ./mvnw package from the root directory of the repository.

  2. You can start all servers by running ./startAll.sh in the root directory.

    Note: starting all servers will take a few minutes, but restarting only some of them will be much faster.

  3. You can follow the progress by tailing all logs at once with this utility script: ./tailAll.sh

  4. Once all servers are started (no more log output), you can access the site here: http://localhost:18082/

Using an IDE

Instead of building and running the servers from the command line, we recommend you use an IDE. We use IntelliJ IDEA, so here's a guide how to work with it:

Clone this wiki locally