Giter VIP home page Giter VIP logo

Six Degrees of Francis Bacon

The repository contains the codebase for the Six Degrees of Francis Bacon web application. For the network inference and estimation code, see this separate repository, and for the original 2015 beta site, see the 2015-beta branch of this repo.

Six Degrees of Francis Bacon is a digital reconstruction of the early modern social network that scholars and students from all over the world can collaboratively expand, revise, curate, and critique. Unlike published prose, Six Degrees is extensible, collaborative, and interoperable: extensible in that people and associations can always be added, modified, developed, or, removed; collaborative in that it synthesizes the work of many scholars; interoperable in that new work on the network is put into immediate relation to previously studied relationships.

The code in this repository runs the web application which supports this collaborative digital reconstruction. It is made up of a Ruby on Rails backend (a set of API endpoints that communicate with a Postgres database), and an AngularJS frontend. Included in the Angular code is a set of D3js network visualizations. The code is split into modularized chunks for easy reuse. For example, the code for the network graphs can be found in angular/app/scripts/directives/forcelayout.js. Instructions for how to get this code up and running on your own server are below.

Installation and Server Setup

All of these instructions assume a basic Linux (Ubuntu) server with Postgres, Ruby, Rails, and Node already installed.

Set up Postgres database:

  1. Set a new password for the postgres user with sudo passwd postgres
  2. Make sure this password matches the password in database.yml
  3. Access machine as user postgres with su - postgres
  4. Get plaintext backup file from existing database. On whatever other server or machine your database lives on, this often looks like: psql mydatabase > mybackup.dump
  5. Create a new database on the server with createdb sixdfbor_sdfb
  6. Populate that database with your backup file: psql sixdfbor_sdfb < somefile.dump
  7. Make sure you can log in to the database from the rails app. You'll want to edit a config file by typing sudo vim /etc/postgresql/9.5/main/pg_hba.conf. Then change peer on the first line to md5.
  8. Restart postgres with sudo service postgresql restart to implement these changes.

Set up the App:

Before you do anything else, clone this Github repo into /var/www. Just navigate to that directory and type git clone https://github.com/sdfb/sdfb.git

In angular app:

  1. Go to the app by typing cd sdfb/angular
  2. Type the following commands in order. You may have to use sudo and type in a password for any of these.

npm install

npm install -g bower

bower install (with --allow-root option if using sudo)

npm install -g grunt-cli

sudo gem install compass

sudo grunt build

  1. Now angular is ready to go. For future changes to the site, you'll want to run sudo grunt build again to rebuild the site.

In rails app:

I will be following these: https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/nginx/oss/trusty/deploy_app.html

  1. Make your Gemfile.lock writeable: sudo chmod 777 Gemfile.lock
  2. bundle install (If you get an error with this, you may need to make your Gemfile match your local version of ruby.)

Run these next steps only after the database has been set up (see above)

  1. Run bundle exec rake secret and copy the resulting code to the clipboard.
  2. Create the file config/secrets.yml with the following contents:
production:
  secret_key_base: [the value that you copied from 'rake secret']
  1. Compile your assets and migrate database: sudo bundle exec rake assets:precompile db:migrate RAILS_ENV=production
  2. Follow these instructions to install Passenger.
  3. Add or uncomment include /etc/nginx/passenger.conf; to /etc/nginx/nginx.conf
  4. Restart Nginx: sudo service nginx restart
  5. Now rails is ready to go. For future changes to the site, you may have to run sudo bundle exec rake assets:precompile db:migrate RAILS_ENV=production again to recompile assets. You'll also want to restart Nginx: sudo service nginx restart

Set up Nginx

  1. Update /etc/nginx/sites-enabled/default to match the one here.
        root /var/www/sdfb/angular/dist;
        passenger_enabled on;

        location ~ ^/tools(/.*|$) {
            alias /var/www/sdfb/rails/public$1;  # <-- be sure to point to 'public'!
            passenger_base_uri /tools;
            passenger_app_root /var/www/sdfb/rails;
            passenger_document_root /var/www/sdfb/rails/public;
            passenger_enabled on;

        }
  1. Restart Nginx: sudo service nginx restart

That's it! The Angular app and Rails API should both be live on the server. If your API/frontend hookup isn't working, make sure the apiUrl is correct in angular/app/scripts/services/apiservice.js.

Chris Warren's Projects

exam-copies icon exam-copies

a pipeline for creating Word-based Exam Copy requests starting from a Zotero library

sdfb icon sdfb

A crowdsourcing website reassembling the social network of early modern Britain

sdfb_network icon sdfb_network

This repository contains code for the SDFB statistical inference process--including code to do text processing as well as perform network estimation--that produces output in an appropriate manner for the web interface.

sdfb_spring2014is icon sdfb_spring2014is

This repository contains code to visualize a social network with a simple spreadsheet database, an early version of our crowdsourcing website reassembling the social network of early modern Britain.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.