Skip to content

Local Frontend Testing Guide

David Huculak edited this page Oct 13, 2017 · 16 revisions

Below is a guide for running the ConU CoursePlanner frontend on your local machine for faster testing than having to do a full build + deploy each time you make a change. This is not the only way to get this working but it is the way that I have got it working for myself and it's very simple so I recommend this method.

Software dependencies:

Install the following programs:

  • nodejs - to build the frontend
  • IntelliJ or any static file server - to serve the static frontend files (html, css, js) locally
  • nginx - to redirect (a.k.a. proxy) all backend requests to our remote server

maven does not need to be installed for this to work

Setting up your local server

  1. Open IntelliJ, go to Settings -> Build, Execution, Deployment --> Debugger --> Built-in server and make note of the listed port number (I believe the default is 63342).

  2. Navigate to the conf/ folder in the location where you installed nginx. Open up the file name nginx.conf and replace the contents of the file with my configuration sample file.

  3. If needed, replace the port number (127.0.0.1:63342) with the one you found in step 1.

  4. Start nginx by navigating to the location where you installed nginx and run the program:

    On Windows

    ./nginx.exe
    

    On Linux

    TBD
    

Testing the site

  1. Navigate to the root folder of the project and run the frontend build command(s):

    Install node dependencies if needed

    npm install
    

    Build frontend

    npm run build-dev
    
  2. Open up localhost on your browser or click the link: http://localhost/

  3. Make changes to code (I reccomend changing a string value in src/main/webapp/babel-src/util.js), do step 1 then refresh the page.

Don't forget that for this specific setup, you will need both IntelliJ and nginx to be running otherwise http://localhost/ won't work

Clone this wiki locally