feat(notifications): add multi-channel notifications module (closes #158)#194
Merged
antosubash merged 6 commits intoMay 11, 2026
Merged
Conversation
) Adds modules/Notifications with INotifier for cross-module sends and a channel fan-out pipeline backed by BackgroundJobs. In-tree channels: mail (delegates to Email), database (persists for in-app inbox), and a log-based SMS default that out-of-tree Twilio/Slack/push channels can replace. Per-user channel opt-ins live in Settings; the inbox view ships an Inertia page with list, unread count, mark-read, and mark-all-read endpoints.
Creates `Notifications_Notifications` plus the (UserId, CreatedAt, Id) and (UserId, ReadAt) indexes that back the inbox list and unread-count queries. Also captures accumulated model-snapshot drift from previously-removed modules — same pattern as prior per-module migrations.
Picks up the @simplemodule/notifications workspace in package-lock.json and reformats the generated routes.ts to match biome's line-width rule.
`outline` isn't in the Badge variant union; swap to `info` for the unread indicator and `default` for the channel chip.
Deploying simplemodule-website with
|
| Latest commit: |
79c9dcf
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6fadbf5f.simplemodule-website.pages.dev |
| Branch Preview URL: | https://feature-feat-notifications-m.simplemodule-website.pages.dev |
The Dockerfile and Dockerfile.worker enumerate every module's csproj for the dotnet restore cache layer; missing the Notifications entries broke the docker CI check on the main image and would break the worker image too once it gets rebuilt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
modules/NotificationsexposingINotifier.SendAsync/SendNowAsyncso any module can dispatch a notification across the channels declared byINotification.Via(recipient).DatabaseChannel(persistsNotifications_Notificationsrows for the in-app inbox + outboxNotificationSentEvent),MailChannel(delegates toIEmailContracts), and a log-basedLogSmsChannelas the default SMS sink that out-of-tree providers (Twilio, Slack, push) can replace./notifications/with list, unread-count, mark-read, and mark-all-read endpoints, plus per-user channel opt-in settings.IBackgroundJobs.EnqueueAsync<DispatchNotificationJob>so a slow channel can't block siblings.Verification
https://localhost:5001/notifications/via playwright-cli:0 total · 0 unreadand a disabled "Mark all read".1 total · 1 unread.POST /api/notifications/{id}/readreturns 204 and the UI re-renders to1 total · 0 unreadwith the per-item "Mark read" button gone.POST /api/notifications/read-allreturns 200;GET /api/notifications/unread-countreturns the live count.npm run check,npm run build,dotnet build,dotnet test --no-build(every module suite + Core + Generator green), andnpm run test:smoke -w tests/e2e(47/47 passed).Test plan
Notifier.SendAsync(one job per channel, JSON serialized once outside the loop) and the JSON-blob job dispatch inDispatchNotificationJob— flagged as the structural-rewrite candidate (move toIMessageBuslater) in the cleanup pass.