How minhtumtn/the-duck-note works
Main Components
• API Gateway: Acts as the single entry point (handles authentication filtering and request routing).
• Eureka Server: Manages service registration and discovery.
• Authentication Service: Manages user authentication, JWT generation/validation, and security.
• Notification Service: Listens for events (via RabbitMQ) and sends out notifications.
• Profile Service: Responsible for managing user profiles.
• Redis Demo: A demo or example service, likely illustrating caching mechanisms using Redis.
• Commons Module: Shared constants, DTOs, entities, and utility classes common to the other services.
• Data Store (MySQL): Used by several services (as seen with MySQL data files).
• RabbitMQ: The message broker used for asynchronous communication among services.
Relationships & Interactions
• The API Gateway routes external API calls to the proper microservice endpoints (authentication, profile, etc.).
• All services are registered with the Eureka Server for discovery and fault tolerance.
• The Authentication Service uses JWT for secure communication and intercalls; it is also likely accessed by other services when verifying user tokens.
• The Notification Service listens to RabbitMQ messages (with configurations defined in both the API gateway and notification service) to push alerts or notifications.
• The Profile and Authentication services interact via Feign clients (or REST calls) to exchange user information.
• The Redis Demo service communicates with Redis (as evident from its Redis configuration) and may also interact with MySQL for persistent storage.
• The shared commons module supports multiple services with common utilities and data models.
Architectural Patterns and Components
• Microservices Architecture: Each service runs as an independent module with its own configuration and lifecycle.
• Service Discovery: Eureka Server enables dynamic discovery which the API Gateway and other services use to locate endpoints.
• API Gateway Pattern: Centralizes entry point, authentication filtering, and possibly load balancing.
• Message-driven communication: RabbitMQ is used to decouple parts of the system for asynchronous processing.
• Shared library/component: The Commons module helps reduce duplication of business and shared logic.
• Data Persistence: Multiple services likely interact with a common or separate MySQL instance, as seen by the extensive MySQL data directory.
– Show external client requests entering through the API Gateway.
– Represent each service’s connection to the MySQL database if applicable.
– Frontend components: In this case, even though there’s no UI component explicitly in the file structure, the API gateway serves as the interface.
– Backend services: Authentication, Profile, Notification, Eureka Server, Redis Demo.
– Infrastructure components: RabbitMQ, MySQL.
d. Architectural patterns:
– Clearly denote the microservices with annotated notes explaining the role (for example, “Authentication Service: Handles JWT security logic”, “Notification Service: Listens on RabbitMQ for events”).
– Highlight the role of the Commons module (shared across services).
e. Deployment details:
– Indicate that Docker (and docker-compose.yml) is used to orchestrate running containers.
– You might also indicate that RabbitMQ is launched as a container (as per the README commands).