This is an experimental interface for viewing variant text. Development was begun at the Huygens Institute in early 2016 in the context of a design sprint centred around the concept of "text-as-graph", particularly as used in the Stemmaweb tools.
This fork has updated the original proof of concept to use live data, and reworked it to be supported by the Create React App infrastructure.
- Node.JS 14+, npm 7+
- Python 3
- Graphviz
Within the root directory, install dependencies required to run the application:
npm install-
Within the root directory, create a new file named
.env. It is highly recommended that this file be git-ignored in order to avoid committing sensitive data into version control. -
In the newly created
.envfile, add the following environment variables:
PUBLIC_URL- Ex:
PUBLIC_URL=enter_url_here_with_no_spaces_or_quotes
- Ex:
REACT_APP_MAPBOX_TOKEN- Ex:
REACT_APP_MAPBOX_TOKEN=enter_token_here_with_no_spaces_or_quotes - A Mapbox token can be obtained from the Mapbox website - see the "Access tokens" section of your Mapbox account page.
- Ex:
REACT_APP_HOMEPATH- Ex:
REACT_APP_HOMEPATH=/ChronicleME/
- Ex:
-
Within the
/scriptdirectory, create a new file namedlemma-html-config.json. It is highly recommended that this file be git-ignored in order to avoid committing sensitive data into version control - this is why we provide an example file (lemma-html-config.json.example), rather than the file itself, on GitHub. -
In the newly created
lemma-html-config.jsonfile, add a JSON object with the following keys (be sure to update with your own values):
{
"options": {
"repository": "repository URL goes inside these quotes",
"tradition_id": "tradition ID goes inside these quotes"
},
"auth": {
"username": "API auth username goes inside these quotes",
"password": "API auth password goes inside these quotes"
}
}Note - an example file, lemma-html-config.json.example, has been provided as an example.
Within the root directory, run the following command:
node script/generateAllData.jsRun the application locally:
npm run startWithin the project root directory:
npm run build
zip -r <buildID> build
scp <buildID>.zip <user>:<pass>@<hostname>:<path>
For Stemmaweb, the final argument should be something like [email protected]:..
On the server:
rm -rf build
unzip <buildID>
rm -rf www/*
cp -r build/* wwwTo support DTS navigation and document endpoints using DTSflat-server and Simple tei2dtsflat, follow the following instructions.
Navigate to the /script directory and clone the simple-tei2dtsflat repo.
cd script
git clone https://github.com/performant-software/simple-tei2dtsflat.git
cd ..From the project root directory, run the following command:
node script/generateDtsData.jsThis will create a new timestamped directory in the public/data folder, containing a DTSFlat file structure of all manuscripts and the lemma edition.
In order to set up a server with DTS, you may follow the instructions at the DTSflat-server repo. Just copy your new DTS data directory (public/data/dts-data_YYYY-MM-DD_hh:mm:ss) to the DTS_DATA_DIR location you set in .env when following that repo.
If you wish to serve the DTS endpoints from the same server as the critical edition, you may need to modify the Nginx configuration. For example, our development server uses the following configuration to serve the DTS endpoints from /dts, pulling data from the /var/www/dts-data directory. It is appended as a second location block, in addition to the block for / that serves the critical edition static site from the /var/www/html directory.
To view this configuration, view example.nginx.conf in the /script directory.
With this configuration, when you are ready to regenerate the DTS data, you can run the script and then replace the contents of /var/www/dts-data on the server with the contents of the latest public/data/dts-data_YYYY-MM-DD_hh:mm:ss directory. For example, from the project root directory on your local machine, the command might look something like this with rsync:
rsync -ar --delete public/data/dts-data_YYYY-MM-DD_hh:mm:ss/. user@server:/var/www/dts-dataWe run it with the following additional options in order to ensure MacOS Spotlight .DS_Store files are not included:
rsync -arv --exclude=.DS_Store --delete-excluded --delete public/data/dts-data_YYYY-MM-DD_hh:mm:ss/. user@server:/var/www/dts-data