A robust and secure REST API built with Spring Boot that facilitates listing, searching, and booking Appointments of real estate properties. With role-based access control and clear visibility rules, this system supports Buyers, Sellers, and Admins. The application includes support for secure bookings and appointment management.
- Browse and search available properties.
- Book appointments for AVAILABLE properties.
- View own bookings with real-time booking status.
- Add, update, or delete property listings.
- View and manage bookings on their own properties.
- Update booking status:
PENDING ➡️ CONFIRMED / CANCELLED.
- Manage all users, properties, and bookings.
- Oversee application-wide activity.
This application leverages Spring Security with HTTP Basic Authentication and role-based access for:
- Roles:
BUYER,SELLER,ADMIN - JdbcUserDetailsManager for user authentication.
- BCrypt for password hashing.
- CSRF disabled for REST API compatibility.
Access Rules:
- Buyers can book only
AVAILABLEproperties. - Booking of
SOLDproperties is restricted. - Duplicate or invalid bookings are prevented.
- Buyes/Sellers can only access or modify their own data.
- Bookings are visible only to the property owner and the booking buyer.
- Java 17+
- Spring Boot
- Spring Data JPA
- Spring Security (HTTP Basic Authentication)
- MySQL / H2
- Postman (API testing)
real-estate/
├── src/
│ ├── main/
│ │ ├── java/com/Hirav/real-estate/
│ │ │ ├── config/ # Spring Security Configurations
│ │ │ ├── controller/ # REST controllers for endpoints
│ │ │ ├── dao/ # Data Access Objects
│ │ │ ├── dto/ # Data Transfer Object
│ │ │ ├── entity/ # Entity classes and enums
│ │ │ ├── exception/ # Exception Handling (Error Message in Postman)
│ │ │ └── service/ # Service layer with Business logic
│ │ └── resources/ # application.properties, static files
│ ├── test/ # Unit and Integration Tests
├── pom.xml # Maven Build File
└── README.md