About Book Club

Project Overview

Book Club is a web application designed for book enthusiasts to discover, discuss, and share their reading experiences. Built as part of the FHNW Web Engineering course (HS 2025), this application demonstrates modern web development practices using Spring Boot and Kotlin.

Users can search for books using the Google Books API, create discussion rooms for specific titles, and engage in real-time conversations with other readers who share their literary interests.

Features

  • Book Search: Search millions of books via Google Books API integration
  • User Authentication: Secure registration and login with encrypted passwords
  • Book Chats: Create or join discussion rooms for any book
  • Real-Time Messaging: Instant message delivery using MQTT pub/sub
  • Responsive Design: Works seamlessly on desktop and mobile devices
  • Global Chat: Community-wide discussions for all members

Technology Stack

  • Backend: Kotlin 2.2.10, Spring Boot 4.0.0
  • Database: PostgreSQL with Spring Data JPA
  • Templates: Pebble Template Engine
  • Security: Spring Security with BCrypt
  • Real-Time: Eclipse Paho MQTT Client
  • Testing: JUnit 5, Mockito, Playwright

Zusatzthema (Individual Advanced Topics)

1. Authentication & Authorization

The application implements comprehensive security using Spring Security. User passwords are hashed using BCrypt password encoding, ensuring secure credential storage.

Role-based access control is implemented with multiple roles:

  • OWNER: Full control over chat rooms they created
  • MODERATOR: Can manage messages and members
  • MEMBER: Standard participant access

Protected routes require authentication, while public routes (search, book details) remain accessible to all visitors. CSRF protection is enabled for all form submissions.

2. External REST API Integration - Google Books

The application integrates with the Google Books API to provide access to millions of book titles. Key implementation features include:

  • Search Functionality: Full-text search with configurable result limits
  • ISBN Extraction: Automatic parsing of ISBN-10 and ISBN-13 identifiers
  • Image Handling: HTTPS thumbnail URL conversion for security
  • Caching: 5-minute in-memory cache to reduce API calls
  • Work ID Generation: Deduplication strategy for different editions

The integration is centralized in GoogleBooksService with proper error handling and logging for production reliability.

3. MQTT Real-Time Messaging

Real-time chat functionality is powered by MQTT (Message Queuing Telemetry Transport) using the Eclipse Paho client library. This publish-subscribe messaging protocol enables:

  • Instant Delivery: Messages appear immediately for all participants
  • Scalability: Decoupled architecture supports many concurrent users
  • Topic-Based Routing: Each chat room has dedicated message topics
  • Server-Sent Events: Browser clients receive updates via SSE streams

The MQTT service handles connection management, message serialization with Jackson, and integration with the Spring application context.

Authors

Developed for FHNW Web Engineering HS 2025

Instructor: Silvan Zurbruegg