The Notification System is a robust module designed to facilitate seamless communication with users by sending notifications through various channels such as email, SMS, push notifications, etc. It integrates with Kafka for event-driven architecture and employs a Notifier service to efficiently handle notification delivery. Additionally, it interacts with a User service to manage user subscriptions and preferences.
-
Subscriber Management: Users can subscribe or unsubscribe from notifications for specific services via different channels.
-
Channel Support: Supports multiple notification channels such as email, SMS, push notifications, etc.
-
Event-Driven Architecture: Integrates with Kafka to enable event-driven notification delivery.
-
Notifier Service: Efficiently delivers notifications to users through selected channels.
-
User Management: Interacts with the User service to manage user subscriptions and preferences.
-
Error Handling: Robust error handling mechanisms to ensure reliability and fault tolerance.
The Notification System consists of the following components:
-
Database Client (DBClient): Manages interactions with the database for storing subscriber information, notification channels, and service configurations.
-
Notifier Service: Orchestrates the delivery of notifications to users through various channels based on subscription preferences.
-
Kafka Integration: Communicates with Kafka for event-driven notification delivery.
-
User Service Integration: Interacts with the User service to manage user subscriptions and preferences.
- Clone the Notification System repository from GitHub.
git clone https://github.com/your/notification-system.git
- Install dependencies using npm or yarn.
npm install
or
yarn install
-
Configure the database connection settings in the
config.jsfile. -
Set up the required notification channels and services in the database.
-
Configure Kafka connection settings in the
kafka-config.jsfile.
The Notification System provides the following API methods:
Service API
handleNotification(msg, serviceId): Used to send msg from service to the Notifier, it acts as a 1st point of contact which recieves the msg and serviceId and then directs it to the appropriate recievers/users.
User API
-
getNotificationChannels(): Fetches the list of available notification channels. -
addSubscriber(userId, notificationChannel, serviceId): Adds a new subscriber to receive notifications for a specific service via a chosen channel. -
removeSubscriber(userId, notificationChannel, serviceId): Removes an existing subscriber from receiving notifications for a specific service via a chosen channel. -
getSubscriberList(notificationChannel, serviceId): Retrieves a list of subscribers for a specific service and notification channel.
Integrate the Notification System with your existing services by calling the appropriate API methods to manage subscribers and trigger notifications. Use Kafka for event-driven architecture and ensure proper communication with the Notifier service for efficient notification delivery.

