Feature/notify creator new fan#97
Merged
elizabetheonoja-art merged 7 commits intoSubStream-Protocol:mainfrom Mar 25, 2026
Merged
Feature/notify creator new fan#97elizabetheonoja-art merged 7 commits intoSubStream-Protocol:mainfrom
elizabetheonoja-art merged 7 commits intoSubStream-Protocol:mainfrom
Conversation
|
@Skinny001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Member
|
resolve conflicts |
Contributor
Author
Done |
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.
This pull request introduces a new subscription event system with in-app and email notifications, as well as a public API for retrieving creator subscriber statistics. It also refactors the main application entry point to support these new features and adds new routes and services for handling subscription events and payouts. The most important changes are grouped below.
Subscription Event Handling and Notification System
SubscriptionService(src/services/subscriptionService.js) to handle subscription events (subscribe, unsubscribe, expire), maintain cached subscriber counts, emit events, and trigger notifications and audit logs.NotificationService(src/services/notificationService.js) to manage in-app notifications for creators, with methods to add, list, and mark notifications as read.src/utils/email.js) using nodemailer for sending notification emails to creators when they gain new subscribers.API and Routing Enhancements
/api/subscription/eventswebhook endpoint (routes/subscription.js) to receive subscription events, validate secrets, and delegate processing to theSubscriptionService./api/creator/:id/statsendpoint to fetch creator statistics, including the cached subscriber count./api/payoutsendpoint to retrieve payout information for a creator.Main Application Refactor
index.jsto initialize and inject the new services (SubscriptionService,NotificationService, email utility), exposesubscriptionServiceon the app for use in routers, and register new routes for subscription events and payouts. [1] [2] [3]Testing
subscription.test.js) to verify subscription event processing and the correctness of the subscriber count API.Dependency Management
better-sqlite3as a new dependency inpackage.jsonto support improved database operations.close #5