MIP Frontend is the web portal for the Medical Informatics Platform for the Human Brain Project.
The portal runs on React, a JavaScript library for building user interfaces, and embed several libraries, among them are:
- TypeScript, a typed superset of JavaScript
- D3.js and Highcharts, visualizations and interactive charts libraries
- Bootstrap, a frontend component library
- Unstated, a state library
This is a minimal setup to do frontend development in this project:
- Checkout the master branch of the mip-deployment-infrastructure project, and follow the setup instructions.
- Create a new line in
/etc/hosts
, so the backend will be accessible through http://frontend/servicessudo sh -c 'echo 127.0.1.1 frontend >> /etc/hosts'
- Launch
./run.sh
. You will have the MIP frontend running on your computer at http://frontend
This project was bootstrapped with Create React App.
You can find the most recent version of the Create React App guide here.
- Install nodejs
- Install yarn
- create a
.env
fileecho REACT_APP_BACKEND_URL = \"http://frontend\" | tee .env
yarn install
yarn watch
- Browse to http://localhost:3000
You can generate models and experiments by running the tests:
yarn test
You can use the mip-frontend test suite against any live installation, either locally
echo REACT_APP_BACKEND_URL = "https://qa.mip.chuv.ch" | tee .env &&
echo REACT_APP_TOKEN = "xxx" | tee -a .env &&
echo REACT_APP_JSESSIONID = "xxx" | tee -a .env &&
echo REACT_APP_AUTHORIZATION = "xxx" | tee -a .env
yarn test
or as a standalone docker
docker build . -f Dockerfile-test -t hbpmip/portal-frontend-tests
docker run -it \
-e BACKEND_URL="https://qa.mip.chuv.ch" \
-e TOKEN="c900a5c9-452e-4514-b8a8-c5dda02d03b6" \
-e JSESSIONID="2B5967D0870A33E2A55F5C9B641518FB" \
-e AUTHORIZATION="Basic c2dhMXJldmlld2VyczpIQlBzZ2Ex" \
--rm hbpmip/portal-frontend-tests:latest
Samples tests queries
hbpmip/portal-frontend-tests test
Tests run with Jest, see the jest cli doc for more details
Run: ./build.sh
Run: ./publish.sh
Copyright © 2016-2019 LREN CHUV
Licensed under the GNU Affero General Public License, Version 3.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.gnu.org/licenses/agpl-3.0.html
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This work has been funded by the European Union Seventh Framework Program (FP7/20072013) under grant agreement no. 604102 (HBP)
This work is part of SP8 of the Human Brain Project (SGA1).