Architecture
System Overview:
The Notification Service utilizes a combination of Google Cloud Pub/Sub for message queuing and Redis for message distribution. It consists of several key components:
Frontend Clients: Web applications that subscribe to receive notifications.
Notification Service Backend: The core service responsible for receiving messages from Pub/Sub, processing them, and distributing them to subscribed clients.
Worker: A background worker responsible for publishing messages to the redis channel based on specific triggers or events within the system.
Redis: A high-performance, in-memory data store used as a message broker for real-time communication between the Notification Service and subscribed clients.
Architectural Components:
Google Cloud Pub/Sub:
Publishers: Smart contract monitor service within our system that publishes messages to Pub/Sub topic.
Subscribers: The Notification Service backend acts as a subscriber to relevant Pub/Sub subscriptions.
Redis:
Channels: Redis channels represent different notification categories by user wallet address.
Subscribers: Frontend clients subscribe to specific Redis channel categories with user wallet addresses to receive relevant notifications.
Notification Service Backend:
Event Processor: Responsible for receiving messages from Pub/Sub, processing them, and publishing them to the user wallet Redis channel.
API Endpoints: Exposes endpoints for frontend clients to subscribe to notifications and receive updates.

Use Case:
Certainly, the callouts in the below diagram describe components and actions related to a one of the use case within the system for the notification service.
Login: The entry point for a user to access the system.
Authentication: The process of verifying the identity of the user.
Take Loan: The action where the user initiates a loan process.
Subscribe events: The client subscribes to events relevant to them.
Supply Asset: An action where assets are supplied, likely by the user.
Execute Transaction: The process of executing a transaction on a blockchain.
OnChain: Indicative of processes that occur on the blockchain (on-chain).
Update the status: An operation to update the status of a process or transaction.
Pubsub: The pub/sub system used for receiving message from sc monitor service.
Server side events: Mechanism for the server to send real-time updates to clients with a persistent connection.

Last updated