A full-stack Airbnb-style hotel booking application built with React on the frontend and Spring Boot on the backend. The app lets users browse hotels, search by date and location, book rooms, and manage their reservations — while admins have a dedicated dashboard to create and manage hotel listings and room inventory.
airbnb-fullstack/
├── airbnb-frontend/ # React 18 frontend
└── airBnbApp/ # Spring Boot 3 backend (Java 17)
| Technology | Version |
|---|---|
| React | 18.2 |
| React Router DOM | 6.x |
| Axios | 1.6 |
| React DatePicker | 4.x |
| React Hot Toast | 2.x |
| Lucide React (icons) | 0.303 |
| date-fns | 3.x |
| Technology | Version |
|---|---|
| Java | 17 |
| Spring Boot | 3.4 |
| Spring Security | 3.4 |
| Spring Data JPA | 3.4 |
| PostgreSQL | runtime |
| ModelMapper | 3.2.2 |
| Lombok | latest |
Authentication & Profiles — Secure signup and login flow powered by Spring Security with JWT token authentication. Tokens are stored on the client and sent with every protected request, keeping sessions stateless and scalable.
Hotel Search & Browse — Users can search hotels by location, check-in/check-out dates, and guest count. Search results pull live availability from the inventory system and surface the best matching options instantly.
Hotel Detail Pages — Each hotel listing shows room types, amenities, pricing, and real-time availability so users can make informed booking decisions before committing.
Room Booking with Date Selection — An interactive date picker lets users choose their stay duration. The booking engine checks inventory, calculates the total price, and creates the reservation in a single atomic operation.
My Bookings Dashboard — Users can view all their past and upcoming reservations in one place, with booking status tracked throughout the lifecycle (confirmed, cancelled, completed).
Hotel Management — Admins can create, update, and deactivate hotel listings through a dedicated admin dashboard, including setting contact information and amenities.
Room & Inventory Management — Admins control room types, base pricing, and availability windows. The system supports bulk inventory operations so room availability stays accurate across all booking dates.
Dynamic Pricing Engine — The backend implements a strategy pattern for pricing, supporting multiple pricing strategies including base pricing, occupancy-based surge, holiday pricing, and urgency pricing — all composable and swappable without changing business logic.
Global Exception Handling — A centralized GlobalExceptionHandler wraps all API responses in a consistent ApiResponse envelope, so the frontend always receives predictable JSON regardless of success or error state.
Spring Security + JWT — Every protected endpoint is secured via a TokenAuthFilter that validates JWTs on each request. Role-based access control separates guest, user, and admin permissions cleanly.
- Node.js 18+ and npm
- Java 17+
- Maven 3.8+
- PostgreSQL 14+
- Create a PostgreSQL database:
CREATE DATABASE airbnb_db;- Update
airBnbApp/src/main/resources/application.propertieswith your database credentials:
spring.datasource.url=jdbc:postgresql://localhost:5432/airbnb_db
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=update- Run the backend:
cd airBnbApp
./mvnw spring-boot:runThe backend starts on http://localhost:8080 with context path /api/v1.
cd airbnb-frontend
npm install
npm startThe frontend starts on http://localhost:3000 and proxies API calls to http://localhost:8080.
To configure the API URL, copy .env.example to .env:
cp .env.example .envFull interactive API documentation is auto-generated by Swagger UI and available once the backend is running:
Swagger UI: http://localhost:8080/api/v1/swagger-ui/index.html
You can explore all endpoints, view request/response schemas, and test calls directly from the browser — no external tool needed.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/auth/signup |
Register a new user |
| POST | /api/v1/auth/login |
Login and receive a JWT token |
| GET | /api/v1/hotels |
Browse all hotels |
| GET | /api/v1/hotels/search |
Search hotels by date and criteria |
| GET | /api/v1/hotels/{id} |
Get hotel details and room info |
| POST | /api/v1/bookings |
Create a booking |
| GET | /api/v1/bookings/my |
Get the current user's bookings |
| POST | /api/v1/admin/hotels |
(Admin) Create a hotel listing |
| POST | /api/v1/admin/hotels/{id}/rooms |
(Admin) Add a room to a hotel |
This project is for educational purposes.