NotifierBot
NotifierBot copied to clipboard
Telegram/Slack notification system that creates small but important reports for employees
Telegram/Slack Notifier Bot
Heroku-hosted application mostly used to create various Reports for Slack. Telegram bot that duplicates the reports and has admin panel that is used to handle situations where reports are incorrect.
Designed for internal use inside company.
PLEASE NOTE THAT THIS PROJECT WON'T COMPILE (as I am too lazy to create a self-sufficient working demo profile)
Due to security restrictions this repository doesn't contain tokens.
If you would like to run this code:
- 'dev' profile by default does not include any Slack reporters - they can be enabled by adding 'slack-dev' profile to active profiles
- Telegram bot can be enabled by adding telegram.bot.token property value in telegram-dev config
- Bot admin token 'telegram.bot.admin' is required to send start-up report and unauthorized request messages
Feature toggles can be discovered by looking out for @ConditionalOnProperty annotation
Technologies used:
Java 14, Spring (Boot, Data JPA), Hibernate, Postgres, H2, Flyway and a bunch of APIs (Slack, Telegram, Google Sheets).
Features:
- Separate profiles (dev, prod)
- CI/CD in Travis with automatic deployment of the latest version of master branch to Heroku
Telegram bot:
- Authentication is based on green list of tokens stored in Postgres DB
- Role-based authorization
- Bot admin is notified if user calls a command he is unauthorized to use
- Help message is generated dynamically (based on user roles)
- Unauthorized users can get their token
- Different reports for authorized users - upcoming birthdays, customer debts, recent payments
- Scheduling of individual notification time for each user
- Admin panel that enables data loading audition, data reloading and manual slack payload execution directly from the bot
Screenshots:
Message about successful initialization:

Unauthorized user available commands:

Authorized user (employee) available commands:

Authorized user (manager, head) available commands:

Schedule management:

Deployment
Deployment via Heroku CLI:
mvn clean heroku:deploy
Starting up:
heroku ps:scale worker=1 -a app_name
Retrieving logs:
heroku logs -a app_name