Skip to content

kingsdigitallab/tap-django

Repository files navigation

Twitter Analytics Platform

This is the repository for the Twitter Analytcs Platform project at Kings Digital Lab. The Twitter Analytcs Platform project is used to harvest and analyse tweets.

This project uses the technologies outlined in our Technology Stack and is configured to use Vagrant for local development and Fabric for deployment.

More specificaly the project is built with Django using a PostgreSQL database, and the tweets are stored in a MongoDB database. Django APScheduler is used to schedule the harvesting of the tweets, and TextBlob/NLTK is used for NLP and sentiment analysis. The frontend is built with Vue.js, and uses chart.js and word2cloud.js to create the visualisations.

Before starting to harvest tweets, the user accounts need to have associated Twitter API credentials. The credentials can be set up via the Django admin interface.

Getting started

  1. Enter the project directory: cd tap-django
  2. Start the virtual machine: vagrant up
  3. SSH into the virtual machine: vagrant ssh
  4. Run the local development server: ./manage.py runserver 0:8000

You can then access the site locally at http://localhost:8000

If the project is ldap-enabled, you can login using your LDAP credentials. Note: LDAP authentication will only work within the college firewall. Alternatively, use the default superuser login:

username: vagrant password: vagrant

Note: This login will only work on a locally deployed virtual machine.

Requirements

  • Ansible >= 2.3
  • NodeJS
  • Vagrant >= 1.9
  • VirtualBox >= 5.0