HuBMAP Data Portal: This is a Flask app, using React on the front end and primarily Elasticsearch on the back end, wrapped in a Docker container for deployment using Docker Compose. The front end depends on AWS S3 and CloudFront for the hosting and delivery of images. It is deployed at portal.hubmapconsortium.org
The Data Portal depends on many APIs, and directly or indirectly, on many other HuBMAP repos.
graph LR
gateway
click gateway href "https://github.com/hubmapconsortium/gateway"
top[portal-ui] --> commons
click top href "https://github.com/hubmapconsortium/portal-ui"
click commons href "https://github.com/hubmapconsortium/commons"
top --> ccf-ui
click ccf-ui href "https://github.com/hubmapconsortium/ccf-ui"
top --> vitessce --> viv
click vitessce href "https://github.com/vitessce/vitessce"
click viv href "https://github.com/hms-dbmi/viv"
top --> portal-visualization --> vitessce-python
click portal-visualization href "https://github.com/hubmapconsortium/portal-visualization"
click vitessce-python href "https://github.com/vitessce/vitessce-python"
top --> cells-sdk --> cells-api --> pipe
click cells-sdk href "https://github.com/hubmapconsortium/cells-api-py-client"
click cells-api href "https://github.com/hubmapconsortium/cross_modality_query"
top --> gateway
gateway --> entity-api --> pipe[ingest-pipeline]
click entity-api href "https://github.com/hubmapconsortium/entity-api"
click pipe href "https://github.com/hubmapconsortium/ingest-pipeline"
gateway --> assets-api --> pipe
%% assets-api is just a file server: There is no repo.
gateway --> search-api --> pipe
click search-api href "https://github.com/hubmapconsortium/search-api"
gateway --> workspaces-api
click workspaces-api href "https://github.com/hubmapconsortium/user_workspaces_server"
pipe --> valid
pipe --> portal-containers
click portal-containers href "https://github.com/hubmapconsortium/portal-containers/"
subgraph APIs
entity-api
search-api
cells-api
assets-api
workspaces-api
end
subgraph Git Submodules
valid
end
subgraph Python Packages
commons
portal-visualization
vitessce-python
cells-sdk
end
subgraph NPM Packages
vitessce
viv
end
subgraph cdn.jsdelivr.net
ccf-ui
end
subgraph legend
owner
contributor
not-harvard
end
classDef contrib fill:#ddffdd,stroke:#88AA88,color:#000;
class owner,contributor,top,vitessce,viv,portal-visualization,vitessce-python,cells-sdk,portal-containers,valid,search-api contrib
classDef owner stroke-width:3px,font-style:italic,color:#000;
class owner,top,vitessce,viv,portal-visualization,vitessce-python,portal-containers owner
style legend fill:#f8f8f8,stroke:#888888;
Issues with the Portal can be reported via email. More information on how issues are tracked across HuBMAP is available here.
We try to have a design ready before we start coding.
Often, issues are filed in pairs, tagged design
and enhancement
.
All designs are in Figma.
(Note that if that link redirects to /files/recent
, you'll need to be added to the project, preferably with a .edu
email, if you want write access.)
git
: Suggest installing Apple XCode.python 3.9
conda create -n portal python=$(cat .python-version)
brew install pyenv
brew install pyenv-virtualenv
pyenv install `cat .python-version`
pyenv virtualenv `cat .python-version` portal
pyenv activate portal
nodejs/npm
: Suggest installing nvm and then using it to install the appropriate node version: nvm install
.
nvm install `cat .nvmrc`
nvm use `cat .nvmrc`
Optional:
VS Code
, with recommended extensions.
docker
./etc
directoryAfter checking out the project, cd-ing into it, and setting up a Python 3.9 virtual environment,
app.conf
from Confluence or from another developer and place it at context/instance/app.conf
.etc/dev/dev-start.sh
to start the webpack dev and flask servers and then visit localhost:5001.
dev-start
task, which will launch these services in separate terminal windows.The webpack dev server serves all files within the public directory and provides hot module replacement for the react application; The webpack dev server proxies all requests outside of those for files in the public directory to the flask server.
Note: Searchkit, our interface to Elasticsearch, has changed significantly in the latest release. Documentation for version 2.0 can be found here.
Every PR should be reviewed, and every PR should include a new CHANGELOG-something.md
at the root of the repository. These are concatenated by etc/build/push.sh
during deploy.
Python unit tests use Pytest, front end tests use Jest, and end-to-end tests use Cypress. Each suite is run separately on GitHub CI.
Load tests are available, but they are not run as part of CI.
cd context; npm run test
cd end-to-end; npm run cypress:open
test
environment enabled in app.confcd context; pytest app --ignore app/api/vitessce_conf_builder
CI lints the codebase, and to save time, we also lint in a pre-commit hook.
If you want to bypass the hook, set HUSKY_SKIP_HOOKS=1
.
You can also lint and auto-correct from the command-line:
cd context
npm run lint
npm run lint:fix
EXCLUDE=node_modules,etc/dev/organ-utils
autopep8 --in-place --aggressive -r . --exclude $EXCLUDE
To start storybook locally you can either run etc/dev/dev-start.sh
, or just npm run storybook
,
and after it has started, visit localhost:6006.
The build, tag, deploy, and QA procedures are detailed here.
Instructions for Production are provided here.
The portal team contributes code to a subdirectory within search-api
to clean up the raw Neo4J export and provide us with clean, usable facets.
Within that directory, config.yaml
configures the Elasticsearch index itself.
Data visualization is an integral part of the portal, allowing users to view the results of analysis pipelines or raw uploaded data easily directly in the browser. How such data is processed and prepared for visualization in the client-side Javascript via vitessce
can be found here.
General-purpose tools:
viv
: JavaScript library for rendering OME-TIFF and OME-NGFF (Zarr) directly in the browser. Packaged as deck.gl layers.vitessce
: Visual integration tool for exploration of spatial single-cell experiments. Built on top of deck.gl.vitessce-python
: Python wrapper classes which make it easier to build configurations.Particular to HuBMAP:
portal-visualization
: Given HuBMAP Dataset JSON, creates a Vitessce configuration.portal-containers
: Docker containers for visualization preprocessing.airflow-dev
: CWL pipelines wrapping those Docker containers.