Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
139 lines (93 sloc) 5.83 KB

Getting Started

This file is dedicated to getting you ready to start developing. If you have questions, head over to our slack channel and fire away!

Backend

We start with the backend, simply because it is required for you to have any functionality on the frontend. A high-level checklist is:

  • install java 8 (sdk & jre)
  • install maven version 3
  • install neo4j version 2.X.Y
  • logon localhost:7474 and change password
  • update password in application.properties in repo.
  • start with mvn exec:java -Dpippo.mode=dev

Setting up the backend

java 8

Java 8 (SDK & JRE) is required. Almost all os have a standard way of installing and upgrading java. These guides may work for you, but ideally you should look it up.

Test if you already have java 8 by running (any os):

  • JRE: java -version
  • SDK: javac -version

ubuntu/debian

  • JRE: sudo apt-get install default-jre
  • SDK: sudo apt-get install default-jdk

windows: Download the JRE and SDK from oracle.

os x/mac os: install homebrew, then brew install java

other linux

neo4j

Install the community edition, version 2.3.X where X is the highest you can find. Again, the installation process depends on your os/environment. Here is the official documentation. Below are summaries:

ubuntu/debian

  • install neo4j via apt-get (instructions)
  • run system neo4j start to start
  • run system neo4j stop to stop

windows

  • download the installer (.exe) from legacy
  • run it and install neo4j
  • start & stop neo4j using the neo4j-ce.exe program

mac

  • download the neo4j dmg from legacy
  • drag neo4j to your applications folder
  • use that program to start & stop a neo4j server

other linux

  • download a binary from legacy
  • untar it tar -xzf <neo4j-download.tar.gz>
  • run pwd to get current working directory
  • run echo 'export $PATH=/full/path/to/neo4j-download/bin/:$PATH' >> ~/.profile
  • run source ~/.profile
  • now your current and all new shells will be able to run the neo4j script
  • run neo4j start and neo4j stop to start & stop, respectively

After installation you should start a neo4j server and navigate to http://localhost:7474 and login using neo4j/neo4j. Choose a new password, and remember it. You will need it later on.

maven

Maven is a java package manager, amongst other things. We use version 3.

mac: install homebrew, then brew install maven30

general

Try your luck with the package manager, otherwise these links are handy:

First steps

After all required software has been installed you are ready to proceed.

  • Strap up! cd ~
  • Organise mkdir connect && cd ~/connect
  • Clone git clone git@github.com:emenlu/connect.git backend
  • Charge in cd backend
  • Open src/main/resources/conf/application.properties in your editor of choice
  • Change neo4j.password to what you entered previously in the web ui
  • Then run mvn compile exec:java
  • The backend will now create a superuser and initialize the database. (Make sure neo4j is running!)

Et voilà, you are ready!

In the future, run mvn compile exec:java -Dpippo.mode=dev. It executaes both commands sequentially and launches the server in dev mode.

Eclipse

To use Eclipse, simply import the backend files as a github repository. We recommend using a maven plugin to facilitate running the server.

Frontend

The frontend project is often much simpler to install since it only depends on nodejs, thus this section is mainly on how to install nodejs. The high-level checklist is:

  • install nodejs (v5 or v6)
  • run npm install in repo.
  • run make dev
  • browse to localhost:8181

Setting up the frontend

installing nodejs

The frontend relies on nodejs to compile page templates and style files. Node.js has its own package manager, called npm, which lists dependencies in a package.json file. Thus the only programs you need to manually install are npm and node. Thankfully, npm is bundled with node so installing node is sufficient.

Type node -v in a terminal to check version:

  • v5 and v6 are confirmed to work with the connect frontend
  • v7 and v8 are unknown

If you already have node v7 or v8 then you should install a version manager to switch between multiple version. Here are a few, though some only support specific operating systems:

The actual steps for installing Node.js vary depending on your operating system.

windows: Download the installer and run it. It will install node and npm and put them in your %PATH%.

mac os: Install with homebrew. brew install node@6

linux

Most popular linux distros have up-to-date packages of node and this is the easiest way to install nodejs. There is a guide here on doing this.

If this fails you must download a tarball and put node and npm into /usr/bin or similar. Some linuxes have a program called alternative to symlink files into /usr/bin.

installing packages

Type npm install in the repository to install all dependencies. Then try to run the dev. server using make dev. If this fails, report to Axel. Otherwise you are good to go!