webgme / webgme-taxonomy

A design studio for creating taxonomies which can then be used to tag various resources.
MIT License
0 stars 1 forks source link

webgme-taxonomy

Installation

First, install the webgme-taxonomy following:

Second, start mongodb locally by running the mongod executable in your mongodb installation (you may need to create a data directory or set --dbpath). Alternatively use docker:

docker run --name webgme-mongo -d -p 27017:27017 mongo:5

Thirdly, start the janus graph:

docker run --name janusgraph -p 8182:8182 -d janusgraph/janusgraph:latest

Optionally if you want to be able to visualize the graph-db data at http://localhost:3000 (psst g.V() returns all vertices and their edges).

docker run -d --name=gremlin-visualizer --network=host prabushitha/gremlin-visualizer:latest

Then, run webgme start from the project root to start . Finally, navigate to http://localhost:8080 to start using webgme-taxonomy!

Creating a Taxonomy

The easiest way to create a taxonomy is to simply import a CSV file. Here are the steps:

Development

This project uses rollup to build and bundle the Typescript files (and copy over the client files for the routers). At a high level, client files are independent svelte projects served up by routers, all WebGME entrypoints (e.g. routers, plugins) are bundled with their dependencies (e.g., src/common/ files). Information about a few common use-cases can be found below.

Manually testing

After making changes to any of the server-side source files, run npm run build. For client-side changes, run npm run prepare.

Unit testing

Since rollup bundles all dependencies with the WebGME entrypoints, modules in src/common will not be available in build/common unless building for testing explicitly.

When unit testing non-client code, set NODE_ENV=test before running npm run build as below.

NODE_ENV=test npm run build

As this builds all modules for testing by default, it is recommended to use the TEST_TARGETS environment variable to set the targets to build for testing. TEST_TARGETS does not need to be an exact match and simply builds the files with the given string in the file path.

For example, if we want to test the JSONSchemaExporter, we can build only these files using:

NODE_ENV=test TEST_TARGETS=JSONSchemaExporter npm run build

Adding new WebGME components

Adding WebGME components requires a couple extra steps since this project is using Typescript. Specifically, the WebGME entrypoints for components is in build/ instead of src/ for plugins and routers. Seeds are stored in seeds/ instead of src/seeds. For more details, see below.

Adding new plugins

  1. Create the plugin with webgme new plugin <name>.
  2. Open webgme-setup.json and change the src value in <plugin name> to build. For example, if the plugin is called TestPlugin set src to build/plugins/TestPlugin.
  3. Copy an existing Typescript plugin source file, say OpenTagForm, to the plugin source directory and name it <plugin name>.ts. Rename OpenTagForm to the plugin name and start writing your plugin!

Adding new routers

  1. Create the router with webgme new router <name>.
  2. Open webgme-setup.json and change the src value in <router name> to build. For example, if the router is called TestRouter set src to build/routers/TestRouter.
  3. If the router includes any static assets, such as client files, add an assets field to the entry in the webgme-setup.json file.
  4. Copy an existing Typescript router source file, say Insights, to the router source directory and name it <router name>.ts. Start writing your router!

Adding new seeds

  1. Create the seed with webgme new seed <name>.
  2. Open webgme-setup.json and change src in <seed name> to seeds/<seed name>.
  3. Move the webgmex file from src/seeds/<seed name>/<seed name>.webgmex to seeds/<seed name>/<seed name>.webgmex.

Integrated Tools

There are a few integrated tools in the design studio which are automatically configured using projects in the design studio. However, if you want the following links to work, you will first need to create the example project with the following command:

npm run import -- seeds/test/test.webgmex -p TaxonomyDemo

The main integrated tools are listed below.

Making a Release

The process of making a release is pretty straight-forward.

  1. make a new branch (so CI will run on the new release before it is confirmed) labeled bump-vX.Y.Z.
  2. bump the version in package.json and update the lockfile
  3. commit the version bump with commit message bump to vX.Y.Z
  4. make a PR and merge once all checks have passed
  5. create a tag vX.Y.Z at main and push it
  6. make a GH release (using autogenerated notes) for the new tag. This will trigger a new docker image to be published to DockerHub.