- 1.1. Graphryder overview
- 1.2. Setting up Neo4j
- 1.3. Installing the API
- 1.4. Setting up the dashboard
1. Setup instructions
These are instructions for setting up Graphryder from scratch with a new conversation and ethnographic codes. Your mileage may vary depending on your server environment. These instructions are based on a setup on a DigitalOcean droplet with 4 GB of RAM, running Ubuntu 16.04.5 x64.
1.1. Graphryder overview
Three components make up Graphryder. These can either be run on three different servers, or on a single server.
- A Neo4j database
- Data mirrors conversation and ethno codes on Discourse server at the time of last hard update from the Graphryder API
- This is where the conversation and tags are stored.
- A Python API
- Reads data from Discourse and writes it to the Neo4j database
- Reads data from the Neo4j database to build graphs for the dashboard
- Graphs built and rebuilt by calling different routes, without any authorisation
- Reads from the Discourse API using an API key and user
- Reads graphs served by API
- Can trigger rebuilding of graphs by calling API endpoints through GUI
1.2. Setting up Neo4j
Follow official instructions to install version 3.0.1 of Neo4j. Newer versions won’t work until the libraries used in the API code are updated to newer versions.
Edit your neo4j.conf file at /etc/neo4j/neo4j.conf. Uncomment the following lines:
To start neo4j in background, follow official instructions.
Install GraphAware plugins
You need to install two GraphAware plugins for Neo4j. Find the right versions for your Neo4j installation of timetree and framework-server-community.
To install plugins, do the following:
cd /var/lib/neo4j/plugins/ wget http://products.graphaware.com/download/timetree/graphaware-timetree-18.104.22.168.24.jar http://products.graphaware.com/download/framework-server-community/graphaware-server-community-all-22.214.171.124.jar systemctl restart neo4j
Plugin versions installed above are for Neo4j 3.0.1. Newer versions exist for newer versions of Neo4j.
1.3. Installing the API
Make sure that Python 3.5 in installed and that you are using it whenever python is referenced.
First, get the Graphryder API. This version below has been patched to fix an error which was introduced by upgrades in the neo4j python driver.
git clone https://github.com/Edgeryders-Participio/graph-ryder-api.git
Follow instructions in repository readme file.
Update API config file
[neo4j] url = **localhost, or url of database if running elsewhere** user = neo4j user passsword = neo4j password [api] host = **localhost or ip to server if remote** port = 5000 debug = True max_tlp_files = 50 [importer] json_users_path = data/users.json json_posts_path = data/posts.json json_comments_path = data/comments.json [importer_discourse] abs_path = https://edgeryders.eu/ users_rel_path = administration/annotator/users user_rel_path = u/ tag_rel_path = tags/ tag_focus = **tag to identify ethno corpora, i.e. ethno-opencare** topic_rel_path = t/ posts_rel_path = posts/ codes_rel_path = administration/annotator/codes annotations_rel_path = administration/annotator/annotations admin_api_key = **your discourse API key for faster reading** admin_api_username = **your discourse username** [exporter] tlp_path = data/tlp/
Load data to API
Start the API service by running app.py in the root of the project directory. Make sure to use Python 3.5.
Make sure that you can access the remotely API by going to
http://yourip:5000/. This should just bring you to a page with the title ‘Not Found’. If it doesn’t you may need to configure your firewall.
Build the neo4j database by running the hard update script. You trigger it at route
After that, try running
http://yourip:5000/status to see an overview of the dataset.
Finally, try running
Prepare API for production
Set up firewall to block direct access to neo4j database through the web interface, or disable access to it in the neo4j config file. Finally, start the api service in the background, for example by running:
nohup python3 app.py &
1.4. Setting up the dashboard
Follow instructions on dashboard GitHub repo.
After setting up and configuring, build the static website by running
npm run dist
Serve directory “dist” which is created at root of project folder with nginx or other server.
An example instantiated using these instructions is here.