Skip to content

Latest commit

 

History

History
71 lines (61 loc) · 3.27 KB

README.md

File metadata and controls

71 lines (61 loc) · 3.27 KB

The dSpaceX Web Client

The web client for dSpaceX relies on HTML5 which is supported by all modern browsers. It uses Node.js and the Webpack bundler to build the javascript application. Webpack runs on the Node.js runtime. This project uses the Node npm package manager (as opposed to yarn). Steps for installing and building follow:

Installation

  1. Install the client depedencies locally for the project - be sure you are running in the dspacex conda environment first NOTE: Requires nodejs (version 8.9.4 LTS or greater), which is already installed by conda_installs.sh (see main README.md).
<.../dSpaceX> conda activate dSpaceX
<.../dSpaceX>$ cd client
<.../dSpaceX/client>$ npm install

This will create a local directory under <.../dSpaceX/client> called node_modules containing all the source code for dependencies pulled in through the package manager.

Running

  1. Activate the dspacex conda environment, run the build script, and start the server
<.../dSpaceX/client> conda activate dSpaceX
<.../dSpaceX/client>$ npm run build
<.../dSpaceX/client>$ npm run server

This creates a file called 'client.bundle.js' in the client/build folder.

  1. Open dSpaceX in your browser by either opening dSpaceX.html or simply using the localhost url
file:///.../dSpaceX/client/dSpaceX.html
http://localhost:8080/

*NOTE: currently only the Google Chrome browser is actively supported, but other browsers will likely still work.

Development

For dSpaceX development, there is a debuggable server with automatic updates when source files are changed.
Note: The release bundle is significantly smaller and notably faster than the development server.

  1. Activate dspacex conda environment and run the start script
<.../dSpaceX/client> conda activate dSpaceX
<.../dSpaceX/client>$ npm start

By defaut, port 8080 is used, but you can select a different port by adding -- --port <num> (ex: npm start -- --port 3001) (note the extra dashes between npm start and --port)

  1. Connect to localhost:/dSpaceX.html in browser
http://localhost:8080/dSpaceX.html

Running a "watch" server

This is similar to a development server but it will not auto-refresh when a file changes, only when the browser is refreshed.

  1. Activate dspacex conda environment and run watch script in one terminal
<.../dSpaceX/client> conda activate dSpaceX
<.../dSpaceX/client>$ npm run watch

By defaut, development mode is used, but you can build the optimized version by passing -- --mode production to the command. (note the extra dashes between npm run watch and --mode)

  1. In a second terminal, activate dspacex conda environment and run a local http server
<.../dSpaceX/client> conda activate dSpaceX
<.../dSpaceX/client>$ npm run server

As before, 8080 is the default port, but a different port can be used by adding -- --port <num> (ex: npm run server -- --port 3000) (note the extra dashes between npm run server and --port)

You may need to force the web page to reload using ctrl + shift + r or command + shift + r in order to ignore the browser cache.