-
Notifications
You must be signed in to change notification settings - Fork 6
Home
luaye edited this page Dec 8, 2012
·
31 revisions
Table football rating and leaderboard system using Node.js and CouchDB.
- Download and install Node.js > http://nodejs.org/
- Download compiled version of CouchDB > http://couchdb.apache.org/
-
cp config.sample.json config.json- useCOPYin windows. - Open config.json
- Set
useFacebookAuthto false - FB logins don't work on local machine - Set
portto 8080 - to avoid admin permissions on your local machine -
cp static/config.sample.js static/config.js- useCOPYin windows. - Open static/config.js
- Set
FACEBOOK_ENABLEDto false
- Run Couch DB (by running the app you downloaded)
node server.js- go to URL: http://localhost:8080/
When facebook auth is enabled, only users who are registered as a player with facebookId can submit matches. Alternatively there is 'secretAuthKey' which can be used to submit matches. This is used from other ways of submitting scores. Such as from an iOS score board app.
Current version does not allow users to enter their facebook id when adding. therefore this method may not work smoothly yet. - We currently manually set 'facebookId' in CouchDB's player fields.
- Follow same steps as local setup
- Create new Facebook App at > https://developers.facebook.com/apps - requires to be facebook developer
- Set "App Domains" to web domain you will be hosting foosladder. e.g
yourdomain.com - Set "Website with Facebook Login" to point to url you will be hosting foosladder. e.g
http://yourdomain.com - Open config.json
- Set
portto 80 - Set
useFacebookAuthto true - Set
secretAuthKeyto a new random string. (can leave blank if you don't have scoreboard app) - Open static/config.js
- Set
FACEBOOK_ENABLEDto true - Set
FACEBOOK_APP_IDto facebook app ID you created in step 2 - Set
FACEBOOK_APP_URL_PARTto url you will be hosting foosladder. e.g//yourdomain.com - Run server:
- Run couchDB
- Run as background task (on linux):
sudo node server.js >> server.log 2 >&1 &
ssh -N -L 9000:localhost:5984 **\<user\>** @ **\<host\>** -i **~/.ssh/\<.pem file\>**- go to URL: http://localhost:9000/_utils/