@@ -266,30 +266,38 @@ Preferences are checked automatically before sending. If a user has disabled a c
266266
267267## Architecture
268268
269- ```
270- NotificationModule
271- forRoot() / forRootAsync()
272- |
273- +-- NotificationService -- unified send() API, routes to channels
274- | |
275- | +-- routeEmail() -- queues to BullMQ 'notifications-email'
276- | +-- routeInApp() -- delegates to InAppService
277- | +-- routeSms() -- queues to BullMQ 'notifications-sms'
278- |
279- +-- EmailProcessor -- BullMQ worker, uses EMAIL_PROVIDER
280- | +-- SmtpEmailProvider -- nodemailer
281- | +-- SendGridEmailProvider -- SendGrid API
282- |
283- +-- SmsProcessor -- BullMQ worker, uses SMS_PROVIDER
284- | +-- TwilioSmsProvider -- Twilio API
285- |
286- +-- InAppService -- direct Prisma writes (no queue)
287- +-- InAppController -- REST API for in-app notifications
288- |
289- +-- PreferenceService -- user notification preferences
290- +-- PreferenceController -- REST API for preferences
291- |
292- +-- TemplateService -- Handlebars template rendering + caching
269+ ``` mermaid
270+ graph TD
271+ Module["NotificationModule<br/>forRoot() / forRootAsync()"]
272+ NService["NotificationService<br/>unified send() API"]
273+
274+ Module --> NService
275+ Module --> Templates["TemplateService<br/>Handlebars + caching"]
276+
277+ NService -->|"channel: email"| EmailQ["BullMQ Queue<br/>notifications-email"]
278+ NService -->|"channel: in_app"| InApp["InAppService<br/>direct Prisma writes"]
279+ NService -->|"channel: sms"| SmsQ["BullMQ Queue<br/>notifications-sms"]
280+
281+ EmailQ --> EmailProc["EmailProcessor"]
282+ EmailProc --> SMTP["SmtpEmailProvider<br/>nodemailer"]
283+ EmailProc --> SendGrid["SendGridEmailProvider"]
284+
285+ SmsQ --> SmsProc["SmsProcessor"]
286+ SmsProc --> Twilio["TwilioSmsProvider"]
287+
288+ InApp --> InAppCtrl["InAppController<br/>/notifications"]
289+
290+ Module --> PrefSvc["PreferenceService"]
291+ PrefSvc --> PrefCtrl["PreferenceController<br/>/notification-preferences"]
292+
293+ style Module fill:#e3f2fd,stroke:#1565c0
294+ style NService fill:#fff3e0,stroke:#e65100
295+ style EmailQ fill:#fce4ec,stroke:#c62828
296+ style SmsQ fill:#fce4ec,stroke:#c62828
297+ style InApp fill:#e8f5e9,stroke:#2e7d32
298+ style SMTP fill:#f3e5f5,stroke:#6a1b9a
299+ style SendGrid fill:#f3e5f5,stroke:#6a1b9a
300+ style Twilio fill:#f3e5f5,stroke:#6a1b9a
293301```
294302
295303## License
0 commit comments