Skip to content

Deploying Neon

Max Zhang edited this page Jul 24, 2022 · 2 revisions

There are three officially supported ways Neon can be hosted and used: via the packaged development server, as a job in Rodan, or as a site on GitHub Pages. While not officially supported, Neon can be built and used on any HTTP server with a little bit of work.

Development Server

The development server is packaged in Neon (see the deployment/server directory and deployment/server.js) and is written using Express. While security issues are fixed in the server software as they are made known, it is not guaranteed to be free of major vulnerabilities. For this reason and the fact that uploaded documents can be modified without authentication, the development server should not be used in production and should not be made publicly available.

The development server supports all features of Neon and allows users to easily add new entries. These entries can be single pages and simply an association between an image file and an MEI file, or multiple pages where multiple MEI files are associated to canvases in a IIIF manifest.

Neon manifests can be downloaded from the development server, but since it is meant to run locally the URLs to resources on the server are relative. This means that a manifest generated on the development server is not guaranteed to work on another server. Cross-compatibility is a feature that will hopefully be added in the future.

Neon can be built for the development server by running yarn build and the server itself is started by running yarn start. It uses port 8080.

Rodan

Neon can be used as a job in Rodan. It cannot be added directly, but requires using a special wrapper. More information can be found on the GitHub for that wrapper. Generally the version of Neon used in the development version of the wrapper lags behind the development version of Neon.

GitHub Pages

Neon can also be built for hosting on GitHub Pages. Our project page hosts this deployment of Neon. This is the preferred (and easiest) way to try out Neon. Demo manifests for the Salzinnes Antiphonal manuscript are available both as single pages and a multi-page manifest including an MEI file for (almost) every page.

User manifests can also be loaded (provided data URIs and absolute URLs are used for resources). These manifests and any modifications made to them can be saved and used on any other computer or server running Neon that supports loading manifests.

Using Neon Elsewhere

This is a brief guide to using Neon outside of the contexts given above. To manage the various dependencies and resources, Neon needs to be built using webpack. The best way to do this is to write an entry point that loads and starts Neon. That is what deployment/server/editor.ts and deployment/pages/editor.js are. Neon must be instantiated with a params object. This object must include:

  • params.manifest - The Neon manifest as a JSON object;
  • params.Display - The DisplayPanel class or a suitable replacement;
  • params.Info - The InfoModule class or a suitable replacement; and
  • params.View - The manager for the view panel, like SingleView and DivaView or a suitable replacement.

It may also optionally include params.NeumeEdit, which is the class that handles neume editing (SingleEditMode or DivaEditMode), params.TextView, the class that handles displaying lyrical text, and params.TextEdit, the class that handles editing text and <syl> bounding boxes.

Neon is initialized by creating a NeonView object with params as a parameter and started by running the start function of NeonView.