Skip to content

Getting started

Sallah Kokaina edited this page Jul 27, 2017 · 21 revisions

Dependencies

Java 8 JDK

  • jdk1.8.x is required for developers to build and compile application. You can download and install it from here.

Install sbt

  1. On Windows by following this documentation here the link . After install, ensure that your %SBT_HOME%\bin,is added to the Path environment variable, this should be automatically done if you are using .msi package.
  2. On Linux by following this link.
  3. Proxy config. To use sbt from behind a proxy, we should update settings on the %SBT_HOME%\conf\sbtconfig.txt file by adding the following lines:
Proxy settings
-Dhttp.proxyHost=192.168.0.150 
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=192.168.0.150 
-Dhttps.proxyPort=8080

Note: Don't forget, if you are using "java sbt-launch.jar" (through and IDE plugin maybe). You need to add these proxy settings to your JVM options.

Install npm

  1. On Windows by following this link
  2. On Linux by running sudo apt-get install npm
  3. Proxy config, To use npm from behind a proxy
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

Configure bower

Bower is by default injected as an npm module for our project. Here we recommend only to configure proxy for the local project.

  1. Proxy Config once your project is cloned, and before doing sbt compile (see install section), you should add/update the following parameters in .bowerrc file.
  "proxy": "http://yourProxy:yourPort",
  "https-proxy":"http://yourProxy:yourPort",
  "strict-ssl": false

Install mongodb

Mongodb is required to persist data. We recommend using v3.2.11 (>= 2.6.x & < 3.3.x). Please note, that the 3.4 version is not already supported.

  1. On Windows by following this link
  2. On linux you can downoload package or use sudo apt-get install mongodb
  3. Run a mongod process

Install

  • Clone the project from github repository then install sbt dependencies by running the following commands. These steps may took a while.
git clone https://github.com/toast-tk/toast-tk-webapp.git && cd toast-tk-webapp
sbt install
  • Download and install front-end dependencies and libraries by running the following command:

sbt compile

or Manually by running (not really recommanded, unless sbt compile don't work)

npm install
node ./node_modules/bower/bin/bower install
node ./node_modules/gulp/bin/gulp
rm -rf ./app/assets/libs
mv -f ./libs ./app/assets
  • Define the environment properties that are part of conf/application.conf:
MONGOHQ_URL: mongodb db uri, for a local and default install -> "mongodb://localhost:27017/play_db"
SENDGRID_RECIPIENTS: list of administrator emails separated by a comma ","
SENDGRID_APIKEY: valid sendgrid api key if you are willing to use the registration functionality
  • Start the webapp server by running the following command:
sbt run

By default this will run a NettyServer listening for HTTP on Listening for HTTP on /localhost:9000

  • Go to your favorite browser
http://localhost:9000/
  • Connect to the webapp : default username/password is admin/admin

Deploy

To create a deployable distribution of the webapp, run sbt dist. This will create target\universal\toast-tk-webapp-x.x.x.zip.

You can transfer this package to your server, unpackage it then run ./bin/toast-tk-webapp(.bat)

Clone this wiki locally