How yhoney-72/notifyhub works
NotifyHub is a REST notification service: authenticated clients submit raw or templated email/SMS requests, receive acceptance, then Kafka-driven workers deliver them and update status for later history queries. Separate branches manage shared templates and JWT/refresh-token authentication. The README documents retry topics, DLT, Redis/PostgreSQL idempotency, and monitoring; sampled source confirms key service, persistence, and delivery calls. Some unsampled subsystem links are based on README descriptions rather than inspected implementations.
Main entry points: NotificationServiceImpl.java Request and History Service · NotificationEngine.java Notification Engine · GoogleOAuth2SuccessHandler.java Google OAuth Handler · RefreshTokenService.java Refresh Token Service
Components 29
Notification API
- Notification Endpoints
src/main/java/com/notifyhub/notification/controller/NotificationController.java - Request and History Service
src/main/java/com/notifyhub/notification/service/NotificationServiceImpl.java
Async Delivery
- Event Producer
src/main/java/com/notifyhub/messaging/producer/NotificationEventProducer.java - Event Consumer
src/main/java/com/notifyhub/messaging/consumer/NotificationEventConsumer.java - Notification Engine
src/main/java/com/notifyhub/engine/NotificationEngine.java - Email Sender
src/main/java/com/notifyhub/notification/email/EmailNotificationSender.java - Email Provider
src/main/java/com/notifyhub/notification/email/EmailProvider.java - SMS Sender
src/main/java/com/notifyhub/notification/sms/SmsNotificationSender.java - SMS Provider
src/main/java/com/notifyhub/notification/sms/SmsProvider.java
Template Management
- Template Endpoints
src/main/java/com/notifyhub/template/controller/TemplateController.java - Template Service
src/main/java/com/notifyhub/template/service/TemplateServiceImpl.java - Templates
src/main/java/com/notifyhub/template/entity/NotificationTemplate.java - Template Renderer
src/main/java/com/notifyhub/template/renderer/TemplateRendererImpl.java
Authentication
- Authentication Endpoints
src/main/java/com/notifyhub/security/controller/AuthController.java - Refresh Token Service
src/main/java/com/notifyhub/security/service/RefreshTokenService.java - Refresh Token Repository
src/main/java/com/notifyhub/security/repository/RefreshTokenRepository.java - User Repository
src/main/java/com/notifyhub/security/repository/UserRepository.java - Google OAuth Handler
src/main/java/com/notifyhub/security/OAuth/GoogleOAuth2SuccessHandler.java
Persistence and Idempotency
- Notifications
src/main/java/com/notifyhub/notification/entity/Notification.java - Notification Repository
src/main/java/com/notifyhub/notification/repository/NotificationRepository.java - Redis Idempotency
src/main/java/com/notifyhub/notification/idempotency/RedisIdempotencyService.java - Users and Tokens
src/main/java/com/notifyhub/security/entity/AppUser.java
Other components
- Backend Client
- Redis
- PostgreSQL
- Kafka Topics
- SMTP Service
- Twilio
- Google OAuth
Connections 30
- Backend Client → Notification Endpoints: submits requests
- Notification Endpoints → Request and History Service: delegates
src/main/java/com/notifyhub/notification/controller/NotificationController.java - Request and History Service → Notification Repository: saves and queries
src/main/java/com/notifyhub/notification/service/NotificationServiceImpl.java - Notification Repository → Notifications: reads and writes
src/main/java/com/notifyhub/notification/repository/NotificationRepository.java - Request and History Service → Redis Idempotency: checks duplicates
src/main/java/com/notifyhub/notification/service/NotificationServiceImpl.java - Redis Idempotency → Redis: checks keys
- Notifications → PostgreSQL: persists
- Request and History Service → Event Producer: publishes after commit
src/main/java/com/notifyhub/notification/service/NotificationServiceImpl.java - Event Producer → Kafka Topics: publishes event
- Kafka Topics → Event Consumer: dispatches event
- Event Consumer → Notification Engine: hands off event
src/main/java/com/notifyhub/messaging/consumer/NotificationEventConsumer.java - Notification Engine → Notification Repository: loads and updates
src/main/java/com/notifyhub/engine/NotificationEngine.java - Notification Engine → Email Sender: selects by channel
src/main/java/com/notifyhub/engine/NotificationEngine.java - Notification Engine → SMS Sender: selects by channel
src/main/java/com/notifyhub/engine/NotificationEngine.java - Email Sender → Email Provider: uses provider
src/main/java/com/notifyhub/notification/email/EmailNotificationSender.java - Email Provider → SMTP Service: sends mail
- SMS Sender → SMS Provider: uses provider
- SMS Provider → Twilio: sends SMS
- Template Endpoints → Template Service: delegates
src/main/java/com/notifyhub/template/controller/TemplateController.java - Template Service → Templates: manages templates
src/main/java/com/notifyhub/template/service/TemplateServiceImpl.java - Request and History Service → Template Renderer: renders content
- Template Renderer → Templates: uses active template
- Authentication Endpoints → User Repository: loads and saves users
src/main/java/com/notifyhub/security/controller/AuthController.java - Authentication Endpoints → Refresh Token Service: creates and rotates
src/main/java/com/notifyhub/security/controller/AuthController.java - Refresh Token Service → Refresh Token Repository: reads and revokes
src/main/java/com/notifyhub/security/service/RefreshTokenService.java - Refresh Token Repository → Users and Tokens: persists token records
src/main/java/com/notifyhub/security/repository/RefreshTokenRepository.java - User Repository → Users and Tokens: persists accounts
src/main/java/com/notifyhub/security/repository/UserRepository.java - Google OAuth → Google OAuth Handler: authenticates
- Google OAuth Handler → Refresh Token Service: creates refresh token
src/main/java/com/notifyhub/security/OAuth/GoogleOAuth2SuccessHandler.java - Google OAuth Handler → User Repository: loads or saves user
src/main/java/com/notifyhub/security/OAuth/GoogleOAuth2SuccessHandler.java