A project for studying how to use Firebase (100% Firebase-powered app).
Idea is realy simple. User posts his ideas then teamate can vote. More detail: https://www.linkedin.com/pulse/innovation-accounting-action-chris-shayan
This application includes two components:
- Web app, in
web
folder - Slack bot, used for intergrating web app with slack, in
slackbot
folder
In current version, user can connect to web application via slack only, no register module supported yet.
-
First you have to register your own Firebase account (https://www.firebase.com), and create an application on firebase.
-
Rename
config.js.template
toconfig.js
and updateFIREBASE_URL
value to your firebase application URL e.g https://your_app_name.firebaseio.com (web/src/app/config.js) -
Installed required npm modules and bower packages (powered by gulp)
$cd web $npm install $bower install
-
Develop on localhost
$gulp serve
-
Pack and prepare for deploying
$gulp
-
Deploy to firebase static host (see https://www.firebase.com/docs/hosting/guide/deploying.html)
-
Require nodejs
-
Rename keys.js.template to keys.js
firebase_app
: Firebase application name (eg:ib-slack
)firebase_key
: Firebase SECRETS key https://your_firebase_app.firebaseio.com/?page=Adminslack
: slack authentication key (https://api.slack.com/web)innovative_webste
: where you host your website. If your use firebase statis hosting, it will be: http://your_firebase_app/firebaseapp.com
-
Run app
$cd slackbot node app.js
However, prefer using pm2
(https://github.com/Unitech/pm2) to manage node app.
- Hosting your host somewhere e.g Digital Occean or Heroku
Send info from slack to web-app, included register user
- Register outcome webhook intergration at https://your_slack_domain.slack.com/services/new
- Set up outcome info, point to slackbot url: http://your_slackbot_domain:4000/idea
Send notify to slack
-
Register income webhook intergration at (optional)
-
Set up income info, copy
Webhook URL
from slack -
Access your firebase appication database, find your group data at group/your_group_id, add field:
slack_webhook
with this url<your_app> groups <your_group> slack_xyz created_date: 1234 name: '...' slack_webhook: "https://hooks.slack.com/services/..."
-
Update
SLACK_NOTIF_URL
in web app config (web/src/app/config.js
) then build and deploy again.SLACK_NOTIF_URL = "http://your_slackbot_domain:4000/notif";
Say hi
with keyword defined in outcome webhook let slack bot create account for you. For example, keywork is ic
, so
ic, hi
<slack bot reply here>
Post an idea:
ic, bla bla bla bla bla bla bla bla (at least 7 words)
Login wep app: after say hi
, now your account has already been registered with email that you used with slack account. Use forget password
function to get random password.
Enjoy