Skip to content

Latest commit

 

History

History
99 lines (77 loc) · 2.43 KB

README.md

File metadata and controls

99 lines (77 loc) · 2.43 KB

Contriboot

Manage Contributions and Interests. Based on Firebase.

The code is copied from last year's contriboot https://github.com/jsunconf/contriboot but with upgraded libs and a few code improvements due to version changes.

First time Set-up

Create an OAuth token for github

for the authorization via github for contriboot

Create firebase app

with github - authentification

and these rules:

{
  "rules": {
    ".read": true,
    "contributions": {
      "$contribution": {
        ".write": "auth != null",
        "title": {".validate": "newData.isString()"},
        "description": {".validate": "newData.isString()"},
        "user": {
          "id": {".validate": "newData.isString()"},
          "username": {".validate": "newData.isString()"},
          "displayName": {".validate": "newData.isString()"},
          "profileImageURL": {".validate": "newData.isString()"},
          "$other": {".validate": false}
        },
        "$other": {".validate": false}
      }
    },
    "interests": {
      "$interest": {
        ".write": "auth != null",
        "title": {".validate": "newData.isString()"},
        "description": {".validate": "newData.isString()"},
        "user": {
          "id": {".validate": "newData.isString()"},
          "username": {".validate": "newData.isString()"},
          "displayName": {".validate": "newData.isString()"},
          "profileImageURL": {".validate": "newData.isString()"},
          "$other": {".validate": false}
        },
        "$other": {".validate": false}
      }
    },
    "votes": {
      "$entry": {
        ".read": true,
        ".write": true,
        ".validate": "newData.isNumber() && (newData.val() === 1 || (newData.val() - data.val()) === 1) && (root.child('contributions/' + $entry).exists() || root.child('interests/' + $entry).exists())"
      }
    }
  }
}

Copy API keys and URls to config.jsx

Development

Installation

Make sure you have the following commands installed:

brew install node

After cloning the repository, install all dependencies:

npm install

Develop

Run the following command to start the server on localhost:

npm start

and point your browser to http://localhost:8080

Deploy

To build the application, run the following command:

npm run build

and copy the generated build/static/main.js source to https://github.com/jsunconf/2017.jsunconf.eu/blob/master/content/scripts/contriboot.js