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.
for the authorization via github for contriboot
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
Make sure you have the following commands installed:
brew install node
After cloning the repository, install all dependencies:
npm install
Run the following command to start the server on localhost:
npm start
and point your browser to http://localhost:8080
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