Skip to content

jjdubski/HotProperties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

176 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Real Estate MVC Demo

Java Spring%20Boot

Project logo

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.

Overview

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

Features

Buyer

  • 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

Agent

  • 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

Admin

  • View all users
  • Delete users
  • Create new agent accounts

Tech Stack

  • Java 21
  • Spring Boot 3.5
  • Spring MVC
  • Thymeleaf
  • Spring Security
  • JWT authentication
  • Spring Data JPA / Hibernate
  • MySQL
  • Maven

Seeded Demo Data

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 Email 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.

Local Setup

1. Prerequisites

Make sure you have installed:

  • Java 21
  • MySQL
  • Maven, or use the included Maven wrapper

2. Create the database

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;

3. Run the app

From the project root:

./mvnw spring-boot:run

Then open:

http://localhost:8080

Important Configuration Notes

  • 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.

Project Structure

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

Main Workflows

  • 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.

Testing

Run the test suite with:

./mvnw test

Screens and Templates

The 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

Notes

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.

About

A mock real-estate site to showcase different properties written in Java w/ Spring

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors