TGist ingests posts from selected Telegram channels, creates one daily digest with OpenAI, and sends it to a configured Telegram target chat.
- Admin endpoints for:
- channel management,
- TDLib auth flow,
- manual ingestion/run/summary triggers.
ChannelService: manage channel config.IngestionService: fetch and persist daily channel messages.DigestComposerService: build prompt + request OpenAI + persist digest.DigestDeliveryService: send digest via Telegram and mark delivery.
- TDLib adapter:
- native client lifecycle,
- auth state handling,
- chat/message operations.
- OpenAI adapter:
- API call abstraction for summary generation.
- JPA models for channels/messages/runs/summaries.
- Repository layer for read/write and idempotency queries.
- Flyway migrations as schema source of truth.
- Periodic ingestion job.
- Daily digest job.
- Overlap/lock protection to avoid concurrent runs.
- Scheduler (or manual endpoint) starts ingestion.
- TDLib fetches channel posts for configured window.
- Messages are normalized + deduplicated and saved.
- Daily digest run aggregates previous local day messages.
- OpenAI generates final digest text.
- Digest is saved and sent to configured target chat.
- Run status/metrics stored in
daily_runsandrun_items.
- Input: Telegram channel posts (via TDLib).
- Process: Store raw posts -> aggregate/filter -> summarize via OpenAI.
- Output: Telegram digest message + persisted digest history.
- Secrets from environment variables only.
- Idempotent ingestion and delivery.
- Fail-fast config validation on startup.
- Structured logs with sensitive value redaction.