A mock real-estate web application built with Java, Spring Boot, Thymeleaf, Spring Security, JPA, and MySQL. The project simulates a small listing platform where buyers can browse homes, save favorites, and message agents, while agents manage listings and admins manage users.
This project was builtt to demonstrate a full-stack server-rendered Spring application with:
- role-based authentication and authorization
- property browsing and detail pages
- agent-managed property listings
- buyer favorites and messaging
- admin tools for managing users and creating agents
- seeded sample data for quick demos
- Register and log in
- Browse available properties
- View individual property details
- View saved favorites
- Send messages to listing agents
- Edit profile information and upload a profile picture
- Log in and access an agent dashboard
- Add, edit, and delete property listings
- Upload property images
- View buyer messages and send replies
- Manage profile information
- View all users
- Delete users
- Create new agent accounts
- Java 21
- Spring Boot 3.5
- Spring MVC
- Thymeleaf
- Spring Security
- JWT authentication
- Spring Data JPA / Hibernate
- MySQL
- Maven
On startup, the app seeds demo users, properties, messages, and favorites through the data initializer.
Included sample content:
- 10 sample property listings
- buyer, agent, and admin accounts
- sample buyer-to-agent messages
- preloaded favorites for buyer accounts
Example demo accounts:
| Role | Password | |
|---|---|---|
| Buyer | johnson@email.com |
bj.123 |
| Agent | jackson@email.com |
mj.123 |
| Admin | douglas@email.com |
jd.123 |
Additional seeded users are defined in DataInitializer if you want more demo logins.
Make sure you have installed:
- Java 21
- MySQL
- Maven, or use the included Maven wrapper
The current application properties expect a local MySQL database named real_estate_mvc and these credentials:
- username:
realestate - password:
realestate123
You can create them with:
CREATE SCHEMA real_estate_mvc;
CREATE USER 'realestate'@'localhost' IDENTIFIED BY 'realestate123';
GRANT ALL PRIVILEGES ON real_estate_mvc.* TO 'realestate'@'localhost';
FLUSH PRIVILEGES;From the project root:
./mvnw spring-boot:runThen open:
http://localhost:8080
- The app currently uses
spring.jpa.hibernate.ddl-auto=create-drop. - That means the schema is recreated on startup and dropped when the app shuts down.
- This is convenient for demos, but not appropriate for persistent local data.
- Authentication is backed by Spring Security with JWT support and role-based route protection.
- Uploaded images are served from the
uploads/directory at runtime.
src/main/java/com/example/demo
|- config/ Spring Security and web configuration
|- controllers/ MVC controller endpoints
|- dtos/ Request and response DTOs
|- entities/ JPA entities such as User, Property, Favorite, and Message
|- exceptions/ Custom exception types
|- initializers/ Seed data loader
|- jwt/ JWT utilities
|- repositories/ Spring Data repositories
|- services/ Business logic
|- utils/ Filters and support utilities
src/main/resources
|- templates/ Thymeleaf views
|- static/ CSS and image assets
|- application.properties
- Visitors land on the public home page and can register or log in.
- Buyers can browse listings, open property pages, save favorites, and contact listing agents.
- Agents can manage listings and respond to incoming buyer messages.
- Admins can manage users and create agent accounts.
Run the test suite with:
./mvnw testThe UI is implemented with Thymeleaf templates and custom CSS for pages such as:
- landing page
- dashboard
- property list and property detail views
- favorites
- messages
- profile management
- listing management
This is a mock showcase project intended to demonstrate a real-estate workflow rather than a production deployment. If you want to keep uploaded files and database records between runs, update the database and file-storage configuration before deployment.
