data art commission 2014
Clone or download
Pull request Compare This branch is 1 commit ahead, 402 commits behind theodi:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
client
data
images
routes
scripts
web
workers
.gitignore
Gruntfile.js
Procfile
README.md
mysql_notes.txt
notes.txt
package.json
sequelpro_notes.txt
server.js

README.md

Project Colleen

Data art project for the Data as Culture art programme.

This work is currently in active development. The most visible aspect will be a web-base animation built in javascript.

It is fed by an API built using Node.js, MySQL and Python.

##License

We intend for this work to be open source but have not yet chosen the license.

##Acknowledgements

Many have helped us. We will name them in time.

##Requirements

  • Node.js
  • npm
  • mysql
  • python
  • various Javascript libraries
  • other stuff to be added later

##Installation

###dev on Mac

  1. Clone project from github.

  2. Install MySQL Community Server (download from http://dev.mysql.com/downloads/mysql/) if not already on your machine.

  3. Run MySQL server. You will be prompted for a password. It wants the admin password for your mac:

     $ sudo /usr/local/mysql/support-files/mysql.server start
    
  4. Create the database and load test data by following directions in data/setup.sql

  5. Install heroku toolbelt for mac from https://toolbelt.heroku.com/

  6. Install Node.js for mac from http://nodejs.org/download/

  7. From the root directory of the project install node dependencies by running:

     $ npm install
    
  8. Install supervisor.js globally (this will enable you to restart node.js server app automatically when the code changes):

     $ sudo npm install supervisor -g
    
  9. Set up environment variables by chucking the following into a file called dev.env (*.env files are in the git.ignore file for security reasons) in the project root (the password here needs to be the same one you used when following the instructions in data/setup.sql):

     export WEB='supervisor server.js'
     export WNU_DB_URL=mysql://colleen:PUTMYSQLPASSWORDHERE@localhost/zoon
     export WNU_HOST=localhost:5000
     export WNU_DATA_MODE=archive       
    
  10. Type:

     $ source dev.env
    
  11. Fire it up:

    $ foreman start

  12. Visit app in browser at http://localhost:5000/wnu/chart.html

  13. For animation dev, run this in a separate console window to auto compile changes to the JSON and SVG files

     $ supervisor -n exit -w client/data/src -e json,svg client/util/compile_assets.js
    
  14. Visit app in browser at http://localhost:5000/wnu/index.html

###production on heroku

  1. Create an account at heroku.com

  2. In a terminal window from the project root directory run the following two commands and you should a response like the one below (but it will be a different url of the form word1-word2-number.herokuapp.com which we'll refer to as YOURAPPNAME from here):

     $ heroku login
     $ heroku create
     
     Creating sharp-rain-871... done, stack is cedar
     http://sharp-rain-871.herokuapp.com/ | git@heroku.com:sharp-rain-871.git
     Git remote heroku added			
    
  3. If you do not want to use an existing database then provision a cleardb addon for your heroku app http://dashboard.heroku.com/apps/YOURAPPNAME, you will be given a db connection string to use which contains a user, password, dbhost and dbname. If you are a Team Colleen member you can use the one in the Technical Resources document on Google Drive. You can initialise the tables by running

     $ mysql -u <username> -h <hostaddress> -p <dbname> < data/zoon_tables.sql
    
  4. Run

     $ heroku config:set WEB='node server.js'
     $ heroku config:set WNU_DATA_MODE=archive
     $ heroku config:set WNU_HOST=sharp-rain-871.herokuapp.com 
     $ heroku config:set WNU_DB_URL=mysql://<user>:<password>@<dbhost>/<dbname>?reconnect=true
     $ git push heroku master
    
  5. Visit your app at http://YOURAPPNAME

##TODO

  • choose license
  • thank people
  • review list of requirements and add/delete as appropriate
  • keep building