Skip to content

This Apartment Rental Application is a web-based platform that allows users to: View available apartments for rent, rent apartments, submit new apartments, manage user roles and more.

License

Notifications You must be signed in to change notification settings

AthosExarchou/ds-exc-2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Distributed Systems Group Project 2024-2025

This application was developed as a group project for the Distributed Systems course at Harokopio University of Athens - Dept. of Informatics and Telematics, later expanded with independent features and refinements.

Apartment Rental Management System

Contents

Overview

A Spring Boot-powered rental management platform where users can:

  • Browse available apartments
  • Rent apartments by providing tenant details
  • Submit new apartments by providing necessary details
  • Receive automated email notifications for important actions

Version 2.0 focuses on robust backend improvements, responsive UI redesign, and production-grade structure.

What's New in v2.0

  • Enhanced Security Setup: New LoginSuccessHandler, refined SecurityConfig, and admin auto-initialization via AdminInitializer.
  • Profile Management: Dedicated ProfileController and profile templates under /profile.
  • Full UI Revamp: Every Thymeleaf template redesigned for consistency, spacing, and responsiveness across devices.
  • Mobile Optimization: Responsive grid layouts and adaptive buttons for small screens.
  • New Email Templates: All notification emails modernized with consistent branding and improved readability.
  • Codebase Cleanup: Refactored controllers, services, and repositories for better logic flow and maintainability.
  • Global CSS & JS: New /static/css/style.css and /static/js/togglePassword.js for improved design and interactivity.
  • Contact & Legal Pages: Added dedicated sections under /contact/ and /legal/.

Core Features

  • Apartment Listings: Browse, filter, and view all approved apartments.
  • Dynamic Roles: Automatic role assignment for first-time owners or tenants.
  • Email Automation: Clean, HTML-based notification system for every major event.
  • Error Handling: Custom 403, 404, and 500 pages.
  • Responsive Design: Fully functional across desktop, tablet, and mobile.
  • Access Control: Role-based access ensures only authorized users can perform certain actions.

Email Notifications

The platform provides automatic email notifications to improve user engagement and administrative transparency. Emails are sent for the following actions:

  • New User Registration: A welcome message is sent upon account creation.
  • Account Deletion: A notice is sent when a user account is deleted by the admin.
  • User Info Update: A confirmation email is sent when personal user information is changed by the admin.
  • Apartment Creation: Owners receive a confirmation when they submit a new apartment.
  • Apartment Approval: Owners are notified once their submitted apartment is approved by the admin.
  • Apartment Deletion: Owners are notified when their apartment listing is successfully removed.
  • Rent Application Approval: Tenants receive an email when their rental application is approved by the owner.
  • Contact form submission: Platform email receives message from user.

All emails use reusable Thymeleaf templates under /templates/email/.

UI & UX Enhancements

  • Modern consistent color palette and typography
  • Dynamic hero section, gradient buttons, and hover effects
  • Clean layout fragments (header.html, footer.html, layout.html)
  • Smart button placement for both desktop and mobile
  • Subtle animations

Requirements

To run this application, ensure you have the following installed:

  • Java: Version 21+
  • Spring Boot: Version 3.x
  • Maven(optional): Version 3.8+
  • Thymeleaf: For front-end rendering
  • Database: any (for development)

Installation

  1. Clone the repository:
    git clone https://github.com/AthosExarchou/ds-exc-2024.git
  2. Open 'ds-exc-2024' in your preferred IDE
  3. Press 'Run' to boot the application

    Or, via terminal, you can run: mvn spring-boot:run

  4. Access the app in your browser at http://localhost:8080/

Configuration

Before running the application, ensure you configure src/main/resources/application.properties.

Required Properties:

  1. Application Name and Server Port
    spring.application.name=<Your Application Name>
    server.port=8080
  2. Database Connection
    spring.datasource.username=<DATABASE_USERNAME>
    spring.datasource.password=<DATABASE_PASSWORD>
    spring.datasource.url=jdbc:mysql://<HOST>:<PORT>/<DB_NAME>
  3. Gmail SMTP Settings (for Email Notifications)
    spring.mail.host=smtp.gmail.com
    spring.mail.port=587
    spring.mail.username[email protected]
    spring.mail.password=<YOUR_APP_PASSWORD>
    spring.mail.protocol=smtp
    spring.mail.properties.mail.smtp.auth=true
    spring.mail.properties.mail.smtp.starttls.enable=true

Usage Guide

For Tenants

  1. Log in with your credentials
  2. Visit the "Apartments For Rental" page to view available apartments
  3. Click on the "Application for Rental" button for the desired apartment
  4. If renting for the first time, fill in your details (First Name, Last Name, Phone Number)
  5. Submit the form to complete the rental process

For Owners

  1. Log in with your credentials
  2. Navigate to the "Apartments For Rental" page
  3. Click on the "Create new Apartment" button
  4. Fill in the details of the apartment you want to list
  5. Submit the form to make the apartment available for rent (will first have to be approved by the administrator)
  6. Manage your listings via My Apartments

For Admins

  1. Approve pending Apartments
  2. Manage users and roles
  3. Monitor rental activity

Access Restrictions

  • Only owners can delete apartments they have created
  • Tenants can only rent apartments that are available

Role Management

Role Description
USER Default upon registration
OWNER Assigned when a user creates their first apartment
TENANT Assigned when a user applies for rental
ADMIN Full management access; initialized via AdminInitializer

Project Structure

src/main/java/gr/hua/dit/ds/ds_exc_2024/
│
├── config/                   # Configuration classes (security, initialization, etc.)
├── controllers/              # REST & MVC controllers (handle HTTP requests)
├── dto/                      # DTOs for data transfer
├── entities/                 # JPA entities (User, Role, Apartment, etc.)
├── repositories/             # Spring Data JPA repositories
├── services/                 # Business logic layer
└── DsExc2024Application.java # Main Spring Boot entry point

src/main/resources/
│
├── static/                # Static resources (CSS, JS, images)
├── templates/             # Thymeleaf templates (UI pages)
│   ├── apartment/         # Views related to apartments
│   ├── auth/              # Authentication & user management pages
│   ├── contact/           # Contact form pages
│   ├── email/             # Email templates
│   ├── error/             # Custom error pages
│   ├── legal/             # ToS & privacy pages
│   ├── owner/             # Owner-related pages
│   ├── page_layout/       # Common layout fragments (header, footer, etc.)
│   ├── tenant/            # Tenant-related pages
│   └── index.html         # Homepage
└── application.properties # App configuration (DB, SMTP, etc.)

Contact

For support or inquiries:

Contributors

Student ID Name Contribution Context
it2022134 Exarchou Athos Core backend, full v2.0 overhaul, email & UI redesign
it22149 Alexandros-Georgios Zarkalis Initial DS coursework implementation

License

This project is licensed under the MIT License. You are free to use, modify, and distribute this project with attribution.

Version History

Version Date Summary
v1.0 February 2024 Initial release (Distributed Systems coursework)
v2.0 October 2025 Major overhaul: UI redesign, profile system, security enhancements, responsive design, code refactor

About

This Apartment Rental Application is a web-based platform that allows users to: View available apartments for rent, rent apartments, submit new apartments, manage user roles and more.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published