Skip to content

LibraryBookingSystem/notification-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notification-service

In-app notifications and optional email delivery for the Library Booking System. Creates user-scoped messages from booking, resource, and policy events on RabbitMQ and exposes an inbox API through the gateway.

Role in the system

flowchart TB
  RMQ[(RabbitMQ)] -->|booking / resource / policy events| NOTIF[notification-service]
  NOTIF --> PG[(notification_db)]
  NOTIF --> MAIL[SMTP optional]
  Client --> GW[api-gateway] --> NOTIF
  NOTIF --> USER[user-service]
Loading

API (via gateway)

Base path: http://localhost:8080/api/notifications

Method Path Description
GET / Notifications for the authenticated user
GET /unread/count Unread count
PUT /{id}/read Mark one notification read
PUT /read-all Mark all read

Ownership is enforced per notification (users only see their own messages).

Stack

  • Java 17, Spring Boot 3.5
  • JPA (PostgreSQL), AMQP, Spring Mail, Spring Security, AOP
  • common-aspects

Configuration

Variable Default (Compose) Purpose
DB_* notification_db Persistence
RABBITMQ_* broker in Compose Event consumption
USER_SERVICE_URL user-service Enrichment when needed
MAIL_ENABLED false Toggle outbound email
MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, MAIL_FROM SMTP when enabled
JWT_SECRET, JWT_EXPIRATION shared with stack API auth

HTTP port 3006.

Run locally

cd docker-compose
docker compose up -d notification-service

Email stays off in the default Compose profile; enable MAIL_* when testing SMTP.

Related repositories

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors