Skip to content

NBISweden/rda-gorc-im

Repository files navigation

Project Title

RDA GORC International Model(IM)

Description

A visualisation application for the RDA GORC International Model.

Getting Started

The project is meant to be run locally in a docker environment, visit the Docker documentation to learn more.

Dependencies

Initial setup

In order for the system to work you need to make sure that you have a repository available. Repositories can be:

  • generated locally (the built-in example repository), or
  • hosted anywhere that is reachable over HTTP(S), e.g. on GitHub using raw URLs.

Step 1: Generate the local example files

Start by running:

./compose-dev.sh run --rm vite npm run build-examples

Then you should add the file public/config.json which should contain the following:

{
  "title": "This is my GORC IM",
  "repositories": [
    {
      "url": "example-repo/root.json",
      "id": "example-repo",
      "name": "Example Repo"
    }
  ]
}

Step 2: Add your repository to the application

The application only needs the URL to a single file with json formatting, for example root.json; from there it follows the references to load the models, profiles and slices. When you have the correct format in the repository, you should add it to the file public/config.json and there is an example file for this config.example.json in the project. The file public/config.json should contain the following:

{
  "repositories": [
    {
      "url": "https://raw.githubusercontent.com/<github-user-or-org>/<repository>/refs/heads/<branch>/<repository-folder>/root.json",
      "id": "id-of-the-root-json-file",
      "name": "name-of-the-root-json-file"
    }  
  ]  
}

Make sure to replace the url, name and id with the ones according to your repository. Learn more about how to set up a repository with the GORC IM, documentation about repositories.

Executing program

After cloning the repository you can run the project with:

./compose-dev.sh up

Rebuild the container:

./compose-dev.sh build

Stopping the app:

./compose-dev.sh stop

Unit testing

This project uses vitest for unit testing. Additional information on how to get started with vitest can be found here.

Run tests:

./compose-dev.sh exec vite npm run test

Formatting the code

This project includes "Prettier" as a code formatter. Formatting rules are specified in the .prettierrc file. Files that are ignored from formatting are specified in the .prettierignore file.

Run the formatter on your code:

npm run prettify

Be aware: This will overwrite all the files in the project that are not specified in the .prettierignore file.

To read more about how to use Prettier, check their documentation.

Adding dependencies

This project uses npm to handle dependencies. To add a dependency, first start the container with

docker compose up

Then add a dependency with:

docker compose exec vite npm install <your-new-dependency>

Now both your package.json and package-lock.json should be updated.

Acknowledgments

This project has received funding from the European Union’s Horizon Europe research and innovation programme under grant agreement No 101094406

About

GORC International Model visualisation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages