Telegram/Slack notification system that creates small but important reports for employees
Employees of the company perform some routine tasks on the daily basis. The business need for this application is to be able to have something that can automate these routine tasks and prepare reports that are sent to Slack on a daily basis.
These reports are gathered from internal systems as well as Google Sheets.
Telegram admin panel is added to provide easy access to logs or to retry report generation in case of exceptions.
Initially it was supposed to be a Telegram-only bot with role-based access, but over time end users decided to switch to Slack, which is why Telegram authorization was replaced with a simple chat id check.
Java 21, Spring Boot, Feign, AOP, Postgres, Testcontainers, Flyway and a bunch of APIs (Slack, Telegram, Google Sheets).
You can play with the app on your machine if you'd like to. There is a mock profile you can use for that
Firstly build the JAR file using Java 21
mvn package -DskipTests=true
Then run docker-compose with environment variables
TELEGRAM_BOT_TOKEN=${YOUR_TOKEN} \
TELEGRAM_BOT_ADMIN=${YOUR_TELEGRAM_ID} \
SLACK_WEBHOOK=${SLACK_WEBHOOK} \
docker-compose up
Or if you don't want to use telegram:
Adjust application-mock with report.parameters.schedule to send reports to slack Adjust SPRING_PROFILES_ACTIVE in docker-compose to "mock" and run docker-compose with your webhook
SLACK_WEBHOOK=${SLACK_WEBHOOK} \
docker-compose up
Report Service:
Generic Report Service:
Payload Executor:
If exceptions arise during the report processing:
Retry Report:
Request pod logs:
Deployment using Maven plugin:
mvn clean heroku:deploy
Starting up:
heroku ps:scale worker=1 -a app_name
worker type is required, so application is not scaled down to 0 instances after idle time
Retrieving logs using Heroku CLI:
heroku logs -a app_name