This guide will help you configure mobile notifications for critical service alerts.
You only need to configure ONE notification method. We recommend Telegram for the easiest setup.
Why Telegram?
- ✅ Completely free
- ✅ Instant delivery
- ✅ Easy 5-minute setup
- ✅ Rich formatting support
- ✅ Works on all platforms
-
Create a Telegram Bot
- Open Telegram and search for
@BotFather - Send
/newbotcommand - Follow the prompts to name your bot (e.g., "Health Guardian Bot")
- Copy the bot token (looks like:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz)
- Open Telegram and search for
-
Get Your Chat ID
- Start a chat with your new bot
- Send any message to it (e.g., "hello")
- Open this URL in your browser (replace
<YOUR_BOT_TOKEN>with your actual token):https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Look for
"chat":{"id":in the JSON response - Copy the number after
"id":(e.g.,123456789or-987654321)
-
Configure .env
- Open
backend/.env - Paste your values:
TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz TELEGRAM_CHAT_ID=123456789
- Open
-
Test
- Restart the backend server
- You should see:
📱 Telegram notifications enabled - Trigger a test alert or wait for a real service issue
Good for: Universal delivery (everyone has email)
-
Enable 2-Step Verification
- Go to Google Account Security
- Enable "2-Step Verification" if not already enabled
-
Generate App Password
- In Security settings, scroll to "App passwords"
- Select "Mail" and "Other (Custom name)"
- Enter "Health Guardian" as the name
- Copy the 16-character password (e.g.,
abcd efgh ijkl mnop)
-
Configure .env
EMAIL_USER=your.email@gmail.com EMAIL_PASS=abcdefghijklmnop EMAIL_TO=your.email@gmail.com
-
Test
- Restart the backend
- You should see:
📧 Email notifications enabled
Good for: If you already use Discord
-
Create Webhook
- Open Discord
- Go to Server Settings → Integrations → Webhooks
- Click "New Webhook"
- Name it "Health Guardian"
- Select a channel (e.g., #alerts)
- Copy the webhook URL
-
Configure .env
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/123456789/abcdefghijklmnopqrstuvwxyz
-
Test
- Restart the backend
- You should see:
💬 Discord notifications enabled
After configuring any notification method:
-
Restart the backend server
cd backend npm start -
Check the console for confirmation:
📱 Telegram notifications enabled(if Telegram configured)📧 Email notifications enabled(if Email configured)💬 Discord notifications enabled(if Discord configured)
-
Trigger a test alert (optional):
- Manually stop one of the microservices
- Wait ~30 seconds for the system to detect the failure
- You should receive a notification!
To prevent notification spam:
- Maximum 1 notification per service per 15 minutes
- Only
warningandcriticalalerts are sent healthystatus changes do NOT trigger notifications
- Double-check your bot token
- Make sure you've sent at least one message to the bot
- Verify the chat ID is correct (it can be negative)
- Use an App Password, not your regular Gmail password
- Make sure 2-Step Verification is enabled
- Remove any spaces from the app password
- Verify the webhook URL is complete
- Make sure the webhook hasn't been deleted in Discord
- Check that the channel still exists
- Check backend console for error messages
- Verify at least one notification method is configured
- Ensure the service status actually changed to
warningorcritical - Check if rate-limiting is preventing the notification (15 min cooldown)
You can configure all three methods simultaneously! The system will send alerts to all configured channels.
Example .env:
# All three enabled
TELEGRAM_BOT_TOKEN=123456789:ABC...
TELEGRAM_CHAT_ID=123456789
EMAIL_USER=your.email@gmail.com
EMAIL_PASS=abcdefghijklmnop
EMAIL_TO=your.email@gmail.com
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...- ✅ Never commit
.envto version control (it's already in.gitignore) - ✅ Use app-specific passwords for email (not your main password)
- ✅ Keep bot tokens and webhook URLs private
- ✅ Rotate credentials if they're ever exposed
Once notifications are configured:
- The system will automatically send alerts when services become unhealthy
- You'll receive notifications with:
- Service name and status
- Current metrics (latency, error rate, etc.)
- Timestamp
- Rate-limiting prevents spam (max 1 per service per 15 min)
Happy monitoring! 🚀