Skip to content

LibraryBookingSystem/Documentation

Repository files navigation

Library Booking System

A microservice platform for reserving library seats and rooms: JWT authentication, role-based access, policy-driven booking rules, real-time availability, in-app notifications, and admin analytics. A Flutter client talks to the stack through a single API gateway.

Highlights

  • Service oriented architecture with clear domain boundaries and a shared security library
  • JWT + RBAC enforced consistently across services via AOP
  • Event-driven updates over RabbitMQ for notifications, analytics, catalog state, and live UI
  • Policy engine for booking validation before reservations are created
  • QR check-in and booking lifecycle automation in the booking service
  • Docker Compose for local full-stack runs on Windows (PowerShell automation included)

Architecture

flowchart TB
  subgraph clients [Clients]
    Flutter[frontend-web]
  end

  subgraph edge [Edge]
    GW[api-gateway :8080]
    RT[realtime-gateway :3008]
  end

  subgraph core [Core services]
    AUTH[auth-service :3002]
    USER[user-service :3001]
    CAT[catalog-service :3003]
    BOOK[booking-service :3004]
    POL[policy-service :3005]
    NOTIF[notification-service :3006]
    ANA[analytics-service :3007]
  end

  subgraph infra [Infrastructure]
  PG[(PostgreSQL)]
  REDIS[(Redis)]
  RMQ[(RabbitMQ)]
  end

  Flutter -->|REST| GW
  Flutter -->|WebSocket /ws/| GW
  GW --> AUTH
  GW --> USER
  GW --> CAT
  GW --> BOOK
  GW --> POL
  GW --> NOTIF
  GW --> ANA
  GW --> RT

  AUTH --> USER
  BOOK --> USER
  BOOK --> CAT
  BOOK --> POL
  BOOK --> RMQ
  CAT --> RMQ
  POL --> RMQ
  NOTIF --> RMQ
  ANA --> RMQ
  RT --> RMQ

  USER --> PG
  CAT --> PG
  BOOK --> PG
  POL --> PG
  NOTIF --> PG
  ANA --> PG
  USER --> REDIS
Loading

Repositories

Repository Role
Documentation System overview, API reference, authorization matrix
docker-compose Local orchestration, database init, setup scripts
api-gateway Nginx reverse proxy and WebSocket entry
auth-service Registration, login, JWT issuance
user-service Profiles, approval workflow, restrictions
catalog-service Resource catalog and availability
booking-service Bookings, QR check-in, lifecycle events
policy-service Booking rules and validation API
notification-service In-app notifications and optional email
analytics-service Utilization metrics and audit logs
realtime-gateway WebSocket fan-out from domain events
common-aspects Shared JWT, RBAC AOP, logging, audit publishing
frontend-web Flutter client (Android, Windows, web)

Quick start

  1. Clone the repos you need (at minimum docker-compose and each service image referenced in its compose file, or clone the full org).
  2. From the docker-compose repository:
cd docker-compose
powershell -ExecutionPolicy Bypass -File setup-complete.ps1
  1. Confirm the gateway: curl http://localhost:8080/health
  2. Run the Flutter app from frontend-web with the API base URL pointing at http://localhost:8080 (use http://10.0.2.2:8080 on the Android emulator).

Default infrastructure ports: PostgreSQL 5433, Redis 6379, RabbitMQ 5672 (management UI 15672).

Documentation in this repo

Technology summary

Layer Stack
Services Java 17, Spring Boot 3.5, PostgreSQL, RabbitMQ
Gateway Nginx (REST + WebSocket proxy)
Realtime Node.js, ws, AMQP consumer
Client Flutter / Dart 3+
Shared library Maven JAR (common-aspects) for JWT and AOP authorization

Typical request flow

sequenceDiagram
  participant C as Client
  participant G as api-gateway
  participant A as auth-service
  participant U as user-service
  participant B as booking-service
  participant P as policy-service

  C->>G: POST /api/auth/login
  G->>A: forward
  A->>U: validate credentials
  U-->>A: user profile
  A-->>C: JWT

  C->>G: POST /api/bookings (Bearer JWT)
  G->>B: forward
  B->>P: validate booking rules
  P-->>B: allowed / denied
  B-->>C: booking created
  Note over B: Publishes booking.events to RabbitMQ
Loading

About

Microservice library seat and room booking: Spring Boot services, JWT/RBAC, RabbitMQ, Flutter client, Docker Compose.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors