https://github.com/openearth/rws-viewer
This viewer is created by Deltares in cooperation with Voorhoede under OpenEarth GPL License. The viewer can be used via several RWS websites, please visit https://www.informatiehuismarien.nl/, https://waterinfo-extra.rws.nl/ and https://basismonitoringwadden.waddenzee.nl/.
https://github.com/openearth/rws-viewer
data mapbox-gl-js ogc-services viewer
Last synced: 5 months ago
JSON representation
This viewer is created by Deltares in cooperation with Voorhoede under OpenEarth GPL License. The viewer can be used via several RWS websites, please visit https://www.informatiehuismarien.nl/, https://waterinfo-extra.rws.nl/ and https://basismonitoringwadden.waddenzee.nl/.
- Host: GitHub
- URL: https://github.com/openearth/rws-viewer
- Owner: openearth
- Created: 2021-11-04T09:21:02.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-12-17T16:23:31.000Z (6 months ago)
- Last Synced: 2025-12-20T07:12:46.974Z (6 months ago)
- Topics: data, mapbox-gl-js, ogc-services, viewer
- Language: TypeScript
- Homepage: https://deltares.nl
- Size: 3.11 MB
- Stars: 1
- Watchers: 7
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenEarth Viewer
The [OpenEarth Viewer](https://rws-viewer.netlify.app/) gives insight in a wide variety of marine data. It is configured to be loaded into a variety of different websites and cater specific layer data to each individual client.
[](https://app.netlify.com/sites/rws-viewer/deploys)
## Getting started
- Clone [this repository](https://github.com/openearth/rws-viewer):
```sh
git clone git@github.com:openearth/rws-viewer.git
cd rws-viewer
npm install --legacy-peer-deps
```
- Copy `.env.example` to `.env`. And set all variables.
### Local development
```sh
npm run dev
```
## Migrations
This project uses [DatoCMS migrations](https://www.datocms.com/docs/content-management-api/migrations) for managing the models and moving data around in the DatoCMS instances. It uses custom scripts to generate the migrations, and to apply them.
### Create Migration (`migrations:create`)
**File:** `scripts/dato/create.ts`
This script creates a new migration file for DatoCMS.
- Prompts the user for a migration name.
- Uses the current DatoCMS instance specified in the environment variable `DATO_INSTANCE_CURRENT`.
- Creates a new migration file using the DatoCMS CLI.
Usage:
```bash
npm run migrations:create
```
### Apply Migrations To Staging (`migrations:apply-staging`)
**File:** `scripts/dato/apply-staging.ts`
This script applies migrations to the staging environment for all configured DatoCMS instances.
For each instance:
1. Sets up a staging environment.
2. Destroys the existing staging environment if it exists.
3. Creates a fresh staging environment by forking from the main environment.
4. Applies all migrations in the `migrations` directory to the staging environment.
Usage:
```bash
npm run migrations:apply
```
### Apply Migrations to Main (`migrations:apply-main`)
🚧 Please do not use this script unless you know what you are doing. This will update the main environment for all configured DatoCMS instances and can cause data loss. Typically this will only be run from a GitHub action.
**File:** `scripts/dato/apply-main.ts`
This script applies migrations to the main environment for all configured DatoCMS instances.
For each instance:
1. Destroys the existing staging environment if it exists.
2. Creates a fresh staging environment by forking from the main environment.
3. Applies all migrations in the `migrations` directory to the staging environment.
4. Promotes the staging environment to main.
5. Destroys the old main environment.
6. Renames the staging environment to main.
Usage:
```bash
npm run migrations:apply-main
```
## GitHub Actions Workflows
### Deploy to Production
The `main-migrations.yaml` workflow is triggered on a push to the `main` branch. It performs the following steps:
1. Checks out the repository.
1. Checks for changes in the `migrations` folder.
1. If changes are detected, sets up Node.js, installs dependencies, and runs the `migrations:apply-main` script.
1. Deploys the application to Netlify using the specified instances.
### Deploy to Staging
The `staging-migrations.yaml` workflow is triggered on pull request events (opened or synchronized). It performs the following steps:
1. Checks out the repository.
1. Checks for changes in the `migrations` folder.
1. If changes are detected, sets up Node.js, installs dependencies, and runs the `migrations:apply-staging` script.
1. Deploys the application to Netlify using the specified instances.