WHOI HABhub Data Portal
Is being developed as a data access and visualization portal for the New England Harmful Algal Bloom Observing Network.
https://github.com/WHOIGit/whoi-hab-hub
Category: Biosphere
Sub Category: Marine Life and Fishery
Keywords from Contributors
optimize transforms archiving measur observation compose conversion animals projection generic
Last synced: about 13 hours ago
JSON representation
Repository metadata
Harmful Algal Bloom data API and map project
- Host: GitHub
- URL: https://github.com/WHOIGit/whoi-hab-hub
- Owner: WHOIGit
- License: gpl-3.0
- Created: 2018-12-14T18:12:29.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2025-12-08T18:29:01.000Z (22 days ago)
- Last Synced: 2025-12-28T09:58:34.406Z (2 days ago)
- Language: Python
- Homepage:
- Size: 39 MB
- Stars: 8
- Watchers: 8
- Forks: 1
- Open Issues: 5
- Releases: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
README.md
WHOI HABhub Data Portal
Harmful Algal Bloom data API and map project. Our current version for Public Beta is now live! https://habhub.whoi.edu/
The "HABhub" data portal is being developed as a data access and visualization portal for the New England Harmful Algal Bloom Observing Network (neHABON).
There are two separate applications that comprise the HABhub:
- a backend data server that provides a REST API. Built using the Django Python framework. You can find this app in the
habhub-dataserverdirectory. - a frontend client to visualize the data with an interactive map and charts. Built with the React JS framework. Located in the
habhub-react-frontenddirectory.
These applications can run together on a shared machine as a single service or be set up independently of each other. The frontend client only needs to be configured with the base URL of the backend data server to access its API.
Local Deployment with Docker
This project is configured to be deployed both locally and in production using Docker and Docker Compose. The default local deployment uses Docker Compose to run both applications in a single network from one local.yml compose file.
Steps for initial Local Deployment:
- Docker and Docker Compose installed: instructions
- Clone repo to your local computer:
git clone https://github.com/WHOIGit/whoi-hab-hub.git - Create local
.envfiles for both Django data server and React frontend client. Continued below...
Step 3 details
HABhub uses environmental variables for configs such as API links, API tokens, and secrets like database usernames/passwords.
These variable should NOT be kept in version control.
For the Django Data Server
The habhub-dataserver directory contains the Django backend application. This directory also includes a .envs.example directory that you can use as
a template to create your own .envs directory and files. HABhub requires this ".envs" directory to be in the Django application root level directory. (ex. environmental variables file path: habhub-dataserver/.envs/.local/.django)
Final directory structure:
habhub-dataserver
-- .envs/
-- .local/
-- .django
-- .postgres
-- .production/
-- .django
-- .postgres
For the React Frontend Client
The habhub-react-frontend directory contains the React frontend application. Create a new default .env file in this directory using the provided .env.example file as a template. You can also use the example .env.development and .env.production files to set different values for environmental variables depending on the environment. Any variable named in one of these environment specific files will be used instead of the default value in the regular .env file.
The required environmental variables are:
- REACT_APP_API_URL
- REACT_APP_MAPBOX_TOKEN
The REACT_APP_API_URL is the base URL of the HABhub data server you want to use. In the default local set up, this is http://localhost:8000/
The REACT_APP_MAPBOX_TOKEN is the API token for Mapbox access. To get a Mapbox GL JS token, create an account here
You can also change the default initial map configuration settings for both the latitude/longitude and zoom:
- REACT_APP_MAP_LATITUDE
- REACT_APP_MAP_LONGITUDE
- REACT_APP_MAP_ZOOM
Step 4
Open your terminal and cd to the root level of the whoi-hab-hub directory. Run the following Docker Compose commands:
docker-compose -f local.yml build
docker-compose -f local.yml up
For the Django app, you need to run the initial DB migrations. Open up a second terminal and run:
docker-compose -f local.yml run --rm django python manage.py migrate
Then create the initial superuser, run:
docker-compose -f local.yml run --rm django python manage.py createsuperuser
The frontend map application will now be available at: http://localhost:3000/
The backend data server will be available at: http://localhost:8000/
To access the Django admin system, login with your new superuser credentials at: http://localhost:8000/admin
Initial HABHub Data Server Configuration
Login to the Django admin panel to access the HABHub Data Server settings.
There are two Core data models that need to be configured to work with the HABHub React Frontend Client and the IFCB Dashboard.
Data Layers
These are the different data layers that are available to display on the frontend HABHub map. By default, all of them are active. To remove a data layer from the frontend map, edit it and simply uncheck the "Is Active" checkbox.
http://localhost:8000/admin/core/datalayer/
Target Species
This is the list of HAB species that are available for both data ingestion from a IFCB Dashboard and to interact with in the frontend map.
http://localhost:8000/admin/core/targetspecies/
The default list is pre-configured with the six species of interest from the main https://habhub.whoi.edu/ site. To ingest IFCB data for a species from an IFCB Dashboard, you just need to make sure that the "species_id" field matches the text string that is used in the IFCB dashboard Autoclass files to identify the species. Ex. file: https://habon-ifcb.whoi.edu/harpswell/D20200221T223958_IFCB000_class_scores.csv
You can also choose the primary color for each species for display on the map. A color gradient using that color is automatically created when you change a species color
IFCB Datasets Layer
To configure this data layer, you need to first create some Dataset objects in the admin panel:
http://localhost:8000/admin/ifcb_datasets/dataset/
These Datasets should match with an existing Dataset in your IFCB Dashboard. The "Dashboard id name" field needs to be set to the unique ID from the IFCB Dashboard. This can be found in the IFCB Dashboard URL for the dataset, ex: https://habon-ifcb.whoi.edu/timeline?dataset=harpswell, or at the bottom of the "Basic Info" box in the Dashboard.
Once a Dataset is created in HABhub, data from the Target Species will begin to automatically be ingested on an hourly basis. No further configuration is necessary.
Shellfish Toxicity Layer
First create some geographic Station locations in the admin panel that are providing Shellfish Toxicity data. You can then import data from a CSV for each Station using the Datapoint importer:
http://localhost:8000/admin/stations/datapoint/import/
Closures Layer
This layer is very dependent on specific state government data and protocols. Example data is available for some New England states, but this layer requires custom set up for new states and is still under development.
Steps to update Local Deployment:
To update your local version with the latest code changes from the main repo branch, take the following steps:
cdto the project root directorygit pullto get the latest versiondocker-compose -f local.yml downdocker-compose -f local.yml builddocker-compose -f local.yml up --renew-anon-volumes(the--renew-anon-volumesoption makes sure that your localnode_modulesvolume is updated with any package changes.)
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: WHOI HAB hub
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Ethan
family-names: Andrews
email: eandrews@whoi.edu
affiliation: Woods Hole Oceanographic Institution
- given-names: Claire
family-names: Anacreon
email: canacreon@whoi.edu
affiliation: Woods Hole Oceanographic Institution
- given-names: Kali
family-names: Horn
email: khorn@whoi.edu
affiliation: Woods Hole Oceanographic Institution
- given-names: Mindy
family-names: Richlen
email: mrichlen@whoi.edu
affiliation: Woods Hole Oceanographic Institution
orcid: 'https://orcid.org/0000-0002-1302-9342'
- given-names: Michael
family-names: Brosnahan
email: mbrosnahan@whoi.edu
affiliation: Woods Hole Oceanographic Institution
orcid: 'https://orcid.org/0000-0002-2620-7638'
repository-code: 'https://github.com/WHOIGit/whoi-hab-hub.git'
license: GPL-3.0
commit: >-
https://github.com/WHOIGit/whoi-hab-hub/commit/1cbd55c803b581b11efb296c7494af285946254a
version: '1'
date-released: '2025-01-22'
Owner metadata
- Name: WHOI GitHub Central
- Login: WHOIGit
- Email:
- Kind: organization
- Description: Woods Hole Oceanographic Institution
- Website: www.whoi.edu
- Location: Woods Hole, MA
- Twitter: WHOI
- Company:
- Icon url: https://avatars.githubusercontent.com/u/38010066?v=4
- Repositories: 57
- Last ynced at: 2025-03-16T19:46:20.601Z
- Profile URL: https://github.com/WHOIGit
GitHub Events
Total
- Release event: 1
- Watch event: 2
- Push event: 15
- Gollum event: 9
- Create event: 2
Last Year
- Release event: 1
- Watch event: 2
- Push event: 9
- Gollum event: 1
- Create event: 2
Committers metadata
Last synced: 2 days ago
Total Commits: 853
Total Committers: 7
Avg Commits per committer: 121.857
Development Distribution Score (DDS): 0.019
Commits in past year: 21
Committers in past year: 2
Avg Commits per committer in past year: 10.5
Development Distribution Score (DDS) in past year: 0.048
| Name | Commits | |
|---|---|---|
| ethanandrews | e****s@w****u | 837 |
| dependabot[bot] | 4****] | 8 |
| ewandrews | e****n@h****m | 4 |
| Ryan Govostes | r****v | 1 |
| Michael Brosnahan | m****s@w****u | 1 |
| Ethan Andrews | e****s@E****l | 1 |
| ETHAN ANDREWS | e****s@h****u | 1 |
Committer domains:
- whoi.edu: 2
- habhub.admin.whoi.edu: 1
- hifrontier.com: 1
Issue and Pull Request metadata
Last synced: 4 months ago
Total issues: 23
Total pull requests: 20
Average time to close issues: 6 months
Average time to close pull requests: 4 months
Total issue authors: 5
Total pull request authors: 2
Average comments per issue: 0.48
Average comments per pull request: 0.55
Merged pull request: 9
Bot issues: 0
Bot pull requests: 19
Past year issues: 0
Past year pull requests: 1
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 1
Top Issue Authors
- mbrosnahan (13)
- kalimhorn (4)
- canacreon (3)
- ethanandrews (2)
- mrun0205 (1)
Top Pull Request Authors
- dependabot[bot] (21)
- rgov (1)
Top Issue Labels
- enhancement (1)
Top Pull Request Labels
- dependencies (21)
- javascript (10)
- python (3)
Dependencies
- 1614 dependencies
- eslint ^7.22.0 development
- eslint-plugin-react ^7.22.0 development
- @date-io/date-fns 1.x
- @material-ui/core ^4.11.0
- @material-ui/icons ^4.9.1
- @material-ui/pickers ^3.2.10
- @reduxjs/toolkit ^1.5.0
- @testing-library/jest-dom ^5.11.4
- @testing-library/react ^11.1.0
- @testing-library/user-event ^12.1.10
- @turf/bbox-polygon ^6.4.0
- @turf/boolean-intersects ^6.4.0
- @turf/centroid ^6.4.0
- @turf/points-within-polygon ^6.4.0
- @turf/square-grid ^6.4.0
- axios ^0.21.1
- clsx ^1.1.1
- date-fns ^2.16.1
- ga-4-react ^0.1.281
- highcharts ^9.1.0
- highcharts-react-official ^3.0.0
- html2canvas ^1.0.0-rc.7
- immutability-helper ^3.1.1
- material-ui-color ^1.2.0
- material-ui-popup-state ^1.9.0
- prop-types ^15.7.2
- react ^17.0.1
- react-dnd ^16.0.1
- react-dnd-html5-backend ^16.0.1
- react-dom ^17.0.1
- react-draggable ^4.4.5
- react-ga ^3.3.0
- react-map-gl ^5.2.9
- react-redux ^7.2.3
- react-router-dom ^6.2.1
- react-scripts 4.0.3
- uuid ^8.3.2
- web-vitals ^0.2.4
- colour ==0.1.5
- django-celery-beat ==2.2.1
- django-colorfield ==0.4.1
- django-filter ==21.1
- django-geojson ==3.0.0
- django-import-export ==2.4.0
- django-leaflet ==0.27.1
- django-multiselectfield ==0.1.12
- django-rest-multiple-models ==2.1.3
- django-summernote ==0.8.11.6
- djangorestframework-camel-case ==1.2.0
- djangorestframework-csv ==2.1.0
- geopy ==2.0.0
- hiredis ==2.0.0
- jsonfield ==3.1.0
- requests ==2.24.0
- s2sphere ==0.2.5
- python 3.8-slim-buster build
- node 16 build
- python 3.8-slim-buster build
- postgis/postgis 12-3.1-alpine build
- nginx alpine build
- node 14 build
Score: 4.51085950651685