HSE Military department bot for schedule
Simply access HSE military department schedule, prepare news for informating comrades and receive full pack of stickers with people you know well. Stack of technologies used:
- Awesome Telegraf wrapper for Telegram API.
- Heroku PaaS as hosting for app.
- Firebase API as database for user preferences and in-app data validation.
- exceljs for parsing and generating json-formatted schedule with metadata from *.xlsx file.
- google-news-rss for parsing Google RSS feed.
- botanio for Yandex AppMetrica statistics tracking.
To run an app on local machine:
npm i
to install all dependences.
1) Run .env
file in root directory with following fields:
2) Add an NODE_ENV=development
PORT={Port you want to run on(etc. 5000)}
TOKEN={Your Telegram token}
METRIKA_TOKEN={Your Yandex AppMetrica token}
FIREBASE_USERS_URL={Your Firebase_Users URL}
FIREBASE_USERS_PROJECT_ID={Your Firebase_Users project ID}
FIREBASE_USERS_CLIENT_EMAIL={Your Firebase_Users client email}
FIREBASE_USERS_PRIVATE_KEY={Your Firebase_Users private key}
node .
to run the server in Long Polling mode.
3) Run How to deploy an app on Heroku:
1) Create an app on Heroku.
2) Configure local variables by heroku-cli after push:
heroku config:set TOKEN={Your Telegram token}
heroku config:set METRICA_TOKEN={Your Yandex AppMetrica token}
heroku config:set HEROKU_URL={Your Heroku URL}
heroku config:set FIREBASE_USERS_URL={YourFirebaseUsersURL}
heroku config:set FIREBASE_USERS_PROJECT_ID={Your Firebase_Users project ID}
heroku config:set FIREBASE_USERS_CLIENT_EMAIL={Your Firebase_Users client email}
heroku config:set FIREBASE_USERS_URL={Your Firebase_Users private key}
3) Commit and push to Heroku:
git add .
git commit -m "init deploy commit"
git push heroku master
4) Scale an app with heroku-cli to run it with Webhook:
heroku login
-> enter your credentialsheroku ps:scale web=1 -a {YourAppName}
-> to start dynoheroku ps:scale web=0 -a {YourAppName}
-> to shut down dyno
How to make a contribution:
npm run lint
and correct all typos (npm run lint:fix
runs eslint with --fix
flag).
1) Run 2) Push to development branch with:
git add .
git commit -m "feature/fix commit"
git push origin HEAD:develop