The Project Sidewalk webpage.
Set up the development environment for Scala, JavaScript and Postgres. The detailed instructions for each software component and more on server management instructions are provided here. You can start off using the steps below:
- Install JDK 7 (or above), Scala, and
activator
on your computer. See detailed instructions for installing Scala environment here. - Install Node.js. See detailed instructions here.
- On the top directory, run
npm install
to install all the JavaScript dependencies. - Set up the Postgres database by folloing the tutorial. See detailed instructions on installing the Postgres database here.
To run the web server locally,
- Make sure the Postgres is running locally on port 5432
- Run
activator run
on the top directory wherebuild.sbt
is located. This should start the web server. Note that the first time compilation takes time. - For the web application to run, you have to build the JavaScript and CSS files.
To do this, run
grunt watch
so the changes you make to SVLabel JavaScript library will be automatically built on file updates. Ifgrunt watch
is not responding, you can rungrunt concat
andgrunt concat_css
to build the files.
To run the application remotely,
- Use Play's dist tool to create jar files of the project (i,e.,
activator dist
): https://www.playframework.com/documentation/2.3.x/ProductionDist - Upload the zip file to the web server
- SSH into the server and unarchive the zip file (e.g.,
unzip filename
). - Run
nohup bin/sidewalk-webpage -Dhttp.port=9000 &
(reference). Sometimes the application tells you that port 9000 (i.e., default port for a Play app) is taken. To kill an application that is occupying the port, first identify pid with the netstat commandnetstat -tulpn | grep :9000
and then use thekill
command.