GlobalFishingWatch/frontend
About
Hosts GlobalFishingWatch apps and libraries.
Web & AppsMeasured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalThis monorepo hosts frontend packages and applications of the GlobalFishingWatch ecosystem.
Packages
All of them availables with the @globalfishingwatch/ prefix:
| api-client | JS library to simplify GFW API login and resources fetch |
| api-types | API typescript schema definitions |
| data-transforms | Set ot shared tools for data transformations |
| datasets-client | A set of utils for handling api datasets |
| dataviews-client | A set of utils for merge, combine and consume api dataviews into the apps |
| deck-layer-composer | Map integration of the deck-layers |
| deck-layers | Deck classes for GFW layers |
| deck-loaders | Deck loaders for GFW layers |
| i18n-labels | GFW shared translations |
| ocean-areas | Small library to get ocean area / eez names by viewport or by text search |
| react-hooks | Set of hooks to use libraries easily in react |
| timebar | Timebar component, not many more to say |
| ui-components | Reusable atoms components kit |
Applications
| api-portal | Api documentation portal |
| data-download-portal | The place to download datasets |
| platform | Platform entry point (includes fishing-map app) |
| platform-e2e | Playwright e2e testing for the map |
| image-labeler | Labeling tool for satellite images |
| port-labeler | Labeling tool for ports |
| track-labeler | Labeling tool for tracks |
| user-groups-admin | Tool to manage user groups with ease |
To create a new application using a template with sidebar + map + timebar just run:
Other utils
| config | Shared generic build config |
| linting | Define eslint prettier and stylelint configurations |
See also
🗑️ Legacy 🗑️ MapLibre GL fork
We maintain our own forks of Mapbox GL to handle gridded temporal data (see temporalgrid branches on both repos)
🗑️ Legacy 🗑️ LayerComposer / Dataviews / Workspaces
See: From WebGL triangles to Dataviews - Organizing visualization of data at GFW
Dependencies
The repo uses pnpm workspaces; npm and yarn are blocked by an only-allow pnpm preinstall hook.
Node is pinned in .nvmrc — use nvm use (or any version manager that reads it).
Getting pnpm
The exact pnpm version is pinned in package.json "packageManager" (currently 12.10.1).
pnpm 12 ships as a native executable, so Corepack and Homebrew cannot provide it.
Install it once with the official installer, which downloads the signed platform binary and puts it on your PATH:
npx get-pnpm 12 # or: curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=12 sh -
Only the major is pinned in that command; pnpm then honours the exact version from
"packageManager" on its own. If you had pnpm 11 from Homebrew, remove it (brew uninstall pnpm)
so it stops shadowing the new binary — a v11 on PATH cannot launch v12 and every pnpm command
in the repo fails. Later upgrades are just pnpm self-update <version>.
Install a new dependency
For all packages:
pnpm add [package] -w
Only for a specific package
pnpm --filter [project-name] add [package]
Installation
To install all workspace dependencies:
pnpm install
Developmment
Nx handles every app or library by its own project.json file, see for example platform:
nx start [app-name]
To ensure git flow process, master branch will be protected to force opening PR to every change desired. For now, the only one strong recommendation is to tag every PR to prepare the changelog automatically.
Building locally
To test all packages builds process run, useful to test everything works well before publishing.
nx build [app-name]
Building using Docker
These are the steps the build-image action runs in CI: load the environment's build.env_vars and build.secrets, build the app with Nx, then let the Dockerfile copy the output into the image. Needs bash or zsh, yq (brew install yq) and gcloud logged in with access to the secrets.
export APP=platform
export CONFIG=.github/apps/development.yml
export $(
yq 'explode(.) | .[env(APP)].build.env_vars | to_entries | .[] | .key + "=" + .value' "$CONFIG"
)
for secret in $(
yq 'explode(.) | .[env(APP)].build.secrets | to_entries | .[] | .key + "=" + .value' "$CONFIG"
); do
export "${secret%%=*}=$(gcloud secrets versions access "${secret#*=}")"
done
NODE_ENV=production pnpm nx run "${APP}:build"
docker build . \
--target "$(yq '.[env(APP)].target' "$CONFIG")" \
--build-arg APP_NAME="$APP" \
--build-arg VITE_WORKSPACE_ENV \
--tag "${APP}:local"
For platform, ./scripts/test-ci-build-platform.sh runs the same steps (--env staging|production, --push, --skip-secrets).
docker run -p 3003:3000 -e ALLOW_MISSING_SERVER_ENV=true platform:local
docker run -p 8080:8080 -e PORT=8080 -e BASIC_AUTH=off api-portal:local
Publishing
Use libs-release workflow
API DOCS
https://gateway.api.dev.globalfishingwatch.org/swagger?version=3
Running production environment locally
To replicate the prod build and serve it locally:
nx serve [app-name]
Generating release notes for github releases
To generate the release notes you can run
nx release changelog [version] -i all -p [project] --from @globalfishingwatchapp/[app]@[prev-tag] --tagVersionPrefix @globalfishingwatchapp/[app] --dry-run.
Explore related projects
Loading…