Skip to content

Add configurable notifications via Slack #1

@dividing-by-zaro

Description

@dividing-by-zaro

Overview

Add a notification system that alerts users when significant changes occur in their tracked repositories. Notifications should be real-time for major/breaking changes and digest-style for minor updates.

Goals

  • Keep users informed about important repo changes without requiring them to check the feed
  • Provide flexibility in how and when users receive notifications
  • Support both email and Slack (webhook) as notification channels

Features

Notification Triggers

  • Immediate notifications for:
    • Major/breaking changes (significance: major)
    • Security updates
    • New releases
  • Digest notifications (daily/weekly configurable) for:
    • Minor and patch updates
    • Feature additions and enhancements
    • Bug fixes

Email Notifications

  • Beautiful HTML email templates matching the app's neo-brutalist design
  • Configurable frequency: immediate (for major), daily digest, weekly digest, or off
  • Unsubscribe link in every email
  • Email verification before enabling

Slack Integration (Webhook)

  • Users provide a Slack webhook URL
  • Posts formatted messages to the configured channel
  • Rich message formatting with:
    • Repo name and update summary
    • Significance level indicator
    • Link back to the update in the app
    • Category badges

User Settings

  • Global notification preferences (default for all repos)
  • Per-repo overrides (e.g., turn off notifications for a specific repo)
  • Channel selection (email, Slack, or both)
  • Quiet hours / timezone awareness

Technical Considerations

  • Queue-based notification processing (avoid blocking the main app)
  • Rate limiting for external API calls (Slack, email provider)
  • Batch digest emails efficiently
  • Store notification preferences in User and UserRepo tables
  • Track notification history for debugging/user reference

Out of Scope (for now)

  • Full Slack app with interactive commands
  • Mobile push notifications
  • In-app notification center

Implementation Plan: Slack Integration (Phase 1)

Slack webhooks are simpler to implement than email (no deliverability concerns, no third-party service setup, no HTML email formatting). Recommended as the first notification channel.

1. Database Changes

  • Add slackWebhookUrl to User table
  • Add notifyOnMajor, notifyOnRelease boolean fields
  • Prisma migration

2. API Endpoints

  • PUT /api/user/notifications - save preferences
  • POST /api/user/notifications/test - send test message to verify webhook

3. Slack Service (server/src/services/slack.ts)

  • sendUpdate(webhookUrl, update) - format and POST
  • sendRelease(webhookUrl, release) - format and POST
  • Block Kit message formatting for rich messages

4. Notification Triggers

  • Hook into existing classification pipeline
  • After new major update indexed → queue notification
  • After new release indexed → queue notification

5. Settings UI

  • Webhook URL input field
  • Toggle switches for notification types
  • "Send test" button to verify configuration

6. Rate Limiting / Error Handling

  • Don't spam on bulk indexing (initial repo add, sweeps)
  • Handle webhook URL invalidation gracefully
  • Batch notifications during sweep runs

Complexity Notes

The Slack service itself is straightforward. The main complexity is deciding when to trigger notifications:

  • Avoid spam during initial repo indexing
  • Batch during daily sweep runs
  • Handle invalid/revoked webhook URLs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions