Index: src/main/java/com/example/domify/config/CustomUsernamePasswordAuthenticationProvider.java
===================================================================
--- src/main/java/com/example/domify/config/CustomUsernamePasswordAuthenticationProvider.java	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/java/com/example/domify/config/CustomUsernamePasswordAuthenticationProvider.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -1,113 +1,0 @@
-//package com.example.domify.config;
-//
-//import org.springframework.security.authentication.AuthenticationProvider;
-//import org.springframework.security.authentication.BadCredentialsException;
-//import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-//import org.springframework.security.core.Authentication;
-//import org.springframework.security.core.AuthenticationException;
-//import org.springframework.security.core.userdetails.UserDetails;
-//import org.springframework.security.crypto.password.PasswordEncoder;
-//import org.springframework.stereotype.Component;
-//
-//import org.springframework.context.annotation.Bean;
-//import org.springframework.context.annotation.Configuration;
-//import org.springframework.security.authentication.AuthenticationManager;
-//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
-//import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
-//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-//import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
-//import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer;
-//import org.springframework.security.core.userdetails.User;
-//import org.springframework.security.core.userdetails.UserDetails;
-//import org.springframework.security.core.userdetails.UserDetailsService;
-//import org.springframework.security.crypto.password.PasswordEncoder;
-//import org.springframework.security.provisioning.InMemoryUserDetailsManager;
-//import org.springframework.security.web.SecurityFilterChain;
-//
-//
-//@Configuration
-//@EnableWebSecurity
-//@EnableMethodSecurity
-//public class WebSecurityConfig {
-//
-//    private final PasswordEncoder passwordEncoder;
-//    private final CustomUsernamePasswordAuthenticationProvider authProvider;
-//
-//    public WebSecurityConfig(PasswordEncoder passwordEncoder, CustomUsernamePasswordAuthenticationProvider authProvider) {
-//        this.passwordEncoder = passwordEncoder;
-//        this.authProvider = authProvider;
-//    }
-//
-//    @Bean
-//    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
-//
-//        http
-//                .csrf(AbstractHttpConfigurer::disable)
-//                .headers((headers) -> headers
-//                        .frameOptions(HeadersConfigurer.FrameOptionsConfig::sameOrigin)
-//                )
-//                .authorizeHttpRequests((requests) -> requests
-//                        .requestMatchers("/", "/home", "/assets/**", "/register")
-//                        .permitAll()
-//                        .requestMatchers("/admin/**").hasRole("ADMIN")
-//                        .anyRequest()
-//                        .authenticated()
-//                )
-//                .formLogin((form) -> form
-//                        .loginPage("/login")
-//                        .permitAll()
-//                        .failureUrl("/login?error=BadCredentials")
-//                        .defaultSuccessUrl("/products", true)
-//                )
-//                .logout((logout) -> logout
-//                        .logoutUrl("/logout")
-//                        .clearAuthentication(true)
-//                        .invalidateHttpSession(true)
-//                        .deleteCookies("JSESSIONID")
-//                        .logoutSuccessUrl("/login")
-//                )
-//                .exceptionHandling((ex) -> ex
-//                        .accessDeniedPage("/access_denied")
-//                );
-//
-//        return http.build();
-//    }
-//
-//    // In Memory Authentication
-//    //    @Bean
-//    public UserDetailsService userDetailsService() {
-//        UserDetails user1 = User.builder()
-//                .username("elena.atanasoska")
-//                .password(passwordEncoder.encode("ea"))
-//                .roles("USER")
-//                .build();
-//        UserDetails user2 = User.builder()
-//                .username("darko.sasanski")
-//                .password(passwordEncoder.encode("ds"))
-//                .roles("USER")
-//                .build();
-//        UserDetails user3 = User.builder()
-//                .username("ana.todorovska")
-//                .password(passwordEncoder.encode("at"))
-//                .roles("USER")
-//                .build();
-//        UserDetails admin = User.builder()
-//                .username("admin")
-//                .password(passwordEncoder.encode("admin"))
-//                .roles("ADMIN")
-//                .build();
-//
-//        return new InMemoryUserDetailsManager(user1, user2, user3, admin);
-//    }
-//
-//    @Bean
-//    public AuthenticationManager authManager(HttpSecurity http) throws Exception {
-//        AuthenticationManagerBuilder authenticationManagerBuilder =
-//                http.getSharedObject(AuthenticationManagerBuilder.class);
-//        authenticationManagerBuilder.authenticationProvider(authProvider);
-//        return authenticationManagerBuilder.build();
-//    }
-//}
-//
-//
Index: src/main/java/com/example/domify/config/WebSecurityConfig.java
===================================================================
--- src/main/java/com/example/domify/config/WebSecurityConfig.java	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/java/com/example/domify/config/WebSecurityConfig.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -1,4 +1,0 @@
-//package com.example.domify.config;
-//
-//public class WebSecurityConfig {
-//}
Index: src/main/java/com/example/domify/service/impl/LeaseServiceImpl.java
===================================================================
--- src/main/java/com/example/domify/service/impl/LeaseServiceImpl.java	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/java/com/example/domify/service/impl/LeaseServiceImpl.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -43,10 +43,10 @@
 
     @Transactional
-    public void rateUser(Long leaseId, Long raterId, Integer rating, boolean isRatingTenant) {
+    public void rateUser(Long leaseId, Long raterProfileId, Integer rating, boolean isRatingTenant) {
         Lease lease = leaseRepository.findById(leaseId)
                 .orElseThrow(() -> new IllegalArgumentException("Lease not found"));
 
-        boolean isRaterLandlord = lease.getLandlord().getId().equals(raterId);
-        boolean isRaterTenant = lease.getTenant().getId().equals(raterId);
+        boolean isRaterLandlord = lease.getLandlord().getId().equals(raterProfileId);
+        boolean isRaterTenant = lease.getTenant().getId().equals(raterProfileId);
 
         if (!isRaterLandlord && !isRaterTenant) {
@@ -63,4 +63,5 @@
 
         UserD userToRate = isRatingTenant ? lease.getTenant().getUser() : lease.getLandlord().getUser();
+
         userService.updateUserRating(userToRate.getId(), BigDecimal.valueOf(rating));
     }
Index: src/main/java/com/example/domify/web/GlobalControllerAdvice.java
===================================================================
--- src/main/java/com/example/domify/web/GlobalControllerAdvice.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
+++ src/main/java/com/example/domify/web/GlobalControllerAdvice.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -0,0 +1,31 @@
+package com.example.domify.web;
+
+import com.example.domify.model.UserD;
+import com.example.domify.service.UserService;
+import jakarta.servlet.http.HttpServletRequest;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.ui.Model;
+
+@ControllerAdvice
+public class GlobalControllerAdvice {
+
+    private final UserService userService;
+
+    public GlobalControllerAdvice(UserService userService) {
+        this.userService = userService;
+    }
+
+    @ModelAttribute
+    public void addCommonAttributes(HttpServletRequest request, Model model) {
+        UserD user = (UserD) request.getSession().getAttribute("user");
+        model.addAttribute("user", user);
+
+        if (user != null) {
+            boolean isLandlord = userService.isLandlord(user.getId());
+            model.addAttribute("isLandlord", isLandlord);
+        } else {
+            model.addAttribute("isLandlord", false);
+        }
+    }
+}
Index: src/main/java/com/example/domify/web/LeaseController.java
===================================================================
--- src/main/java/com/example/domify/web/LeaseController.java	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/java/com/example/domify/web/LeaseController.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -11,4 +11,5 @@
 import java.time.LocalDate;
 import java.util.List;
+import java.util.Map;
 
 @Controller
@@ -36,11 +37,6 @@
     public String showCreateForm(@RequestParam Long listingId,
                                  @RequestParam Long tenantId,
-                                 Model model,
-                                 HttpServletRequest request) {
-        UserD user = (UserD) request.getSession().getAttribute("user");
-        if (user == null || !userService.isLandlord(user.getId())) {
-            return "redirect:/login";
-        }
-
+                                 Model model
+                                 ) {
         model.addAttribute("listingId", listingId);
         model.addAttribute("tenantId", tenantId);
@@ -85,5 +81,5 @@
             listingService.save(listing);
 
-            return "redirect:/properties/" + listing.getUnit().getProperty().getId();
+            return "redirect:/lease";
 
         } catch (Exception e) {
@@ -95,8 +91,4 @@
     public String getUserLeases(Model model, HttpServletRequest request) {
         UserD user = (UserD) request.getSession().getAttribute("user");
-        if (user == null) {
-            return "redirect:/login";
-        }
-
         List<Lease> leases;
         if (userService.isLandlord(user.getId())) {
@@ -106,4 +98,5 @@
         }
 
+        model.addAttribute("isLandlord",userService.isLandlord(user.getId()));
         model.addAttribute("user", user);
         model.addAttribute("leases", leases);
@@ -113,16 +106,9 @@
     @GetMapping("/{id}/details")
     public String getLeaseDetails(@PathVariable Long id,
-                                  Model model,
-                                  HttpServletRequest request) {
-        UserD user = (UserD) request.getSession().getAttribute("user");
-        if (user == null) {
-            return "redirect:/login";
-        }
-
+                                  Model model
+                                  ) {
         Lease lease = leaseService.findById(id);
-
         model.addAttribute("lease", lease);
-        model.addAttribute("user", user);
-        return "lease-details";
+        return "lease";
     }
 
@@ -146,10 +132,10 @@
     }
 
-    @PostMapping("/{id}/rate-tenant")
+    @PostMapping("/api/leases/{id}/rate")
     @ResponseBody
-    public String rateTenant(@PathVariable Long id,
-                             @RequestParam Integer rating,
-                             HttpServletRequest request) {
-        UserD user = (UserD) request.getSession().getAttribute("user");
+    public String rateUser(@PathVariable Long id,
+                           @RequestBody Map<String, Object> request,
+                           HttpServletRequest httpRequest) {
+        UserD user = (UserD) httpRequest.getSession().getAttribute("user");
         if (user == null) {
             return "{\"status\":\"error\",\"message\":\"Not authenticated\"}";
@@ -157,7 +143,25 @@
 
         try {
-            // Landlord rates tenant
-            leaseService.rateUser(id, user.getId(), rating, true);
-            return "{\"status\":\"success\",\"message\":\"Tenant rating saved\"}";
+            Integer rating = (Integer) request.get("rating");
+            if (rating == null || rating < 1 || rating > 5) {
+                return "{\"status\":\"error\",\"message\":\"Invalid rating\"}";
+            }
+
+            Lease lease = leaseService.findById(id);
+
+            boolean isLandlord = lease.getLandlord().getUser().getId().equals(user.getId());
+            boolean isTenant = lease.getTenant().getUser().getId().equals(user.getId());
+
+            if (!isLandlord && !isTenant) {
+                return "{\"status\":\"error\",\"message\":\"User not part of this lease\"}";
+            }
+
+            if (isLandlord) {
+                leaseService.rateUser(id, lease.getLandlord().getId(), rating, true);
+            } else {
+                leaseService.rateUser(id, lease.getTenant().getId(), rating, false);
+            }
+
+            return "{\"status\":\"success\",\"message\":\"Rating saved successfully\"}";
         } catch (Exception e) {
             return "{\"status\":\"error\",\"message\":\"" + e.getMessage() + "\"}";
Index: src/main/java/com/example/domify/web/ListingController.java
===================================================================
--- src/main/java/com/example/domify/web/ListingController.java	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/java/com/example/domify/web/ListingController.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -14,5 +14,4 @@
 @RequestMapping(value = {"/", "/listings"})
 public class ListingController {
-    private final AddressService addressService;
     private final ListingService listingService;
     private final UserService userService;
@@ -21,6 +20,5 @@
     private final TenantProfileService tenantProfileService;
 
-    public ListingController(AddressService addressService, ListingService listingService, UserService userService, UnitService unitService, InterestedService interestedService, TenantProfileService tenantProfileService) {
-        this.addressService = addressService;
+    public ListingController(ListingService listingService, UserService userService, UnitService unitService, InterestedService interestedService, TenantProfileService tenantProfileService) {
         this.listingService = listingService;
         this.userService = userService;
@@ -32,14 +30,4 @@
     @GetMapping
     public String getListings(HttpServletRequest request,Model model) {
-        UserD user = (UserD) request.getSession().getAttribute("user");
-        if (user != null)
-        {
-            model.addAttribute("user",user);
-            model.addAttribute("isLandlord",userService.isLandlord(user.getId()));
-        }else {
-            model.addAttribute("user", null);
-            model.addAttribute("isLandlord", false);
-        }
-
         model.addAttribute("listings",listingService.findAll());
         return "index";
@@ -47,5 +35,5 @@
 
     @GetMapping("/create")
-    public String showCreateForm(@RequestParam Long unitId, Model model) {
+    public String showCreateForm(@RequestParam Long unitId, Model model, HttpServletRequest request) {
         model.addAttribute("unitId", unitId);
         return "create-listing";
@@ -81,5 +69,5 @@
             listingService.save(listing);
 
-            return "redirect:/properties/" + unit.getProperty().getId();
+            return "redirect:/listings";
 
         } catch (Exception e) {
@@ -93,4 +81,6 @@
                                     HttpServletRequest request) {
         UserD user = (UserD) request.getSession().getAttribute("user");
+        if (user == null)
+            return "redirect:/login";
         boolean isLandlord = userService.isLandlord(user.getId());
         Listing listing = listingService.findById(id);
@@ -101,5 +91,5 @@
 
     @GetMapping("/{id}/applications")
-    public String getInterestedTenants(@PathVariable Long id, Model model) {
+    public String getInterestedTenants(@PathVariable Long id, Model model, HttpServletRequest request) {
         Listing listing = listingService.findById(id);
 
Index: src/main/java/com/example/domify/web/LoginController.java
===================================================================
--- src/main/java/com/example/domify/web/LoginController.java	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/java/com/example/domify/web/LoginController.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -45,4 +45,3 @@
     }
 
-
 }
Index: src/main/java/com/example/domify/web/LogoutController.java
===================================================================
--- src/main/java/com/example/domify/web/LogoutController.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
+++ src/main/java/com/example/domify/web/LogoutController.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -0,0 +1,18 @@
+package com.example.domify.web;
+
+
+import jakarta.servlet.http.HttpServletRequest;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+@RequestMapping("/logout")
+public class LogoutController {
+    @GetMapping
+    public String logoutPage(HttpServletRequest request) {
+        request.getSession().invalidate();
+        return "redirect:/login?logout";
+    }
+
+}
Index: src/main/java/com/example/domify/web/PropertiesController.java
===================================================================
--- src/main/java/com/example/domify/web/PropertiesController.java	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/java/com/example/domify/web/PropertiesController.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -18,26 +18,14 @@
 @RequestMapping("/properties")
 public class PropertiesController {
-    private static final Logger logger = LoggerFactory.getLogger(PropertiesController.class);
-
     private final PropertiesService propertiesService;
-    private final UserService userService;
     private final PropertyTypeRepository propertyRepository;
 
-    public PropertiesController(PropertiesService propertiesService, UserService userService, PropertyTypeRepository propertyRepository) {
+    public PropertiesController(PropertiesService propertiesService, PropertyTypeRepository propertyRepository) {
         this.propertiesService = propertiesService;
-        this.userService = userService;
         this.propertyRepository = propertyRepository;
     }
 
     @GetMapping("/{userId}")
-    public String getProperties(HttpServletRequest request, @PathVariable Long userId, Model model) {
-        UserD user = (UserD) request.getSession().getAttribute("user");
-        if (user != null) {
-            model.addAttribute("user", user);
-            model.addAttribute("isLandlord", userService.isLandlord(user.getId()));
-        } else {
-            model.addAttribute("user", null);
-            model.addAttribute("isLandlord", false);
-        }
+    public String getProperties(@PathVariable Long userId, Model model) {
         model.addAttribute("properties", propertiesService.findByOwnerId(userId));
         return "properties";
@@ -45,13 +33,5 @@
 
     @GetMapping("/{propertyId}/details")
-    public String getPropertiesDetails(HttpServletRequest request, @PathVariable Long propertyId, Model model) {
-        UserD user = (UserD) request.getSession().getAttribute("user");
-        if (user != null) {
-            model.addAttribute("user", user);
-            model.addAttribute("isLandlord", userService.isLandlord(user.getId()));
-        } else {
-            model.addAttribute("user", null);
-            model.addAttribute("isLandlord", false);
-        }
+    public String getPropertiesDetails(@PathVariable Long propertyId, Model model) {
         model.addAttribute("property", propertiesService.findDetails(propertyId).get());
         return "property";
@@ -59,13 +39,5 @@
 
     @GetMapping("/add")
-    public String getAddPage(HttpServletRequest request, Model model) {
-        UserD user = (UserD) request.getSession().getAttribute("user");
-        if (user != null) {
-            model.addAttribute("user", user);
-            model.addAttribute("isLandlord", userService.isLandlord(user.getId()));
-        } else {
-            model.addAttribute("user", null);
-            model.addAttribute("isLandlord", false);
-        }
+    public String getAddPage( Model model) {
         model.addAttribute("propertyTypes", propertyRepository.findAll());
         return "create-property";
Index: src/main/java/com/example/domify/web/UnitController.java
===================================================================
--- src/main/java/com/example/domify/web/UnitController.java	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/java/com/example/domify/web/UnitController.java	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -19,10 +19,8 @@
 @RequestMapping("/units")
 public class UnitController {
-    private final UserService userService;
     private final UnitService unitService;
     private final PropertiesService propertiesService;
 
-    public UnitController(UserService userService, UnitService unitService, PropertiesService propertiesService) {
-        this.userService = userService;
+    public UnitController( UnitService unitService, PropertiesService propertiesService) {
         this.unitService = unitService;
         this.propertiesService = propertiesService;
@@ -30,13 +28,5 @@
 
     @GetMapping("/{unitId}/details")
-    public String getUnitDetails(HttpServletRequest request, @PathVariable Long unitId, Model model) {
-        UserD user = (UserD) request.getSession().getAttribute("user");
-        if (user != null) {
-            model.addAttribute("user", user);
-            model.addAttribute("isLandlord", userService.isLandlord(user.getId()));
-        } else {
-            model.addAttribute("user", null);
-            model.addAttribute("isLandlord", false);
-        }
+    public String getUnitDetails(@PathVariable Long unitId, Model model) {
         model.addAttribute("unit", unitService.findDetails(unitId).get());
         return "unit";
Index: src/main/resources/application.properties
===================================================================
--- src/main/resources/application.properties	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/application.properties	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -4,5 +4,5 @@
 spring.datasource.url=jdbc:postgresql://localhost:5432/domify
 spring.datasource.username=postgres
-spring.datasource.password=miloscar15
+spring.datasource.password=stefanmilos
 spring.datasource.driver-class-name=org.postgresql.Driver
 
Index: src/main/resources/templates/create-lease.html
===================================================================
--- src/main/resources/templates/create-lease.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/create-lease.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -26,33 +26,5 @@
 </head>
 <body>
-<header class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
-  <div class="container-fluid">
-    <div class="row align-items-center">
-      <div class="col-md-6 d-flex align-items-center">
-        <img src="/logo.png" class="ms-5 rounded-pill" style="width: 50px; height: 50px; object-fit: cover;">
-        <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
-        <button class="btn btn-outline-light">Мои изнајмувања</button>
-      </div>
-      <div class="col-md-6 d-flex justify-content-end align-items-center">
-        <div class="dropdown d-inline-block me-5">
-          <button class="btn btn-outline-light dropdown-toggle" type="button" id="userDropdown"
-                  data-bs-toggle="dropdown" aria-expanded="false">
-            <i class="bi bi-person-circle me-2"></i>Стефан Николов
-          </button>
-          <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown">
-            <li><a class="dropdown-item" href="#">Профил</a></li>
-            <li><a class="dropdown-item" href="#">Мои изнајмувања</a></li>
-            <li><a class="dropdown-item" href="#">Направи оглас</a></li>
-            <li><a class="dropdown-item" href="#">Мои имоти</a></li>
-            <li>
-              <hr class="dropdown-divider">
-            </li>
-            <li><a class="dropdown-item" href="#">Одјави се</a></li>
-          </ul>
-        </div>
-      </div>
-    </div>
-  </div>
-</header>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
 
 <div class="container my-5">
Index: src/main/resources/templates/create-listing.html
===================================================================
--- src/main/resources/templates/create-listing.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/create-listing.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -33,33 +33,6 @@
 </head>
 <body>
-<header class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
-  <div class="container-fluid">
-    <div class="row align-items-center">
-      <div class="col-md-6 d-flex align-items-center">
-        <img src="/logo.png" class="ms-5 rounded-pill" style="width: 50px; height: 50px; object-fit: cover;">
-        <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
-        <button class="btn btn-outline-light">Мои изнајмувања</button>
-      </div>
-      <div class="col-md-6 d-flex justify-content-end align-items-center">
-        <div class="dropdown d-inline-block me-5">
-          <button class="btn btn-outline-light dropdown-toggle" type="button" id="userDropdown"
-                  data-bs-toggle="dropdown" aria-expanded="false">
-            <i class="bi bi-person-circle me-2"></i>Стефан Николов
-          </button>
-          <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown">
-            <li><a class="dropdown-item" href="#">Профил</a></li>
-            <li><a class="dropdown-item" href="#">Мои изнајмувања</a></li>
-            <li><a class="dropdown-item" href="#">Направи оглас</a></li>
-            <li><a class="dropdown-item" href="#">Мои имоти</a></li>
-            <li>
-              <hr class="dropdown-divider">
-            </li>
-            <li><a class="dropdown-item" href="#">Одјави се</a></li>
-          </ul>
-        </div>
-      </div>
-    </div>
-  </div>
-</header>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
+
 
 <div class="container my-5">
Index: src/main/resources/templates/create-property.html
===================================================================
--- src/main/resources/templates/create-property.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/create-property.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -33,49 +33,5 @@
 </head>
 <body>
-<header class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
-    <div class="container-fluid">
-        <div class="row align-items-center">
-            <div class="col-md-6 d-flex align-items-center">
-                <img src="/images/logo.png" class="ms-5 rounded-pill" style="width: 50px; height: 50px; object-fit: cover;">
-                <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
-                <a href="/my-rentals" class="btn btn-outline-light" th:if="${user != null} and ${isLandlord}" >Мои огласи</a>
-                <a href="/my-rentals" class="btn btn-outline-light" th:if="${user != null} and ${!isLandlord}" >Мои изнајмувања</a>
-            </div>
-            <div class="col-md-6 d-flex justify-content-end align-items-center">
-                <div class="dropdown d-inline-block me-5">
-                    <button class="btn btn-outline-light dropdown-toggle" type="button" id="userDropdown"
-                            data-bs-toggle="dropdown" aria-expanded="false">
-                        <i class="bi bi-person-circle me-2"></i>
-
-                        <span th:if="${user != null}" th:text="${user.getFirstName() + ' ' + user.getLastName()}">Корисник</span>
-                        <span th:if="${user == null}">Најави се</span>
-                    </button>
-
-                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-                        th:if="${user != null} and ${isLandlord}">
-                        <li><a class="dropdown-item" href="#">Профил</a></li>
-                        <li><a class="dropdown-item" href="#">Мои изнајмувања</a></li>
-                        <li><a class="dropdown-item" href="#">Направи оглас</a></li>
-                        <li><a class="dropdown-item" th:href="@{'/properties/' + ${user.getId()}}">Мои имоти</a></li>
-                        <li><hr class="dropdown-divider"></li>
-                        <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
-                    </ul>
-
-                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-                        th:if="${user != null} and !${isLandlord}">
-                        <li><a class="dropdown-item" href="#">Профил</a></li>
-                        <li><hr class="dropdown-divider"></li>
-                        <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
-                    </ul>
-
-                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-                        th:if="${user == null}">
-                        <li><a class="dropdown-item" href="/login">Најави се</a></li>
-                    </ul>
-                </div>
-            </div>
-        </div>
-    </div>
-</header>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
 
 <div class="container my-5">
Index: src/main/resources/templates/create-unit.html
===================================================================
--- src/main/resources/templates/create-unit.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/create-unit.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -33,33 +33,6 @@
 </head>
 <body>
-<header class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
-  <div class="container-fluid">
-    <div class="row align-items-center">
-      <div class="col-md-6 d-flex align-items-center">
-        <img src="/logo.png" class="ms-5 rounded-pill" style="width: 50px; height: 50px; object-fit: cover;">
-        <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
-        <button class="btn btn-outline-light">Мои изнајмувања</button>
-      </div>
-      <div class="col-md-6 d-flex justify-content-end align-items-center">
-        <div class="dropdown d-inline-block me-5">
-          <button class="btn btn-outline-light dropdown-toggle" type="button" id="userDropdown"
-                  data-bs-toggle="dropdown" aria-expanded="false">
-            <i class="bi bi-person-circle me-2"></i>Стефан Николов
-          </button>
-          <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown">
-            <li><a class="dropdown-item" href="#">Профил</a></li>
-            <li><a class="dropdown-item" href="#">Мои изнајмувања</a></li>
-            <li><a class="dropdown-item" href="#">Направи оглас</a></li>
-            <li><a class="dropdown-item" href="#">Мои имоти</a></li>
-            <li>
-              <hr class="dropdown-divider">
-            </li>
-            <li><a class="dropdown-item" href="#">Одјави се</a></li>
-          </ul>
-        </div>
-      </div>
-    </div>
-  </div>
-</header>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
+
 
 <div class="container my-5">
Index: src/main/resources/templates/fragments/header.html
===================================================================
--- src/main/resources/templates/fragments/header.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
+++ src/main/resources/templates/fragments/header.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -0,0 +1,45 @@
+<div th:fragment="appHeader(user, isLandlord)" class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
+    <div class="container-fluid">
+        <div class="row align-items-center">
+            <div class="col-md-6 d-flex align-items-center">
+                <a th:href="@{/}">
+                    <img th:src="@{/images/logo.png}" class="ms-5 rounded-pill" style="width: 50px; height: 50px; object-fit: cover;">
+                </a>
+                <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
+                <a href="/lease" th:if="${user != null}" class="btn btn-outline-light">Мои изнајмувања</a>
+            </div>
+            <div class="col-md-6 d-flex justify-content-end align-items-center">
+                <div class="dropdown d-inline-block me-5">
+                    <button class="btn btn-outline-light dropdown-toggle" type="button" id="userDropdown"
+                            data-bs-toggle="dropdown" aria-expanded="false">
+                        <i class="bi bi-person-circle me-2"></i>
+                        <span th:if="${user != null}" th:text="${user.firstName + ' ' + user.lastName}">Корисник</span>
+                        <span th:if="${user == null}">Најави се</span>
+                    </button>
+
+                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
+                        th:if="${user != null} and ${isLandlord}">
+                        <li><a class="dropdown-item" href="#">Профил</a></li>
+                        <li><a class="dropdown-item" href="#">Мои изнајмувања</a></li>
+                        <li><a class="dropdown-item" href="#">Направи оглас</a></li>
+                        <li><a class="dropdown-item" th:href="@{'/properties/' + ${user.id}}">Мои имоти</a></li>
+                        <li><hr class="dropdown-divider"></li>
+                        <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
+                    </ul>
+
+                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
+                        th:if="${user != null} and !${isLandlord}">
+                        <li><a class="dropdown-item" href="#">Профил</a></li>
+                        <li><hr class="dropdown-divider"></li>
+                        <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
+                    </ul>
+
+                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
+                        th:if="${user == null}">
+                        <li><a class="dropdown-item" href="/login">Најави се</a></li>
+                    </ul>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
Index: src/main/resources/templates/index.html
===================================================================
--- src/main/resources/templates/index.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/index.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -22,50 +22,5 @@
 </head>
 <body>
-
-<header class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
-  <div class="container-fluid">
-    <div class="row align-items-center">
-      <div class="col-md-6 d-flex align-items-center">
-        <img src="/images/logo.png" class="ms-5 rounded-pill" style="width: 50px; height: 50px; object-fit: cover;">
-        <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
-        <a href="/my-rentals" class="btn btn-outline-light" th:if="${user != null} and ${isLandlord}" >Мои огласи</a>
-        <a href="/my-rentals" class="btn btn-outline-light" th:if="${user != null} and ${!isLandlord}" >Мои изнајмувања</a>
-      </div>
-      <div class="col-md-6 d-flex justify-content-end align-items-center">
-        <div class="dropdown d-inline-block me-5">
-          <button class="btn btn-outline-light dropdown-toggle" type="button" id="userDropdown"
-                  data-bs-toggle="dropdown" aria-expanded="false">
-            <i class="bi bi-person-circle me-2"></i>
-
-            <span th:if="${user != null}" th:text="${user.getFirstName() + ' ' + user.getLastName()}">Корисник</span>
-            <span th:if="${user == null}">Најави се</span>
-          </button>
-
-          <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-              th:if="${user != null} and ${isLandlord}">
-            <li><a class="dropdown-item" href="#">Профил</a></li>
-            <li><a class="dropdown-item" href="#">Мои изнајмувања</a></li>
-            <li><a class="dropdown-item" href="#">Направи оглас</a></li>
-            <li><a class="dropdown-item" th:href="@{'/properties/' + ${user.getId()}}">Мои имоти</a></li>
-            <li><hr class="dropdown-divider"></li>
-            <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
-          </ul>
-
-          <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-              th:if="${user != null} and !${isLandlord}">
-            <li><a class="dropdown-item" href="#">Профил</a></li>
-            <li><hr class="dropdown-divider"></li>
-            <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
-          </ul>
-
-          <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-              th:if="${user == null}">
-            <li><a class="dropdown-item" href="/login">Најави се</a></li>
-          </ul>
-        </div>
-      </div>
-    </div>
-  </div>
-</header>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
 
 <div class="container mt-4">
@@ -81,5 +36,4 @@
             </button>
             <ul class="dropdown-menu w-100" aria-labelledby="addressDropdown" id="addressMenu">
-              <!-- Example cities/municipalities -->
               <li class="dropdown-submenu">
                 <span class="dropdown-item-text fw-semibold">Скопје</span>
Index: src/main/resources/templates/interested.html
===================================================================
--- src/main/resources/templates/interested.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/interested.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -21,35 +21,6 @@
 </head>
 <body>
-<header class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
-    <div class="container-fluid">
-        <div class="row align-items-center">
-            <div class="col-md-6 d-flex align-items-center">
-                <img src="/images/logo.png" class="ms-5 rounded-pill"
-                     style="width: 50px; height: 50px; object-fit: cover;">
-                <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
-                <button class="btn btn-outline-light">Мои изнајмувања</button>
-            </div>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
 
-            <div class="col-md-6 d-flex justify-content-end align-items-center">
-                <div class="dropdown d-inline-block me-5">
-                    <button class="btn btn-outline-light dropdown-toggle" type="button" id="userDropdown"
-                            data-bs-toggle="dropdown" aria-expanded="false">
-                        <i class="bi bi-person-circle me-2"></i>Стефан Николов
-                    </button>
-                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown">
-                        <li><a class="dropdown-item" href="#">Профил</a></li>
-                        <li><a class="dropdown-item" href="#">Мои изнајмувања</a></li>
-                        <li><a class="dropdown-item" href="#">Направи оглас</a></li>
-                        <li><a class="dropdown-item" href="#">Мои имоти</a></li>
-                        <li>
-                            <hr class="dropdown-divider">
-                        </li>
-                        <li><a class="dropdown-item" href="#">Одјави се</a></li>
-                    </ul>
-                </div>
-            </div>
-        </div>
-    </div>
-</header>
 
 <div class="container-fluid">
Index: src/main/resources/templates/lease.html
===================================================================
--- src/main/resources/templates/lease.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
+++ src/main/resources/templates/lease.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -0,0 +1,204 @@
+<!DOCTYPE html>
+<html lang="mk" xmlns:th="http://www.thymeleaf.org">
+<head>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>Domify - Детали за изнајмување</title>
+  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
+  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet"
+        integrity="sha384-LN+7fdVzj6u52u30Kp6M/trliBMCMKTyK833zpbD+pXdCLuTusPj697FH4R/5mcr" crossorigin="anonymous">
+  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
+
+  <style>
+    body {
+      font-family: 'Inter', sans-serif;
+      background: linear-gradient(135deg, #f5fafd 0%, #e3f0ff 100%);
+    }
+
+    .header-gradient {
+      background: linear-gradient(90deg, #1976d2 0%, #64b5f6 100%);
+    }
+
+    .info-section {
+      background: rgba(255, 255, 255, 0.7);
+      backdrop-filter: blur(10px);
+      border: 1px solid rgba(255, 255, 255, 0.2);
+    }
+
+    .property-image {
+      border-radius: 12px;
+      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
+      transition: transform 0.3s ease;
+    }
+
+    .property-image:hover {
+      transform: scale(1.02);
+    }
+
+    .action-btn {
+      transition: all 0.3s ease;
+      border: none;
+      font-weight: 500;
+    }
+
+    .action-btn:hover {
+      transform: translateY(-2px);
+      box-shadow: 0 6px 20px rgba(25, 118, 210, 0.3);
+    }
+  </style>
+</head>
+<body>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
+
+
+<div class="mt-4 info-section rounded-4 shadow-sm p-4 m-auto mb-4" style="width: 85%;">
+  <a th:href="@{/lease}" class="btn btn-outline-primary mb-4">
+    <i class="bi bi-arrow-left me-2"></i> Назад
+  </a>
+
+  <div class="d-flex justify-content-between align-items-start gap-4">
+    <div class="m-auto">
+      <h2 class="text-primary mb-4 fw-bold" th:text="${lease.listing.title}">Удобен еднособен стан</h2>
+
+      <!-- Lease Period Section -->
+      <div class="border-top border-bottom py-3">
+        <div class="d-flex justify-content-between py-2">
+          <span class="text-primary fw-medium">Почеток на изнајмување:</span>
+          <span class="text-dark" th:text="${#temporals.format(lease.startDate, 'dd.MM.yyyy')}">01.01.2025</span>
+        </div>
+
+        <div class="d-flex justify-content-between py-2">
+          <span class="text-primary fw-medium">Крај на изнајмување:</span>
+          <span class="text-dark" th:text="${#temporals.format(lease.endDate, 'dd.MM.yyyy')}">31.12.2025</span>
+        </div>
+
+        <div class="d-flex justify-content-between py-2">
+          <span class="text-primary fw-medium">Статус:</span>
+          <span class="badge bg-success" th:if="${lease.listing.status == 'изнајмено'}">Активно</span>
+          <span class="badge bg-secondary" th:unless="${lease.listing.status == 'изнајмено'}" th:text="${lease.listing.status}">Неактивно</span>
+        </div>
+      </div>
+
+      <!-- Financial Information -->
+      <div class="pt-3">
+        <div class="d-flex justify-content-between py-2">
+          <span class="text-primary fw-medium">Износ на изнајмување:</span>
+          <span class="text-dark fw-bold">
+            <span th:text="${#numbers.formatDecimal(lease.rentAmount, 0, 'COMMA', 2, 'POINT')}">16.800</span>
+            <small>ден.</small>
+          </span>
+        </div>
+
+        <div class="d-flex justify-content-between py-2">
+          <span class="text-primary fw-medium">Депозит:</span>
+          <span class="text-dark fw-bold">
+            <span th:text="${#numbers.formatDecimal(lease.depositAmount, 0, 'COMMA', 2, 'POINT')}">33.600</span>
+            <small>ден.</small>
+          </span>
+        </div>
+      </div>
+
+      <!-- Parties Information -->
+      <div class="border-top pt-3 mt-3">
+        <div class="d-flex justify-content-between py-2">
+          <span class="text-primary fw-medium">Станар:</span>
+          <span class="text-dark">
+            <span th:text="${lease.tenant.user.firstName + ' ' + lease.tenant.user.lastName}">Марко Петровски</span>
+            <span class="badge bg-warning ms-2">
+              <i class="bi bi-star-fill"></i>
+              <span th:text="${lease.tenant.user.rating}">4.5</span>
+            </span>
+          </span>
+        </div>
+
+        <div class="d-flex justify-content-between py-2">
+          <span class="text-primary fw-medium">Сопственик:</span>
+          <span class="text-dark">
+            <span th:text="${lease.landlord.user.firstName + ' ' + lease.landlord.user.lastName}">Ана Стојановска</span>
+            <span class="badge bg-warning ms-2">
+              <i class="bi bi-star-fill"></i>
+              <span th:text="${lease.landlord.user.rating}">4.8</span>
+            </span>
+          </span>
+        </div>
+
+        <div class="d-flex justify-content-between py-2">
+          <span class="text-primary fw-medium">Адреса: </span>
+          <span class="text-dark" th:text="${lease.listing.unit.property.address.street + ' ' + lease.listing.unit.property.address.number + ', ' + lease.listing.unit.property.address.municipality + ', ' + lease.listing.unit.property.address.city + ', ' + lease.listing.unit.property.address.country }">ул. Македонија 123, Скопје</span>
+        </div>
+      </div>
+    </div>
+
+    <div style="width: 55%;">
+      <img th:src="${lease.listing.unit.images[0].image}"
+           th:alt="${lease.listing.title}"
+           class="img-fluid property-image"
+           style="object-fit: cover; height: 300px; width: 100%;"
+           onerror="this.src='/images/default-property.jpg'">
+    </div>
+  </div>
+
+  <!-- Property Description -->
+  <div class="info-section mt-4 p-4 rounded-4 shadow-sm">
+    <h4 class="text-primary mb-3">
+      <i class="bi bi-info-circle me-2"></i>Опис на имотот
+    </h4>
+    <p th:text="${lease.listing.description}" class="mb-0">
+      Удобен стан со 1 спална соба, совршен за самохран професионалец
+    </p>
+  </div>
+
+  <!-- Property Details -->
+  <div class="info-section mt-4 p-4 rounded-4 shadow-sm">
+    <h4 class="text-primary mb-3">
+      <i class="bi bi-house me-2"></i>Детали за имотот
+    </h4>
+    <div class="row">
+      <div class="col-md-6">
+        <div class="d-flex justify-content-between py-2">
+          <span class="fw-medium">Тип на имот:</span>
+          <span th:text="${lease.listing.unit.property.propertyType.name}">Стан</span>
+        </div>
+        <div class="d-flex justify-content-between py-2">
+          <span class="fw-medium">Спрат:</span>
+          <span th:text="${lease.listing.unit.floor}">2</span>
+        </div>
+      </div>
+      <div class="col-md-6">
+        <div class="d-flex justify-content-between py-2">
+          <span class="fw-medium">Број на единица:</span>
+          <span th:text="${lease.listing.unit.unitNumber}">12A</span>
+        </div>
+        <div class="d-flex justify-content-between py-2">
+          <span class="fw-medium">Големина:</span>
+          <span>
+            <span th:text="${lease.listing.unit.areaSqM}">65</span> м²
+          </span>
+        </div>
+      </div>
+    </div>
+  </div>
+
+  <!-- Action Buttons -->
+  <div class="mt-4 d-flex justify-content-around align-items-center flex-wrap gap-3">
+    <button class="btn text-white px-4 py-2 rounded-4 shadow-sm header-gradient action-btn">
+      <i class="bi bi-chat-dots me-2"></i>Пораки
+    </button>
+    <button class="btn text-white px-4 py-2 rounded-4 shadow-sm header-gradient action-btn">
+      <i class="bi bi-file-earmark-text me-2"></i>Документи
+    </button>
+    <button class="btn text-white px-4 py-2 rounded-4 shadow-sm header-gradient action-btn">
+      <i class="bi bi-search me-2"></i>Инспекции
+    </button>
+    <button class="btn text-white px-4 py-2 rounded-4 shadow-sm header-gradient action-btn">
+      <i class="bi bi-tools me-2"></i>Сервиси
+    </button>
+    <button class="btn text-white px-4 py-2 rounded-4 shadow-sm header-gradient action-btn">
+      <i class="bi bi-credit-card me-2"></i>Плаќања
+    </button>
+  </div>
+</div>
+
+<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
+</body>
+</html>
Index: src/main/resources/templates/leases.html
===================================================================
--- src/main/resources/templates/leases.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/leases.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -22,26 +22,19 @@
       transition: color 0.2s;
       margin-right: 4px;
+      font-size: 1.2rem;
+    }
+    .star-rating i:hover {
+      transform: scale(1.1);
+    }
+    .rating-info {
+      font-size: 0.8rem;
+      color: #666;
+      margin-top: 4px;
     }
   </style>
 </head>
 <body>
-<header class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
-  <div class="container-fluid">
-    <div class="row align-items-center">
-      <div class="col-md-6 d-flex align-items-center">
-        <img th:src="@{/images/logo.png}" class="ms-5 rounded-pill" style="width: 50px; height: 50px; object-fit: cover;">
-        <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
-        <button class="btn btn-outline-light">Мои изнајмувања</button>
-      </div>
-      <div class="col-md-6 text-end">
-        <span class="btn btn-outline-light me-2">
-          <i class="bi bi-person-circle me-2"></i>
-          <span th:text="${user.firstName + ' ' + user.lastName}">Стефан Николов</span>
-        </span>
-        <a th:href="@{/logout}" class="btn btn-outline-light">Одјави се</a>
-      </div>
-    </div>
-  </div>
-</header>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
+
 
 <div class="m-auto w-75">
@@ -67,18 +60,29 @@
 
         <td class="py-3 px-4">
-          <div th:if="${userService.isLandlord(user.id)}">
-            <div class="star-rating" th:attr="data-lease-id=${lease.id},data-rate-type='tenant'">
+          <div th:if="${isLandlord}">
+            <div class="star-rating" th:attr="data-lease-id=${lease.id}">
               <i th:each="star : ${#numbers.sequence(1, 5)}"
-                 th:classappend="${lease.tenant.user.rating >= star} ? 'bi-star-fill' : 'bi-star'"
-                 class="bi fs-4 text-warning"
+                 class="bi bi-star text-warning"
                  th:attr="data-value=${star}"></i>
             </div>
+            <div class="rating-info">
+              Оценете го станарот
+            </div>
+            <div class="rating-info">
+              Тековна оценка: <span th:text="${lease.tenant.user.rating}">0</span>⭐
+            </div>
           </div>
-          <div th:unless="${userService.isLandlord(user.id)}">
-            <div class="star-rating" th:attr="data-lease-id=${lease.id},data-rate-type='landlord'">
+
+          <div th:if="${!isLandlord}">
+            <div class="star-rating" th:attr="data-lease-id=${lease.id}">
               <i th:each="star : ${#numbers.sequence(1, 5)}"
-                 th:classappend="${lease.landlord.user.rating >= star} ? 'bi-star-fill' : 'bi-star'"
-                 class="bi fs-4 text-warning"
+                 class="bi bi-star text-warning"
                  th:attr="data-value=${star}"></i>
+            </div>
+            <div class="rating-info">
+              Оценете го сопственикот
+            </div>
+            <div class="rating-info">
+              Тековна оценка: <span th:text="${lease.landlord.user.rating}">0</span>⭐
             </div>
           </div>
@@ -86,5 +90,5 @@
 
         <td class="py-3 px-4">
-          <a th:href="@{/leases/{id}/details(id=${lease.id})}"
+          <a th:href="@{/lease/{id}/details(id=${lease.id})}"
              class="btn btn-sm btn-outline-primary rounded-pill px-3">
             Види детали
@@ -104,13 +108,18 @@
 
     function setStars(rating) {
-      stars.forEach(star => {
-        star.classList.toggle('bi-star-fill', star.dataset.value <= rating);
-        star.classList.toggle('bi-star', star.dataset.value > rating);
+      stars.forEach((star, index) => {
+        if (index < rating) {
+          star.classList.remove('bi-star');
+          star.classList.add('bi-star-fill');
+        } else {
+          star.classList.remove('bi-star-fill');
+          star.classList.add('bi-star');
+        }
       });
     }
 
-    stars.forEach(star => {
+    stars.forEach((star, index) => {
       star.addEventListener('mouseenter', () => {
-        setStars(star.dataset.value);
+        setStars(index + 1);
       });
 
@@ -120,24 +129,41 @@
 
       star.addEventListener('click', () => {
-        currentRating = star.dataset.value;
+        const newRating = index + 1;
+        currentRating = newRating;
         setStars(currentRating);
 
-        fetch('/api/leases/' + leaseId + '/rate', {
+        fetch('/lease/api/leases/' + leaseId + '/rate', {
           method: 'POST',
           headers: {
             'Content-Type': 'application/json',
           },
-          body: JSON.stringify({ rating: currentRating }),
+          body: JSON.stringify({ rating: newRating }),
         })
-                .then(response => {
-                  if (!response.ok) throw new Error('Грешка при испраќање на оценката');
-                  return response.json();
-                })
+                .then(response => response.json())
                 .then(data => {
-                  console.log('Rating saved:', data);
+                  if (data.status === 'success') {
+                    console.log('Rating saved successfully');
+                    const successMsg = document.createElement('div');
+                    successMsg.className = 'alert alert-success alert-dismissible fade show mt-2';
+                    successMsg.innerHTML = `
+              <small>Оценката е успешно зачувана!</small>
+              <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
+            `;
+                    container.appendChild(successMsg);
+
+                    setTimeout(() => {
+                      if (successMsg.parentNode) {
+                        successMsg.remove();
+                      }
+                    }, 3000);
+                  } else {
+                    throw new Error(data.message || 'Unknown error');
+                  }
                 })
                 .catch(err => {
-                  alert('Грешка при испраќање на оценката');
-                  console.error(err);
+                  console.error('Error saving rating:', err);
+                  alert('Грешка при зачувување на оценката: ' + err.message);
+                  // Reset stars on error
+                  currentRating = 0;
                   setStars(currentRating);
                 });
@@ -147,4 +173,5 @@
 </script>
 
+<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
 </body>
 </html>
Index: src/main/resources/templates/listing.html
===================================================================
--- src/main/resources/templates/listing.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/listing.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -21,21 +21,6 @@
 </head>
 <body>
-<header class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
-  <div class="container-fluid">
-    <div class="row align-items-center">
-      <div class="col-md-6 d-flex align-items-center">
-        <img src="logo.png" class="ms-5 rounded-pill" style="width: 50px; height: 50px; object-fit: cover;">
-        <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
-        <button class="btn btn-outline-light">Мои изнајмувања</button>
-      </div>
-      <div class="col-md-6 text-end">
-        <button class="btn btn-outline-light me-2">
-          <i class="bi bi-person-circle me-2"></i>Стефан Николов
-        </button>
-        <button class="btn btn-outline-light">Одјави се</button>
-      </div>
-    </div>
-  </div>
-</header>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
+
 
 <div class="mt-4 bg-light-subtle rounded-4 shadow-sm p-4 m-auto mb-4" style="width: 85%;">
@@ -74,5 +59,5 @@
         <a th:if="${isLandlord}" th:href="@{/listings/{id}/applications(id=${listing.id})}" class="mt-3 btn header-gradient text-white">Преглед на пријавени</a>
         <a th:if="${!isLandlord}" th:href="@{/listings/{id}/apply(id=${listing.id})}" class="mt-3 btn header-gradient text-white">Аплицирај за наем</a>
-        <a th:href="@{/units/{id}(id=${listing.unit.id})}" class="mt-3 btn header-gradient text-white">Детали</a>
+        <a th:href="@{'/units/' + ${listing.getUnit().getId()} + '/details'}" class="mt-3 btn header-gradient text-white">Детали</a>
       </div>
     </div>
@@ -90,5 +75,5 @@
   </div>
 </div>
-
+<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
 </body>
 </html>
Index: src/main/resources/templates/login.html
===================================================================
--- src/main/resources/templates/login.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/login.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -19,4 +19,8 @@
   <div class="bg-light-subtle rounded-4 shadow-sm p-5" style="width: 100%; max-width: 400px;">
     <h2 class="text-center text-primary fw-bold mb-4">Најава</h2>
+
+    <div th:if="${param.logout}" class="alert alert-success text-center">
+      Успешно се одјавивте.
+    </div>
 
     <form action="/login" method="post">
Index: src/main/resources/templates/properties.html
===================================================================
--- src/main/resources/templates/properties.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/properties.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -22,49 +22,6 @@
 </head>
 <body>
-<header class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
-    <div class="container-fluid">
-        <div class="row align-items-center">
-            <div class="col-md-6 d-flex align-items-center">
-                <img src="/images/logo.png" class="ms-5 rounded-pill" style="width: 50px; height: 50px; object-fit: cover;">
-                <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
-                <a href="/my-rentals" class="btn btn-outline-light" th:if="${user != null} and ${isLandlord}" >Мои огласи</a>
-                <a href="/my-rentals" class="btn btn-outline-light" th:if="${user != null} and ${!isLandlord}" >Мои изнајмувања</a>
-            </div>
-            <div class="col-md-6 d-flex justify-content-end align-items-center">
-                <div class="dropdown d-inline-block me-5">
-                    <button class="btn btn-outline-light dropdown-toggle" type="button" id="userDropdown"
-                            data-bs-toggle="dropdown" aria-expanded="false">
-                        <i class="bi bi-person-circle me-2"></i>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
 
-                        <span th:if="${user != null}" th:text="${user.getFirstName() + ' ' + user.getLastName()}">Корисник</span>
-                        <span th:if="${user == null}">Најави се</span>
-                    </button>
-
-                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-                        th:if="${user != null} and ${isLandlord}">
-                        <li><a class="dropdown-item" href="#">Профил</a></li>
-                        <li><a class="dropdown-item" href="#">Мои изнајмувања</a></li>
-                        <li><a class="dropdown-item" href="#">Направи оглас</a></li>
-                        <li><a class="dropdown-item" th:href="@{'/properties/' + ${user.getId()}}">Мои имоти</a></li>
-                        <li><hr class="dropdown-divider"></li>
-                        <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
-                    </ul>
-
-                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-                        th:if="${user != null} and !${isLandlord}">
-                        <li><a class="dropdown-item" href="#">Профил</a></li>
-                        <li><hr class="dropdown-divider"></li>
-                        <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
-                    </ul>
-
-                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-                        th:if="${user == null}">
-                        <li><a class="dropdown-item" href="/login">Најави се</a></li>
-                    </ul>
-                </div>
-            </div>
-        </div>
-    </div>
-</header>
 <div class="container-fluid">
     <div class="row p-3 justify-content-center">
Index: src/main/resources/templates/property.html
===================================================================
--- src/main/resources/templates/property.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/property.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -19,49 +19,6 @@
 </head>
 <body>
-<header class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
-  <div class="container-fluid">
-    <div class="row align-items-center">
-      <div class="col-md-6 d-flex align-items-center">
-        <img src="/images/logo.png" class="ms-5 rounded-pill" style="width: 50px; height: 50px; object-fit: cover;">
-        <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
-        <a href="/my-rentals" class="btn btn-outline-light" th:if="${user != null} and ${isLandlord}" >Мои огласи</a>
-        <a href="/my-rentals" class="btn btn-outline-light" th:if="${user != null} and ${!isLandlord}" >Мои изнајмувања</a>
-      </div>
-      <div class="col-md-6 d-flex justify-content-end align-items-center">
-        <div class="dropdown d-inline-block me-5">
-          <button class="btn btn-outline-light dropdown-toggle" type="button" id="userDropdown"
-                  data-bs-toggle="dropdown" aria-expanded="false">
-            <i class="bi bi-person-circle me-2"></i>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
 
-            <span th:if="${user != null}" th:text="${user.getFirstName() + ' ' + user.getLastName()}">Корисник</span>
-            <span th:if="${user == null}">Најави се</span>
-          </button>
-
-          <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-              th:if="${user != null} and ${isLandlord}">
-            <li><a class="dropdown-item" href="#">Профил</a></li>
-            <li><a class="dropdown-item" href="#">Мои изнајмувања</a></li>
-            <li><a class="dropdown-item" href="#">Направи оглас</a></li>
-            <li><a class="dropdown-item" th:href="@{'/properties/' + ${user.getId()}}">Мои имоти</a></li>
-            <li><hr class="dropdown-divider"></li>
-            <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
-          </ul>
-
-          <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-              th:if="${user != null} and !${isLandlord}">
-            <li><a class="dropdown-item" href="#">Профил</a></li>
-            <li><hr class="dropdown-divider"></li>
-            <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
-          </ul>
-
-          <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-              th:if="${user == null}">
-            <li><a class="dropdown-item" href="/login">Најави се</a></li>
-          </ul>
-        </div>
-      </div>
-    </div>
-  </div>
-</header>
 
 <div class="mt-4 bg-light-subtle rounded-4 shadow-sm p-4 m-auto mb-4" style="width: 85%;">
@@ -79,5 +36,4 @@
           <span class="text-dark" th:text="${#temporals.format(property.createdAt, 'yyyy-MM-dd')}">2024-07-01</span>
         </div>
-
         <div class="d-flex justify-content-between py-2">
           <span class="text-primary fw-medium">Адреса:</span>
Index: src/main/resources/templates/unit.html
===================================================================
--- src/main/resources/templates/unit.html	(revision 9f8306e5719d5a03b6d96517cb7d316b035d6b1c)
+++ src/main/resources/templates/unit.html	(revision 546d4ed297bce443acf230de3eff85d4aabc634f)
@@ -21,49 +21,6 @@
 </head>
 <body>
-<header class="header-gradient text-white py-3 rounded-bottom-4 shadow-sm">
-    <div class="container-fluid">
-        <div class="row align-items-center">
-            <div class="col-md-6 d-flex align-items-center">
-                <img src="/images/logo.png" class="ms-5 rounded-pill" style="width: 50px; height: 50px; object-fit: cover;">
-                <h1 class="h2 mb-0 ms-3 me-4">Domify</h1>
-                <a href="/my-rentals" class="btn btn-outline-light" th:if="${user != null} and ${isLandlord}" >Мои огласи</a>
-                <a href="/my-rentals" class="btn btn-outline-light" th:if="${user != null} and ${!isLandlord}" >Мои изнајмувања</a>
-            </div>
-            <div class="col-md-6 d-flex justify-content-end align-items-center">
-                <div class="dropdown d-inline-block me-5">
-                    <button class="btn btn-outline-light dropdown-toggle" type="button" id="userDropdown"
-                            data-bs-toggle="dropdown" aria-expanded="false">
-                        <i class="bi bi-person-circle me-2"></i>
+<div th:replace="fragments/header :: appHeader(${user}, ${isLandlord})"></div>
 
-                        <span th:if="${user != null}" th:text="${user.getFirstName() + ' ' + user.getLastName()}">Корисник</span>
-                        <span th:if="${user == null}">Најави се</span>
-                    </button>
-
-                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-                        th:if="${user != null} and ${isLandlord}">
-                        <li><a class="dropdown-item" href="#">Профил</a></li>
-                        <li><a class="dropdown-item" href="#">Мои изнајмувања</a></li>
-                        <li><a class="dropdown-item" href="#">Направи оглас</a></li>
-                        <li><a class="dropdown-item" th:href="@{'/properties/' + ${user.getId()}}">Мои имоти</a></li>
-                        <li><hr class="dropdown-divider"></li>
-                        <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
-                    </ul>
-
-                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-                        th:if="${user != null} and !${isLandlord}">
-                        <li><a class="dropdown-item" href="#">Профил</a></li>
-                        <li><hr class="dropdown-divider"></li>
-                        <li><a class="dropdown-item" href="/logout">Одјави се</a></li>
-                    </ul>
-
-                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown"
-                        th:if="${user == null}">
-                        <li><a class="dropdown-item" href="/login">Најави се</a></li>
-                    </ul>
-                </div>
-            </div>
-        </div>
-    </div>
-</header>
 
 <div class="mt-4 bg-light-subtle rounded-4 shadow-sm p-4 m-auto mb-4" style="width: 85%;">
