Skip to content

User Guide

Flynn Duniho edited this page May 29, 2024 · 8 revisions

Starting the App

  1. open Terminal and cd to the project's build directory (e.g. cd ~/dev/netcreate-2018/build)
  2. ./nc.js --dataset=projectname (e.g. --dataset=tacitus)
  3. point your browser at http://localhost:3000

The nc.js script will set up the app to load the project called tacitus and start the server.

The script expects your database file and template file to have the same name. And it expects to find them in the build/runtime folder. So if you have some existing projects, e.g. tacitus, then you'll want to set up the build/runtime folder like this:

/build/runtime/tacitus.loki
/build/runtime/tacitus.template

If no database or template is found, it will create a new one with that name.

If you want to back up your data, back up the files in build/runtime.

See Pull Request #67 for more information.

Setting Up Users

To generate access tokens:

  1. Open your browser to http://localhost:3000/ (or whatever URL you're using)
  2. Open the Developer Web Console
  3. Type ncMakeTokens('class','project','dataset',30) -- where class is a short designation of class name, project is any project name, 'dataset' is the name of the loki/template file you're working with, and 30 is the number of tokens you want to generate. e.g. ncMakeTokens('hist101','tacitus','Tacitus',50)
  4. Copy the list of tokens output in the console and hand them out to students.

See Pull Request #32 for more information.

Admin Mode

Only admins are allowed to delete nodes. To log in as an admin user, you must either be on localhost, e.g. ip = 127.0.0.1 or add ?admin=true to the url.

Standalone Mode

Saving Data for Standalone Mode

To save the data from the last run to publish on a standalone read-only web server:

  1. IMPORTANT: Make sure the project's template is set to NOT require login. Standalone mode does not have a login form. If requireLogin is set, no graph will be displayed. However, you can still view the graph by adding the login to the url, e.g. http://localhost:3000/#/edit/A-B-G3X. You can use this method to hide graphs from anyone without the special URL.

  2. open Terminal and cd to the project's build directory (e.g. cd ~/dev/netcreate-2018/build)

  3. load and run the database you want to publish, e.g. ./nc.js --dataset=tacitus

  4. Hit Ctrl-C to quite the app.

  5. type npm run package to generate the standalone files.

  6. copy the files in build/public to your web server.

  7. point your browser to the web server to view the data.

See Pull Request #46 for more information.

Loading Data in Standalone Mode

bb7b12c introduced a hack for loading arbitrary databases.

To target a specific database:

  1. Copy the data/___.json files to the server
  2. And add ?dataset=name to the url (before the #)

For example: http://netcreate.org/SampleNetworks/Package/#/

Becomes: http://netcreate.org/SampleNetworks/Package/?dataset=2020-02-06_Tacitus#/

NOTES:

  • To debug standalone mode, use npm run package:debug to get live updates

Caveats

NOTES: Comments as implemented as of April 2024 requires login in order to track read/unread status.

Clone this wiki locally