Booking lifecycle, QR check-in, and domain events for the Library Booking System. Orchestrates user-service, catalog-service, and policy-service on each reservation and publishes booking.events for notifications, analytics, catalog updates, and realtime clients.
flowchart LR
Client --> GW[api-gateway]
GW --> BOOK[booking-service]
BOOK --> USER[user-service]
BOOK --> CAT[catalog-service]
BOOK --> POL[policy-service]
BOOK --> RMQ[(RabbitMQ booking.events)]
RMQ --> NOTIF[notification-service]
RMQ --> ANA[analytics-service]
RMQ --> RT[realtime-gateway]
Base path: http://localhost:8080/api/bookings
| Method | Path | Description |
|---|---|---|
| POST | / |
Create booking (policy validation runs first) |
| GET | / |
List bookings (scoped by role) |
| GET | /{id} |
Booking details |
| PUT | /{id} |
Update booking |
| DELETE | /{id} |
Cancel booking |
| GET | /user/{userId} |
Bookings for a user |
| GET | /resource/{resourceId} |
Bookings for a resource |
| POST | /{id}/check-in |
QR / check-in flow |
| GET | /booked-resources |
Resources with active bookings |
See API_REFERENCE.md. Authorization uses JWT plus booking ownership rules from common-aspects.
- Java 17, Spring Boot 3.5
- JPA (PostgreSQL), AMQP, Spring Security, AOP
- Scheduled tasks for grace-period and completion handling (
app.booking.grace-period-minutes, default 15)
| Variable | Purpose |
|---|---|
DB_* |
PostgreSQL (booking_db in Compose) |
RABBITMQ_* |
Event publishing |
USER_SERVICE_URL, CATALOG_SERVICE_URL, POLICY_SERVICE_URL |
Upstream HTTP |
JWT_SECRET, JWT_EXPIRATION |
Bearer validation |
HTTP port 3004.
cd docker-compose
docker compose up -d booking-serviceDepends on user, catalog, policy, Postgres, and RabbitMQ. For a single-service run, start those dependencies and mvn spring-boot:run from this repository.
- policy-service — rule validation
- catalog-service — resource catalog
- frontend-web — booking UI and QR check-in