"The best way to predict the future is to implement it." — Alan Kay
A robust, enterprise-grade hotel management and booking platform designed to handle 10,000+ hotels with optimized dynamic pricing strategies. This system implements a monolithic architecture featuring an advanced HotelMinPrice strategy that efficiently manages 900,000+ records (90 days × 10,000 hotels) for lightning-fast search operations.
Built with modern software engineering principles, this application showcases JWT authentication, role-based access control, real-time payment processing with Stripe webhooks, Decorator pattern for flexible pricing, comprehensive inventory management, intelligent cancellation policies, an AI-powered chatbot using RAG + pgvector, gamification with XP & leaderboards, real-time WebSocket communities, and a fully responsive React + TypeScript frontend.
- 🔐 Secure Authentication — JWT-based authentication with role-based access control (RBAC)
- 💰 Dynamic Pricing Engine — Decorator pattern for seasonal, occupancy, holiday & custom strategies
- 💳 Payment Integration — Stripe Checkout & webhook integration for real-time payment processing
- 📊 Optimized Search — HotelMinPrice strategy for sub-15ms queries across massive datasets
- ⚡ Redis Caching — Sub-2ms repeated API calls with TTL-based cache eviction
- 🤖 AI Chatbot (RAG) — Spring AI + pgvector cosine similarity for accurate hotel recommendations
- 🎮 XP Gamification — Earn XP for bookings, reviews, and referrals; compete on leaderboards
- 💬 Real-Time Communities — WebSocket + STOMP protocol for live travel community chat
- 🏢 Inventory Management — Comprehensive room availability, booking, and admin management
- 📝 API Documentation — Interactive Swagger UI for seamless API exploration
- 🐳 Fully Containerised — Docker Compose setup for consistent deployment
- User Management — Complete user registration, authentication, and profile management
- Hotel Operations — CRUD operations for hotels with manager-specific access control
- Room Management — Dynamic room creation, updates, and inventory tracking
- Booking System — End-to-end booking flow with availability checks and conflict resolution
- Payment Processing — Secure payment handling via Stripe with webhook confirmation
- Cancellation Management — Flexible cancellation policies with automated refund processing
- Dynamic Pricing — Multiple pricing strategies using Decorator pattern
- Reviews & Ratings — Verified-booking-only reviews with auto-updating average ratings
- AI Chatbot — RAG-powered chatbot grounded in real hotel data using pgvector
- Gamification — XP rewards for bookings, reviews, and referrals with a global leaderboard
- Host Approval Workflow — Structured approval for managers with hotel activation gates
- Email Notifications — Transactional emails for registration, booking, cancellation & refunds
- Real-Time Chat — WebSocket communities for sharing travel tips and experiences
- Scalable Architecture — Monolithic design optimised for 10,000+ hotels
- Performance Optimisation — Efficient algorithms handling 900K+ price records (8–15 ms)
- Real-time Updates — Webhook-based payment status synchronisation
- Data Validation — Comprehensive input validation at all API endpoints
- API Documentation — Auto-generated Swagger documentation
- Error Handling — Graceful error handling with meaningful responses
- Role-Based UI — Separate dashboards for Guest, User, Manager, and Admin roles
| # | Screenshot | Description |
|---|---|---|
| 21 | ![]() |
Leaderboard — Global XP-based leaderboard ranking users by bookings, reviews, and referrals. Cached for performance and refreshed after each confirmed booking |
| # | Screenshot | Description |
|---|---|---|
| 24 | ![]() |
|
| ER Diagram — Full database schema | ||
| 25 | ![]() |
Get Hotel — Hotel detail retrieval |
Complete hotel activation process and annual inventory setup (365 days)
Activate.hotel.and.Create.a.Inventory.for.room.1.year.mp4
Full booking demonstration from search to Stripe payment confirmation
Bookings.Flow.of.Airbnb.App.mp4
Every room's 90-day pricing update strategies in action
dynamic_pricing.mp4
| Technology | Version | Purpose |
|---|---|---|
| Java | 17+ | Core programming language |
| Spring Boot | 3.x | Application framework |
| Spring Security | 6.x | Authentication & authorisation |
| Spring Data JPA | 3.x | Data persistence layer |
| Spring AI | Latest | RAG chatbot & vector search |
| PostgreSQL | 14+ | Primary database |
| pgvector | Latest | Vector similarity search |
| Redis | Latest | Caching layer (sub-2ms hits) |
| Hibernate | 6.x | ORM framework |
| JWT | Latest | Token-based authentication |
| Stripe API | Latest | Payment processing |
| WebSocket / STOMP | Latest | Real-time community chat |
| React | 18 | Frontend framework |
| TypeScript | 5.x | Type-safe frontend |
| Swagger / OpenAPI | 3.x | API documentation |
| Docker / Compose | Latest | Containerised deployment |
| Maven | 3.8+ | Dependency management |
| Lombok | Latest | Boilerplate reduction |
| Jackson | Latest | JSON processing |
- Monolithic Architecture — Unified deployment model optimised for scale
- Repository Pattern — Data access abstraction
- Decorator Pattern — Flexible, composable pricing strategies
- Service Layer Pattern — Business logic separation
- DTO Pattern — Data transfer optimisation
- RAG Pattern — Retrieval-Augmented Generation for AI chatbot
┌─────────────────────────────────────────────────────────────┐
│ React + TypeScript Frontend │
│ Search │ Booking │ Dashboard │ Leaderboard │ Community │
└──────────────────────────┬──────────────────────────────────┘
│ REST / WebSocket
┌──────────────────────────▼──────────────────────────────────┐
│ Spring Boot Application (Monolith) │
│ Auth │ Hotels │ Rooms │ Bookings │ Payments │ AI │ XP │
└────┬──────────┬────────────┬───────────────┬────────────────┘
│ │ │ │
┌────▼───┐ ┌──▼─────┐ ┌───▼──────┐ ┌────▼────────┐
│ PgSQL │ │ Redis │ │ Stripe │ │ Spring AI │
│+pgvect.│ │ Cache │ │ Webhooks │ │ + pgvector │
└────────┘ └────────┘ └──────────┘ └─────────────┘
Ensure you have the following installed:
- Java 17 or higher
- Maven 3.8+
- PostgreSQL 14+ with pgvector extension
- Redis
- Docker & Docker Compose (optional but recommended)
- Git
- Stripe Account (for payment processing)
# Clone the repository
git clone https://github.com/ARONAGENT/AirBnb_App_SpringBoot.git
cd AirBnb_App_SpringBoot
# Start all services (Spring Boot + PostgreSQL + Redis)
docker-compose up --build-
Clone the repository
git clone https://github.com/ARONAGENT/AirBnb_App_SpringBoot.git cd AirBnb_App_SpringBoot -
Configure Database
CREATE DATABASE airbnb_db; -- Enable pgvector extension CREATE EXTENSION IF NOT EXISTS vector;
-
Configure Application Properties
Update
src/main/resources/application.properties:# Database Configuration spring.datasource.url=jdbc:postgresql://localhost:5432/airbnb_db spring.datasource.username=your_username spring.datasource.password=your_password # JWT Configuration jwt.secret=your_secret_key jwt.expiration=86400000 # Redis Configuration spring.redis.host=localhost spring.redis.port=6379 # Stripe Configuration stripe.api.key=your_stripe_secret_key stripe.webhook.secret=your_webhook_secret # Spring AI Configuration spring.ai.openai.api-key=your_openai_api_key
-
Build and Run
mvn clean install mvn spring-boot:run
-
Access the Application
- API Base URL:
http://localhost:8080 - Swagger UI:
http://localhost:8080/swagger-ui.html - Frontend:
http://localhost:3000(run React app separately)
- API Base URL:
POST /api/auth/signup # Register user
POST /api/auth/login # Login and receive JWT
POST /api/auth/refresh # Refresh access tokenPOST /api/hotels # Create hotel (Manager only)
GET /api/hotels/{id} # Get hotel by ID
PUT /api/hotels/{id} # Update hotel
DELETE /api/hotels/{id} # Delete hotel
POST /api/hotels/{id}/activate # Activate hotel (Admin only)POST /api/hotels/{hotelId}/rooms # Create room
PUT /api/rooms/{id} # Update room
GET /api/rooms/inventory # Get room inventoryPOST /api/bookings # Create booking
GET /api/bookings/{id} # Get booking status
PUT /api/bookings/{id}/cancel # Cancel booking
GET /api/bookings/my # Get current user's bookingsGET /api/search?city=&checkIn=&checkOut=&rooms= # Hotel searchPOST /api/payments/webhook # Stripe webhook endpointGET /api/admin/hosts/pending # Pending host approvals
PUT /api/admin/hosts/{id}/approve # Approve host
GET /api/admin/reports # Revenue and occupancy reportsPOST /api/chat # Query the AI chatbotGET /api/communities # List communities
POST /api/communities # Create community
WS /ws/chat # WebSocket endpoint (STOMP)POST /api/hotels/{id}/reviews # Post a review (verified bookings only)
GET /api/hotels/{id}/reviews # Get hotel reviews
PUT /api/reviews/{id} # Edit your review
DELETE /api/reviews/{id} # Delete your reviewGET /api/leaderboard # Global XP leaderboard
GET /api/users/me/xp # Current user XP and statsUser Registration:
POST /api/auth/signup
Content-Type: application/json
{
"username": "john_doe",
"email": "john@example.com",
"password": "SecurePass123!",
"role": "USER"
}Hotel Search:
GET /api/search?city=Mumbai&checkIn=2025-08-01&checkOut=2025-08-05&rooms=2
For complete API documentation, visit Swagger UI after running the application at http://localhost:8080/swagger-ui.html.
| Feature | GUEST | USER | HOTEL_MANAGER | ADMIN |
|---|---|---|---|---|
| Browse & Search Hotels | ✅ | ✅ | ✅ | ✅ |
| Create Booking | ❌ | ✅ | ✅ | ✅ |
| Post Reviews | ❌ | ✅ | ✅ | ✅ |
| Earn XP & Leaderboard | ❌ | ✅ | ✅ | ✅ |
| Join Communities | ✅ | ✅ | ✅ | ✅ |
| Manage Hotels & Rooms | ❌ | ❌ | ✅ | ✅ |
| Configure Pricing Strategy | ❌ | ❌ | ✅ | ✅ |
| Approve Host Requests | ❌ | ❌ | ❌ | ✅ |
| Activate Hotels | ❌ | ❌ | ❌ | ✅ |
| View Platform Reports | ❌ | ❌ | ✅ | ✅ |
The search API takes city, dates, and room count and returns results using precomputed HotelMinPrice data. This bypasses real-time inventory aggregation and gives indexed lookups directly. Response times sit consistently around 8–15 ms, with hotel details, amenities, ratings, and minimum nightly price all returned in a single call.
Bookings move through reservation → guest addition → payment → confirmation states. Stripe Checkout handles PCI-compliant card processing, and webhook events update booking status automatically. Inventory is locked during the transaction to prevent double reservations, and the Stripe Refund API processes cancellation refunds without manual intervention.
The pricing engine applies Decorator-based multipliers — seasonal, occupancy, holiday, and custom — over a 90-day precomputed window. Hotel managers can create and assign strategies through the admin API. Updates can be triggered manually or via the nightly scheduled job.
Spring Security with JWT provides stateless auth across all protected endpoints. Users get an access token on login; refresh tokens are stored in cookies. Three roles supported: GUEST, USER, and HOTEL_MANAGER (plus ADMIN).
Redis caches hotel search results, hotel details, and inventory data. TTL-based expiration keeps data consistent, and cache eviction fires automatically on updates. This cuts database load significantly and keeps repeated API calls under 2 ms.
Users earn XP for completed bookings, posted reviews, and referrals. XP totals and a list of visited places are tracked in the user profile. A global leaderboard ranks users by XP and travel activity, cached for fast access and refreshed after each confirmed booking.
Hotel managers can create and manage hotels, rooms, and inventory entirely through admin APIs. Inventory is auto-generated for future dates. The admin panel also surfaces booking, revenue, and occupancy reports. All data can be updated live without a system restart.
Each hotel sets its own cancellation policy with refund percentages tied to days before check-in. When a booking is cancelled, the system calculates the refund amount automatically, calls the Stripe Refund API, and restores inventory to available state.
Only users with confirmed bookings can post reviews. Reviews include a star rating and comments, and authors can edit or delete their own entries. Per-hotel average ratings and review counts update automatically and feed into search ranking and recommendation logic.
The chatbot converts user queries into embeddings and matches them against stored hotel data using pgvector's cosine similarity search. Matched documents are added to the prompt context before the LLM generates a response, keeping answers accurate and grounded in real hotel data.
The platform incorporates a structured approval workflow for users applying to become hosts (managers), ensuring authenticity and quality standards are maintained. Once approved, managers can configure custom strategies such as dynamic pricing and personalised offerings. Hotels remain inactive until verified and approved by the platform authority.
Transactional emails fire automatically for registration, login alerts, booking confirmation, cancellation, and refunds. Each email includes relevant booking details and is triggered by system events rather than scheduled polling.
Users can join travel communities and chat in real time using WebSocket with the STOMP protocol. Messages arrive instantly without page reload. Communities support sharing travel tips, reviews, and plans, adding a social layer to the booking experience.
The frontend is built in React 18 with TypeScript for type safety across all components. Pages cover search, booking, dashboard, leaderboard, community, and admin workflows. All UI communicates with REST APIs and the interface is fully responsive across modern browsers.
The platform provides personalised hotel recommendations by analysing user reviews and past booking behaviour. By understanding user preferences, travel patterns, and feedback shared by other guests, the system suggests hotels that best match individual needs.
Users and guests can post queries and share travel experiences in dedicated community forums, fostering a collaborative social space. Managers directly post real-time updates and announcements. The system enables interactive discussion, allowing users to reply to posts and engage with community managers directly.
The system is fully containerised using Docker and Docker Compose. Services include the Spring Boot backend, PostgreSQL with pgvector, and Redis. Container-based deployment ensures consistent behaviour across development, staging, and production environments.
A few enhancements are currently in progress:
- Dedicated React pages for admin hotel management and user profile settings including avatar upload
- Updated ER diagram reflecting the community module, XP system, and reviews in their final form
- Comprehensive README covering local setup, architecture overview, full API reference, and Docker deployment instructions
- Extended frontend with community creation flows, personalised recommendation pages, and enhanced admin analytics dashboards
- Parallelised nightly pricing batch job using Spring's
@Asyncand thread pool executors — cutting the full 10,000-hotel pricing update from ~33 minutes to under 5 minutes
Contributions are currently not accepted as this is a proprietary project. However, feedback and suggestions are welcome!
If you find any bugs or have feature requests, please open an issue on GitHub.
Copyright (c) 2025 ROHAN UKE
This project and its source code are the exclusive property of the author.
Unauthorized copying, modification, distribution, or commercial use is strictly prohibited.
Limited use is granted for learning, reviewing, and non-commercial demonstration purposes only.
No warranties are provided; use at your own risk.
For permissions beyond this notice, contact: your-rohanuke1@gmail.com
- Spring Framework Team — For the incredible Spring Boot ecosystem
- Stripe — For robust payment processing APIs
- PostgreSQL & pgvector Community — For the reliable database and vector search extension
- Redis — For fast in-memory caching
- React & TypeScript — For the modern, type-safe frontend ecosystem
- Spring AI — For the RAG pipeline and vector store integration
- Open Source Community — For the countless libraries that made this project possible
- Swagger / OpenAPI — For excellent API documentation capabilities
- Talluri, K. T., & van Ryzin, G. J. (2004). The Theory and Practice of Revenue Management. Springer.
- Fowler, M., & Lewis, J. (2014). Microservices: A Definition of This New Architectural Term. martinfowler.com.
- Spring Framework. (2024). Spring AI Reference Documentation — RAG Pipeline and Vector Store Integration. https://docs.spring.io/spring-ai/reference/
- Spring Framework. (2024). Spring Boot 3.x Reference Documentation. https://docs.spring.io/spring-boot/
- Carlson, J. (2013). Redis in Action. Manning Publications.
- Hamari, J., Koivisto, J., & Sarsa, H. (2014). Does Gamification Work? HICSS, pp. 3025–3034.
- pgvector Contributors. (2024). Open-Source Vector Similarity Search for PostgreSQL. https://github.com/pgvector/pgvector
- Gamma, E., Helm, R., Johnson, R., & Vlissides, J. (1994). Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley.
- Spring Security Team. (2024). Spring Security 6.x — JWT Authentication and RBAC. https://docs.spring.io/spring-security/reference/
- Stripe Inc. (2024). Stripe Payments API, Checkout Sessions, and Webhooks Documentation. https://stripe.com/docs/webhooks
- React Documentation Team. (2024). React 18 — New Features and Concurrent Rendering. https://react.dev/
- Docker Inc. (2024). Docker and Docker Compose Documentation. https://docs.docker.com/
For any inquiries, permissions, or collaboration opportunities:
Built with ❤️ by ARONAGENT
🌟 Star this repo if you find it helpful! ⭐
"Code is like humor. When you have to explain it, it's bad." — Cory House






















