Skip to content

FNNDSC/ChRIS_store_ui

Repository files navigation

ChRIS logo ChRIS_store_ui

UI for the ChRIS Store.

Homepage

MIT License Last Commit Stars Forks

Quickstart

First, get the ChRIS store backend running. Assuming the backend is on http://localhost:8010/api/v1/:

docker run --rm -d --name chris_store_ui -p 3000:3000 -e REACT_APP_STORE_URL=http://localhost:8010/api/v1/ fnndsc/chris_store_ui:latest

Preconditions

Install latest Docker. Currently tested platforms:

Optionally get the backend services up so you can fully test the UI against actual data

  • Install latest Docker Compose
  • On a Linux machine make sure to add your computer user to the docker group

Then open a terminal and fire the backend services up:

$ git clone https://github.com/FNNDSC/ChRIS_store.git
$ cd ChRIS_store
$ ./make.sh up

You can later remove all the backend containers and release storage volumes with:

$ cd ChRIS_store
$ ./make.sh down

Start UI development server

Using node and yarn package manager directly on the metal

Open a new terminal and type:

$ git clone https://github.com/FNNDSC/ChRIS_store_ui.git
$ cd ChRIS_store_ui
$ yarn install
$ yarn start

Using docker

Open a new terminal and type:

$ git clone https://github.com/FNNDSC/ChRIS_store_ui.git
$ cd ChRIS_store_ui
$ docker run --rm -it -v "$(pwd):/home/localuser" -p 3000:3000 -u $(id -u):$(id -g) --name chris_store_ui fnndsc/chris_store_ui:dev

Open http://localhost:3000 to view it in the browser.

Precommit

Before each commit, a precommit script is run automatically to ensure all tests pass and all JavaScript code follows the Airbnb style guide.

Please note that if you are using the docker commands then you need to run git inside the container. For instance open a new terminal and type:

$ docker exec -it chris_store_ui git status

Notes:

  1. Add .env.local, .env.local, .env.development.local, .env.test.local, .env.production.local file at root to change any local settings

Additional Notes from Create React App:

This project was bootstrapped with Create React App.

Run the interactive tests

Using node and yarn package manager directly on the metal

Open a new terminal and type:

$ yarn test

Using docker

Open a new terminal and type:

$ docker exec -it chris_store_ui yarn test

Launches the test runner in the interactive watch mode.

See the section about running tests for more information.

Build the ChRIS Store UI app for production

$ cd ChRIS_store_ui
$ docker build -t local/chris_store_ui .

It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

Deploy and serve the ChRIS Store UI app

$ docker run --name chris_store_ui -p <desired port>:3000 -d local/chris_store_ui

Development and deployment of the ChRIS Store UI directly on the metal

Consult the Wiki here.

Learn More

Interested in contributing? https://chrisproject.org/join-us

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.