Utilization metrics, peak-hour reporting, and centralized audit logs for the Library Booking System. Serves admin analytics over HTTP and ingests booking and audit streams from RabbitMQ.
flowchart TB
BOOK[booking.events] --> ANA[analytics-service]
AUD[audit.events] --> ANA
ANA --> PG[(analytics_db)]
Admin --> GW[api-gateway] --> ANA
| Base path | Audience | Purpose |
|---|---|---|
http://localhost:8080/api/analytics |
Admin | Utilization, peak hours, overall stats |
http://localhost:8080/api/audit-logs |
Admin | Searchable audit trail (paging, failed attempts) |
Booking lifecycle listeners record operational metrics without blocking the booking API.
- Java 17, Spring Boot 3.5
- JPA (PostgreSQL), AMQP, Spring Security, AOP, JJWT
- common-aspects (audit events published from controller AOP in other services)
| Variable | Purpose |
|---|---|
DB_* |
PostgreSQL (analytics_db in Compose) |
RABBITMQ_* |
Booking and audit consumers |
JWT_SECRET, JWT_EXPIRATION |
Admin-only HTTP APIs |
HTTP port 3007.
cd docker-compose
docker compose up -d analytics-service- common-aspects — audit event publication
- booking-service — booking metrics source
- Documentation — API reference (extend for
/api/audit-logsas needed)