Skip to content

ProjectSidewalk/SidewalkWebpageDC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sidewalk Webpage

The Project Sidewalk webpage.

Development Instructions

Setting up the development environment

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:

  1. Email Mikey ([email protected]) and ask for the two API key files and a database dump. You will put the API key files into the root directory of the project. You will need the database dump later on. You can continue with the rest of the instructions here, but the website will not work fully until you've received these three files from Mikey.
  2. Install JDK 7 (or above), Scala, and activator on your computer. See detailed instructions for installing Scala environment here.
  3. Install Node.js. See detailed instructions here.
  4. On the top directory, run npm install to install all the JavaScript dependencies.
  5. Set up the Postgres database by folloing the tutorial. See detailed instructions on installing the Postgres database here.

Running the Application Locally

To run the web server locally,

  1. Make sure the Postgres is running locally on port 5432
  2. Run activator run on the top directory where build.sbt is located. This should start the web server. Note that the first time compilation takes time.
  3. 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. If grunt watch is not responding, you can run grunt concat and grunt concat_css to build the files.

Running the Application Remotely

To run the application remotely,

  1. 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
  2. Upload the zip file to the web server
  3. SSH into the server and unarchive the zip file (e.g., unzip filename).
  4. 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 command netstat -tulpn | grep :9000 and then use the kill command.