How mart6delavi/emergency-notification-system works
Main Components
• API Gateway – Represented by the “sensa-api-gateway” module. It acts as the centralized entry point for incoming REST API requests and handles tasks like request filtering, routing, and logging.
• Service Discovery – Shown by the “sensa-discovery-server”. This component enables dynamic service registration and discovery, allowing the other microservices to locate each other.
• Authentication Service – The “sensa-authentication-service” handles user authentication, security (including JWT token handling via Redis), and authorization.
• Notification Service – The “sensa-notification-service” manages the sending and tracking of emergency alerts, particularly via Telegram. It also integrates with Kafka for asynchronous communication.
• Message Delivery Service – The “sensa-message-delivery-service” is responsible for orchestrating the delivery of messages, managing interactions with external clients (like NotificationClient and UserManagementClient), and likely handling retries or scheduling.
• Template Service – The “sensa-template-service” allows creation, storage, and management of message templates.
• User Management Service – The “sensa-user-management-service” handles recipient data, user profiles, and bulk data import/update functionalities.
• External Database and Caching – Use PostgreSQL for persistent storage of recipient data, message logs, and templates. Redis is used to store and quickly access authorization tokens and possibly session data.
• Asynchronous Messaging – Kafka acts as the backbone for inter-service communication (used in several modules including authentication, messaging, and notification).
Relationships and Data Flow
• External users (admin or trigger systems) send REST API requests that hit the API Gateway.
• The API Gateway forwards validated requests to the appropriate service (for example, authentication requests go to the authentication service; sending alerts trigger the message delivery and notification services).
• Connectivity with external systems like Telegram (for sending alerts) should be shown via outbound data flow from the notification service.
• Database interactions (with PostgreSQL) and caching operations (with Redis) should be depicted from the individual services where these operations occur.
Architectural Patterns and Technologies
• Microservices Paradigm – Emphasize that each module is a separate deployable Spring Boot service with its own source tree and Docker configuration.
• API Gateway and Service Discovery Patterns – These provide a scalable entry point and dynamic routing between services.
• Asynchronous Event Processing – Use of Kafka, as well as asynchronous processing techniques for low latency in bulk notifications, should be clearly illustrated.
• Containerization – Since Docker and docker-compose files are present in each service, a container layer can be shown around the microservices to indicate the deployment environment.
• Security – Show the authentication service’s interactions with Redis for token management and the implementation of rate limiting/security filtering (as seen with the RequestFilter and SecurityConfig).