Telegram bot built with Spring Boot that fetches DTEK outage schedules and sends updates to users.
- Java 25
- Spring Boot 4
- SQLite + Spring Data JPA
- Telegram Bots API (long polling)
- Playwright + Jsoup for DTEK data extraction
/startflow with interactive inline menu- Region/group selection and persistence per chat
- Notification toggle per user
- Scheduled refresh of outage schedules
- Daily rollover of
tomorrowschedules intotoday
Spring also loads .env automatically (spring.config.import: optional:file:.env[.properties]).
Required:
TELEGRAM_BOT_TOKEN- Telegram bot token
Optional:
SPRING_DATASOURCE_URL- overrides DB URL (default:jdbc:sqlite:src/main/resources/db/app.db)scheduler.shutdowns.fixed-delay-ms- schedule polling interval in minutes (default:10)
- Set token in
.envor export it:
export TELEGRAM_BOT_TOKEN=your_token_here- Install Chromium for Playwright (first run only):
./gradlew playwrightInstallChromium- Start the app:
./gradlew bootRunThe app starts on port 8080.
./gradlew clean
./gradlew test
./gradlew buildBuild local image:
docker build -t firefly:local .Run local container:
mkdir -p ./db
touch ./db/app.db
docker run --rm \
-e TELEGRAM_BOT_TOKEN=your_token_here \
-e SPRING_DATASOURCE_URL=jdbc:sqlite:/app/db/app.db \
-v "$(pwd)/db:/app/db" \
-p 8080:8080 \
firefly:localNote: docker-compose.yml is currently deployment-oriented and references ghcr.io/ndmik-dev/firefly:latest with host volume /opt/firefly/db:/app/db.
.github/workflows/build.yml: build on pushes tomain(currently marked as temporary in the file comment)..github/workflows/deploy.yml: on pushes todev, buildsbootJar, builds and pushesghcr.io/${{ github.repository }}:latest, then triggers Dokploy deployment.