How kiin21/booking works
Project type and purpose
• This is a backend-only RESTful API application (no UI) built with Spring Boot.
• Its primary purpose is to manage homestay listings, handle bookings (including availability and pricing), process payments via VNPay, and maintain user profiles.
• It follows domain-driven design (DDD) and layered architecture.
File structure
• Top-level build files: build.gradle, Gradle wrapper, Docker compose under docker/, SQL scripts under sql/.
• Source code under src/main/java/org/example/booking:
• rest/ – Spring MVC controllers handling HTTP endpoints.
• app/ – DTOs, constants, request/response utilities, and a ResponseFactory.
• domain/ – Four subdomains (booking, homestay, payment, user), each with entity, dto, repository, service, plus mapper packages under booking.
• infrastructure/ – Shared utilities and constants (e.g., date helpers).
• Resources: application.yml for configuration.
• Tests under src/test/.
• The presence of repositories (Spring Data JPA), entities, DTOs, mappers (MapStruct), and services shows a classic layered, DDD-style architecture.
README for additional insights
• Confirms PostgreSQL with PostGIS for geospatial queries.
• VNPay integration for payments.
• Bean Validation, Lombok, Hypersistence Utils for performance.
• Factory pattern for service instantiation.
• Standardized API responses with ResponseDTO.