How p3arl/notification-service works
Project type and purpose
• This is a single Spring Boot microservice (“notification-service”) whose sole responsibility is to send notifications (SMS, Email, Push) to users based on their subscription plan.
• It exposes REST endpoints for managing subscriptions and triggering notifications. It uses an in-memory HSQL database for persistence and will integrate with external push‐notification providers.
File structure
• src/main/java/com/project/config
• Application.java – entry point, SpringBootApplication
• DatabaseConfig.java – HSQL in-memory DataSource setup
• src/main/java/com/project/controller
• NotificationController – REST endpoints to send notifications
• SubscriptionController – endpoints to manage user subscriptions
• src/main/java/com/project/service (and interfaces)
• INotificationService / NotificationService – orchestrates sending notifications
• ISubscriptionService / SubscriptionService – subscription logic
• IUserService / UserService – user lookup, plan resolution
• IPushService – interface for push‐providers
• src/main/java/com/project/utility/service
• SmsService, EmailService – concrete implementations for SMS/Email
• AndroidPushService, ApplePushService – placeholder push integrations
• src/main/java/com/project/repository
• IUserRepository, INotificationRepository – Spring Data repositories
• src/main/resources
• application.properties – configuration (DB URL, credentials)
• testdb/schema.sql & data.sql – in-memory DB initialization
• tests exercise the service layer (NotificationServiceTest).
Key architectural insights from README
• Stateless Spring Boot REST microservice
• In-memory DB for easy testing
• Pluggable notification channels (SMS, Email, future Push)
– Top: Controllers
– Middle: Services (NotificationService, SubscriptionService, UserService)
– Bottom: Repositories
– Client → Controller (HTTP POST/GET)
– Controller → Service (Java method call)
– Service → Repository (JPA calls)
– Service → Utility Service (Strategy invocation)
– Utility Service → External API (REST/SMTP)
Clarity over artistic detail: capture every layer, every integration, and show how data and execution flow through the system from incoming HTTP request to external notification provider.