Skip to content
Daniel Schildt edited this page Apr 10, 2017 · 11 revisions

Installation

First fulfill your platform specific requirements and then do the General Setup.

Summary:

Ubuntu 16.04 Requirements

sudo apt-get update && apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove

sudo apt-get install git mysql-server nodejs npm redis-server unicode
# make sure you setup a MySQL root password, empty passwords won't allow access anymore

sudo ln -s /usr/bin/nodejs /usr/bin/node

Arch Linux Requirements

pacaur -S git mariadb nodejs npm redis

sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo systemctl enable mysqld.service
sudo systemctl start mysqld.service

sudo systemctl enable redis.service
sudo systemctl start redis.service

Mac OS X w/ MacPorts Requirements

sudo port install git npm nodejs 

sudo port install redis
sudo port load redis

# ref: https://trac.macports.org/wiki/howto/MySQL
sudo port install mysql57 mysql57-server
sudo port select mysql mysql57
sudo port load mysql57-server

Setup (All Platforms)

Repo

For read-only access:

git clone https://github.com/upcoming/upcoming-www

You probably want to fork the repo https://github.com/upcoming/upcoming-www and submit pull requests if you plan on making changes.

Node dependencies

cd upcoming-www
npm install
node node_modules/unicode/install.js

DB Setup

cd upcoming-www
mysqladmin -u root -p create upcoming
mysql -u root -p upcoming < db/schema.sql
mysql -u root -p upcoming -e "SET GLOBAL sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';"

API Tokens

Configuration

Update the config/default.json file:

{
  "session_secret": "[SHA1DIGEST-OR-SIMILAR]",
  "redis_password": "",

  "database": {
    "host": "localhost",
    "database": "upcoming",
    "user": "root",
    "pass": "[YOUR-MYSQL-PASSWORD]"
  },

  "twitter": {
    "consumer_key": "[REQUIRED]",
    "consumer_secret": "[REQUIRED]",
    "callback_url": "[OPTIONAL-OVERRIDE]"
  },

  "facebook": {
    "app_id": "[FUTURE-REQUIRED]",
    "app_secret": "[FUTURE-REQUIRED]"
  },

  "foursquare": {
    "client_id": "[REQUIRED]",
    "client_secret": "[REQUIRED]"
  },

  "google": {
    "oauth_key": "[FUTURE-REQUIRED]",
    "oauth_secret": "[FUTURE-REQUIRED]"
  }
}

Note: The twitter callback_url can either be specified in this file, or in the Twitter API token setup page. It should be http://YOUR_HOSTNAME_OR_IP:3000/auth/twitter/callback

  • Edit views/add.jade and change the 6th line, removing the &key=AIzaSyB6e6ARbWZOETgBrJ54j3R0z7p93UzhYMQ param and replacing it with &key=YOUR_GOOGLE_MAPS_API_KEY

Running

You should be able to run bin/www in the upcoming_www folder. If successful, you should be able to go to http://YOUR_HOSTNAME_OR_IP:3000 and view the site.

There are (too) many ways to make your life easier while developing (auto-reloading/watching for changes).

Here's one simple way.

Install supervisor

sudo npm install supervisor -g

Run in upcoming_www

supervisor bin/www