How zakenn/notification-service-demo works
1. This is a single Spring Boot service called notification-service-demo. Its core responsibility is to accept notification requests and send emails, with supporting audit/logging behavior and RabbitMQ integration.
2. The main application boundary is the Java Spring Boot runtime. NotificationApplication is the bootstrap entry point, and the project is built and run with Maven (pom.xml, Maven wrapper).
3. The request ingress is a REST layer in com.notification.rest. NotificationController exposes the API surface for creating or triggering notifications. The controller uses DTOs rather than domain entities, so the external contract is isolated in NotificationDto and FileDto.
4. The central business logic sits in NotificationService. This is where notification composition and delivery are likely coordinated, including email sending through JavaMail and any message handling needed for asynchronous flow.
5. Email delivery is the primary outbound integration. The README explicitly states the service uses JavaMail, and the demo environment points to MailHog as the SMTP target. That means emails are not sent to a real mailbox provider in the demo; they are captured by MailHog for inspection.
6. RabbitMQ is a secondary integration boundary, configured in RabbitConfiguration. This suggests the service can consume from or publish to a queue/exchange to decouple notification production from delivery. The configuration class is the place where the messaging topology and Spring AMQP wiring live.
7. Cross-cutting auditing/logging is handled with AOP in AuditAspect. This keeps logging behavior separate from the controller/service flow and indicates the app is instrumented at method or request boundaries rather than embedding audit code in business logic.
8. NotificationConstants centralizes shared values used by the notification flow. In an architecture diagram, this is not a runtime subsystem, but it supports consistent message subjects, paths, or other fixed configuration used across controller, service, and messaging code.
9. Configuration is split across application.properties and bootstrap1.properties. These files likely hold environment-specific settings for mail, RabbitMQ, and application defaults. The presence of bootstrap properties suggests early startup configuration is important, probably for external connectivity.
10. The src/main/resources/images directory implies the service may attach or embed static images in notification emails. That makes the email subsystem more than plain text and suggests the service can assemble richer email content.
11. The end-to-end data flow is: client calls REST controller → controller maps request into DTOs → service prepares notification content → service sends email via JavaMail and/or interacts with RabbitMQ → MailHog receives the SMTP traffic during demo runs. Auditing via AOP happens orthogonally around these service operations.
12. Tests are minimal in the tree, with only a basic Spring Boot application test. So the repository is architecture-focused and demo-oriented rather than a heavily tested production system.
13. Operationally, the only explicitly documented external infrastructure is Dockerized MailHog for local email capture. RabbitMQ is configured in code and should be considered another runtime dependency, even though its startup is not documented in the README.
14. In diagram terms, the key boxes are: REST API, Notification Service, Audit Aspect, RabbitMQ config/integration, and Mail delivery via JavaMail to MailHog. The important boundary is that the app mediates between synchronous HTTP input and outbound notification side effects.
Main entry points: NotificationService.java Service · NotificationController.java Controller · NotificationApplication.java App · AuditAspect.java Audit Aspect
Components 14
Spring Boot runtime
Application bootstrap and in-process request handling.
- App · Starts the notification-service-demo application.
src/main/java/com/notification/NotificationApplication.java
REST boundary
HTTP ingress and request/response DTOs.
- Controller · Exposes the notification API surface.
src/main/java/com/notification/rest/NotificationController.java - Notification DTO · External notification contract used by the REST layer.
src/main/java/com/notification/rest/dto/NotificationDto.java - File DTO · Represents file data passed through the API contract.
src/main/java/com/notification/rest/dto/FileDto.java
Notification core
Business logic and shared notification support.
- Service · Coordinates notification composition and delivery.
src/main/java/com/notification/service/NotificationService.java - Constants · Centralized values used across notification flow.
src/main/java/com/notification/utils/NotificationConstants.java - Audit Aspect · Cross-cutting audit/logging around application operations.
src/main/java/com/notification/aspect/AuditAspect.java
Outbound integrations
Email and messaging integration points.
- Rabbit Config · Spring RabbitMQ wiring and messaging topology setup.
src/main/java/com/notification/config/RabbitConfiguration.java - MailHog · Demo SMTP target that captures outbound email traffic.
Configuration
Runtime and environment configuration files.
- App props · Primary application settings and external connectivity values.
src/main/resources/application.properties - Bootstrap props · Early startup properties for environment and connectivity.
src/main/resources/bootstrap1.properties
Build
Maven build and wrapper tooling.
- Maven POM · Defines dependencies, packaging, and build lifecycle.
pom.xml - Maven Wrapper · Wrapper scripts and metadata used to run Maven consistently.
mvnw
Resources
Static resource bundle used by notifications.
- Images · Images available for email composition or embedding.
src/main/resources/images
Connections 15
- App → Controller: serves · Bootstraps the REST application context.
- Controller → Notification DTO: accepts · Maps incoming requests into the notification contract.
- Controller → File DTO: accepts · Carries attachment data in the API payload.
- Controller → Service: delegates · Hands notification execution to the service layer.
- Service → Constants: uses · Reads shared values for notification composition and routing.
- Service → Images: loads · Uses bundled images when composing richer emails.
- Service → Rabbit Config: integrates · Relies on AMQP wiring for asynchronous messaging.
- Service → MailHog: sends email to · Delivers SMTP traffic to the demo mail capture target.
- Audit Aspect → Controller: wraps · Applies cross-cutting audit/logging at API boundaries.
- Audit Aspect → Service: wraps · Applies cross-cutting audit/logging around business operations.
- App props → Service: configures · Supplies mail and messaging settings used at runtime.
- Bootstrap props → App: initializes · Provides early startup properties for the application.
- Maven POM → App: builds · Defines compilation and packaging for the runtime.
- Maven Wrapper → Maven POM: drives · Provides a consistent Maven execution entrypoint.
- Rabbit Config → MailHog: supports async flow · Messaging is part of the broader notification delivery boundary.