Skip to content

LibraryBookingSystem/booking-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

booking-service

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.

Role in the system

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]
Loading

API (via 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.

Stack

  • 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)

Configuration

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.

Run locally

cd docker-compose
docker compose up -d booking-service

Depends on user, catalog, policy, Postgres, and RabbitMQ. For a single-service run, start those dependencies and mvn spring-boot:run from this repository.

Related repositories

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors