/lux-frontend

Web front end of LUX

Primary LanguageTypeScriptApache License 2.0Apache-2.0

LUX Frontend

The lux-frontend repo is used to develop and maintain the frontend code for Yale LUX. The frontend contains custom components and interfaces that allow users to interact with linked data in a meaningful way.

This project was bootstrapped with Create React App, using the Redux and Redux Toolkit template.

Code structure

  • client/ contains React/Redux/TypeScript code for the Frontend single page application.
  • server/ contains code for the nodejs app that serves LUX frontend.
  • docker/ contains code to build the docker image

Running client (React app) locally without Docker nor server

Before completing these steps, ensure that all steps in the client folder README have been completed.

Make sure the file client/.env defines required environment variables -- see client/.env.template.

cd client/
yarn start

The AJAX call to /env will fail, but the application will work because it will use the values from the local .env (or .env.development.local) file instead.

For further instructions on client setup, go to the client folder README.

Running server locally

  1. Before completing these steps, ensure that all steps in the client folder README have been completed.
  2. Build the client first by running the following commands:
cd client/
yarn build
  1. Make sure the file server/.env defines required environment variables -- see server/.env.template.
cd server/
yarn install
yarn dev-prep
yarn dev

Running Docker container locally

The files build-docker-image.sh, run-docker-container.sh, and config.json are created for convenience in running docker locally. They are not used in deployment to dev/tst/prd.

Build

cd docker
./build-docker-image.sh

Config

cd docker
cp config.json.template config.json
# Populate config.json with real parameter values

Run

cd docker
./run-docker-container.sh

It will bring up the server at port 8080 by default.