feat(notifications): add real-time notification system

Add database tables for notifications and WebSocket tickets
Implement REST API and WebSocket server for real-time delivery
Add NotificationBell component with dropdown and unread badge
Trigger alerts for comments, reactions, and AI moderation results
This commit is contained in:
2026-05-04 10:40:14 +08:00
parent 579d092020
commit a25f1661b5
12 changed files with 1811 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ import {
requestAiModerationReview,
type AiModerationStatus
} from './aiModeration.ts';
import { createLifePostReactionNotification } from './notifications.ts';
type QueryValue = string | string[] | undefined;
@@ -3989,6 +3990,10 @@ export async function setLifePostReaction(
[postId, userId, reactionType]
);
if (result) {
await createLifePostReactionNotification(result.postId, userId);
}
return result ? getLifePostById(result.postId, userId, locale) : null;
}