Skip to content

Add Telegram alerts bot link to monitoring frontend footer#29

Merged
TaprootFreak merged 1 commit into
developfrom
feature/footer-telegram-bot-link
May 7, 2026
Merged

Add Telegram alerts bot link to monitoring frontend footer#29
TaprootFreak merged 1 commit into
developfrom
feature/footer-telegram-bot-link

Conversation

@TaprootFreak

Copy link
Copy Markdown
Contributor

Summary

The monitoring frontend (mainnet + testnet, both PRD and DEV) had no footer or social links. Adds a minimal footer with a "Get alerts" Telegram CTA pointing to the env+chain-correct bot.

  • Bot URLs (4 in total: mainnet|testnet × prd|dev) live as code config in frontend/src/constants.ts — no env variable carries the URL string itself.
  • DEV vs PRD is baked into each image at build time via Docker build-args, with strict VITE_DEPLOYMENT_ENV validation in constants.ts (throws on missing/invalid value, no fallback).
  • Chain is resolved at runtime from window.location.hostname (testnet domains → testnet, else mainnet) — the same image is reused for both monitoring.juicedollar.com and monitoring.testnet.juicedollar.com.
  • Single right-aligned anchor with inline Telegram SVG icon, aria-label="Telegram alerts bot". Footer sticks to the bottom via flex flex-col on the app shell.

Bot mapping (per issue DFXswiss/server#103)

Deployment Hostname Bot
PRD mainnet monitoring.juicedollar.com @juicedollar_monitor_prd_bot
DEV mainnet dev.monitoring.juicedollar.com @juicedollar_monitor_dev_bot
PRD testnet monitoring.testnet.juicedollar.com @juicedollar_monitor_tst_prd_bot
DEV testnet dev.monitoring.testnet.juicedollar.com @juicedollar_monitor_tst_dev_bot

Pipeline

Stage File Mechanism
Image build (DEV, both build and deploy jobs) .github/workflows/frontend-dev.yaml --build-arg VITE_DEPLOYMENT_ENV=dev
Image build (PRD, both build and deploy jobs) .github/workflows/frontend-prd.yaml --build-arg VITE_DEPLOYMENT_ENV=prd
frontend/Dockerfile ARG/ENV pair before npm run build
Runtime nginx static, no compose change :beta and :latest images each carry their fixed VITE_DEPLOYMENT_ENV; chain resolved client-side from hostname

Test plan

  • VITE_DEPLOYMENT_ENV=prd npm run build succeeds; bundle contains all 4 bot URLs (chain lookup is runtime).
  • VITE_DEPLOYMENT_ENV=dev npm run build succeeds.
  • npm run build without env still bundles (Vite does not execute top-level throw at build); validation throws at page-load — fail-loud at first browser hit, no silent fallback.
  • DEV CI workflow builds :beta image → dev.monitoring.juicedollar.com shows @juicedollar_monitor_dev_bot, dev.monitoring.testnet.juicedollar.com shows @juicedollar_monitor_tst_dev_bot.
  • PRD CI workflow builds :latest image → monitoring.juicedollar.com shows @juicedollar_monitor_prd_bot, monitoring.testnet.juicedollar.com shows @juicedollar_monitor_tst_prd_bot.

Notes

  • This mirrors d-EURO/monitoring#62 (already merged) — same Vite/build-args pattern, plus a chain dimension (window.location.hostname check) because JuiceDollar runs the same image on both Citrea Mainnet and Testnet.
  • No DFXswiss/server compose change is required for this PR. The image is environment-baked; chain selection follows from the hostname.
  • npm run lint reports 3 pre-existing errors unrelated to this PR (PositionsTable.tsx, Table.tsx, api.hook.ts); not addressed here.

Introduces a minimal footer with a "Get alerts" Telegram link. Bot URLs
(mainnet/testnet x prd/dev = 4 bots) live as code config in
frontend/src/constants.ts. The chain is resolved at runtime from
window.location.hostname (testnet domains -> testnet, else mainnet).
The prd/dev split is baked into each image at build time via Docker
build-args, with strict validation on VITE_DEPLOYMENT_ENV (no fallback).

- frontend-dev.yaml (:beta on develop) -> VITE_DEPLOYMENT_ENV=dev
- frontend-prd.yaml (:latest on main)  -> VITE_DEPLOYMENT_ENV=prd
@TaprootFreak TaprootFreak marked this pull request as ready for review May 7, 2026 15:00
@TaprootFreak TaprootFreak requested a review from Danswar May 7, 2026 15:00
@TaprootFreak TaprootFreak merged commit 1598ac8 into develop May 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants