← Build Log

$ cat java hotel management backend.md

Java Hotel Management Backend

A high-performance hotel management backend built in Java 21 with Quarkus and gRPC, implementing a strict hexagonal architecture. It provides room reservations, guest handling, automated email reminders, and an interactive terminal interface containerized with Docker.

Spec sheet

type
backend system & cli tool
stack
Java, Quarkus, gRPC, Hexagonal Architecture, Hibernate ORM, Docker, JUnit 5
status
● archived · since 2025
java hotel management backend — preview
Java Hotel Management Backend preview
fig. 01 · interface previewscale 1:1 · rev 2025

Overview

Managing complex hospitality workflows—from multi-room availability checks to guest communication—requires high throughput, clear domain boundaries, and strong data integrity. This project was developed as an enterprise-grade backend system for hotel operations using Java 21 and the Quarkus framework. The primary goal was to demonstrate how Hexagonal Architecture (Ports and Adapters) decouples core business rules from transport protocols and persistence mechanisms, while leveraging gRPC for efficient, strongly-typed service-to-service communication.

Key Features

  • High-Performance gRPC API: Defined via Protocol Buffers (api.proto) covering hotels, rooms, guests, ratings, and reservations with type safety and fast serialization.
  • Strict Hexagonal Separation: Independent domain layer isolated from infrastructure through explicit service ports, adapters, and dedicated bidirectional data mappers.
  • Automated Notification Engine: Scheduled background worker (BookingNotificationJob) powered by Quarkus Scheduler and Quarkus Mailer to automatically dispatch check-in reminder emails to guests.
  • Interactive Terminal Client: Full-featured interactive CLI (HotelManagementCLI) communicating with the backend over managed gRPC channels.
  • Rigorous Test Suite: Deep test coverage across all architectural boundaries, including unit tests for mappers and domain models, DAO layer verification, mock-based service tests, and end-to-end integration tests.

Architecture & Tech Stack

  • Language & Runtime: Java 21, Quarkus 3.12
  • Transport & Protocol: gRPC 1.66, Protocol Buffers 4.27
  • Persistence & ORM: Hibernate ORM / JPA with an in-memory H2 database
  • Background Jobs & Messaging: Quarkus Scheduler, Quarkus Mailer (SMTP / TLS)
  • Containerization & Build: Maven, Google Container Tools (Jib) for automated Docker container builds
  • Testing: JUnit 5, Mockito, Quarkus JUnit 5 Test Runner

Highlights & Learnings

Implementing a clean hexagonal architecture reinforced the value of domain isolation: business logic remains completely free of database annotations or protocol-specific code, making persistence adapters and gRPC endpoints swappable without touching core validation logic. Furthermore, working with Quarkus and gRPC demonstrated significant memory and startup efficiency gains over traditional Spring Boot setups, particularly when bundling the backend into lightweight, deployable container images.