Skip to content

✨ Notifications: in-app alerts and email digest #27

@fusion94

Description

@fusion94

Summary

The community has no way to know when interesting things happen. Add a lightweight notification system covering the two highest-value events — invite usage and new community events — surfaced as an in-app badge plus an opt-in email digest.

Depends on #20 (Resend) for the email side.

Expected Behavior

  • New table notifications(id, recipient, type, payload, created_at, read_at).
  • Notifications generated server-side when:
    • Someone registers using your invite token (notify the inviter).
    • A community event is created (notify all members).
  • AppBar gets a bell icon with an unread count badge.
  • Clicking it opens a dropdown listing recent notifications with click-through links (e.g. to the event).
  • Profile page exposes a "Daily digest email" toggle — when on, Resend job sends a once-a-day summary of unread notifications.

Proposed Approach

  1. Add notifications table and helper createNotification(recipient, type, payload).
  2. Wire createNotification into the register handler (server/index.js:209) and event-create handler (server/index.js:1076).
  3. Add GET /api/notifications (auth) and POST /api/notifications/:id/read.
  4. Frontend: bell icon in Layout.jsx, dropdown component, polling every 60s while tab is focused.
  5. Daily digest: cron-style scheduled task on the server (or external cron hitting an admin endpoint), iterate users with digest_enabled = 1 and unread notifications, send via Resend.

Acceptance Criteria

  • Inviter gets notified when their invite is used.
  • All members get notified on community event creation.
  • Bell icon shows unread count, dropdown lists notifications, marking-read works.
  • Profile has a "daily digest" toggle stored per user.
  • Digest job runs once per day and skips users with no unread notifications.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions