Index: src/main/java/com/example/autopartz/controller/HomeController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/HomeController.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/controller/HomeController.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -2,4 +2,7 @@
 
 import com.example.autopartz.model.User;
+import com.example.autopartz.repository.PartsForCarTypeAndCategoryRepository;
+import com.example.autopartz.service.CarService;
+import com.example.autopartz.service.CategoryService;
 import com.example.autopartz.service.LoginService;
 import com.example.autopartz.service.PartService;
@@ -16,8 +19,14 @@
     private final LoginService loginService;
     private final PartService partService;
+    private final PartsForCarTypeAndCategoryRepository partsForCarTypeAndCategoryRepository;
+    private final CarService carService;
+    private final CategoryService categoryService;
 
-    public HomeController(LoginService loginService, PartService partService) {
+    public HomeController(LoginService loginService, PartService partService, PartsForCarTypeAndCategoryRepository partsForCarTypeAndCategoryRepository, CarService carService, CategoryService categoryService) {
         this.loginService = loginService;
         this.partService = partService;
+        this.partsForCarTypeAndCategoryRepository = partsForCarTypeAndCategoryRepository;
+        this.carService = carService;
+        this.categoryService = categoryService;
     }
 
@@ -25,17 +34,29 @@
     public String getHomePage(Model model){
         model.addAttribute("parts",partService.findAll());
-        return "homepage";
+        model.addAttribute("cars",carService.findAll());
+        model.addAttribute("categories",categoryService.findAll());
+        model.addAttribute("bodyContent","homepage");
+        return "master-template";
+    }
+    @GetMapping("/filtered")
+    public String getPartsForCarTypeAndCategory(@RequestParam String cartype, @RequestParam String category, Model model){
+        model.addAttribute("filtered", partsForCarTypeAndCategoryRepository.findAllByCartypeAndCategory(cartype,category));
+        model.addAttribute("bodyContent","filteredParts");
+        return "master-template";
     }
     @GetMapping("/login")
-    public String getLoginPage(){
-        return "login";
+    public String getLoginPage(Model model){
+        model.addAttribute("bodyContent","login");
+        return "master-template";
     }
     @GetMapping("/register")
-    public String getRegisterPage(){
-        return "register";
+    public String getRegisterPage(Model model){
+        model.addAttribute("bodyContent","register");
+        return "master-template";
     }
     @PostMapping("/login")
     public void handleLogin(@RequestParam String username, @RequestParam String password){
         User u = loginService.login(username,password);
+        System.out.println(u.getName_user());
     }
     @PostMapping("/register")
Index: src/main/java/com/example/autopartz/controller/PartController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/PartController.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/controller/PartController.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -29,5 +29,6 @@
         model.addAttribute("part",temp);
         model.addAttribute("amount",amount);
-        return "partinfo";
+        model.addAttribute("bodyContent","partinfo");
+        return "master-template";
     }
     @GetMapping("/delivery/{id}")
@@ -35,5 +36,6 @@
         model.addAttribute("repairShops",repairShopService.findAll());
         model.addAttribute("partId",id);
-        return "deliveryForPart";
+        model.addAttribute("bodyContent","deliveryForPart");
+        return "master-template";
     }
     @PostMapping("/repairshopdelivery")
Index: src/main/java/com/example/autopartz/controller/UserController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/UserController.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/controller/UserController.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -16,13 +16,11 @@
     private final UserService userService;
     private final RepairShopReviewSummaryRepository repairShopReviewSummaryRepository;
-    private final PartsForCarTypeAndCategoryRepository partsForCarTypeAndCategoryRepository;
 
     private final OrdersForUserRepository ordersForUserRepository;
     private final RepairsForUserRepository repairsForUserRepository;
     private final ReviewsForUserRepository reviewsForUserRepository;
-    public UserController(UserService userService, RepairShopReviewSummaryRepository repairShopReviewSummaryRepository, PartsForCarTypeAndCategoryRepository partsForCarTypeAndCategoryRepository, OrdersForUserRepository ordersForUserRepository, RepairsForUserRepository repairsForUserRepository, ReviewsForUserRepository reviewsForUserRepository) {
+    public UserController(UserService userService, RepairShopReviewSummaryRepository repairShopReviewSummaryRepository, OrdersForUserRepository ordersForUserRepository, RepairsForUserRepository repairsForUserRepository, ReviewsForUserRepository reviewsForUserRepository) {
         this.userService = userService;
         this.repairShopReviewSummaryRepository = repairShopReviewSummaryRepository;
-        this.partsForCarTypeAndCategoryRepository = partsForCarTypeAndCategoryRepository;
         this.ordersForUserRepository = ordersForUserRepository;
         this.repairsForUserRepository = repairsForUserRepository;
@@ -37,22 +35,21 @@
         return userService.findAllUsers();
     }
-    @GetMapping("parts")
-    public List<PartsForCarTypeAndCategory> getPartsForCarTypeAndCategory(@RequestParam String cartype, @RequestParam String category){
-        return partsForCarTypeAndCategoryRepository.findAllByCartypeAndCategory(cartype,category);
-    }
     @GetMapping("orders/{id}")
     public String getOrdersForUser(@PathVariable Long id, Model model){
         model.addAttribute("userOrders",ordersForUserRepository.findAllByUserid(id));
-        return "ordersForUser";
+        model.addAttribute("bodyContent","ordersForUser");
+        return "master-template";
     }
     @GetMapping("repairs/{id}")
     public String getRepairsForUser(@PathVariable Long id,Model model){
         model.addAttribute("userRepairs",repairsForUserRepository.findAllByUserid(id));
-        return "repairsForUser";
+        model.addAttribute("bodyContent","repairsForUser");
+        return "master-template";
     }
     @GetMapping("reviews/{id}")
     public String getReviewsForUser(@PathVariable Long id, Model model){
         model.addAttribute("userReviews",reviewsForUserRepository.findAllByUserid(id));
-        return "reviewsForUser";
+        model.addAttribute("bodyContent","reviewsForUser");
+        return "master-template";
     }
 }
Index: src/main/java/com/example/autopartz/model/Car.java
===================================================================
--- src/main/java/com/example/autopartz/model/Car.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/model/Car.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -18,5 +18,6 @@
     Integer in_production_since;
     Integer in_production_till;
-    String car_type;
+    @Column(name = "car_type")
+    String cartype;
     @ManyToOne
     @JoinColumn(name = "id_car_manufacturer")
Index: src/main/java/com/example/autopartz/model/Category.java
===================================================================
--- src/main/java/com/example/autopartz/model/Category.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/model/Category.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -1,8 +1,5 @@
 package com.example.autopartz.model;
 
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.JoinColumn;
-import jakarta.persistence.ManyToOne;
+import jakarta.persistence.*;
 import lombok.*;
 import org.hibernate.Hibernate;
@@ -18,5 +15,6 @@
     @Id
     Long ID_category;
-    String category_name;
+    @Column(name = "category_name")
+    String cname;
     @ManyToOne
     @JoinColumn(name = "id_parent_category")
Index: src/main/java/com/example/autopartz/model/views/PartsForCarTypeAndCategory.java
===================================================================
--- src/main/java/com/example/autopartz/model/views/PartsForCarTypeAndCategory.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/model/views/PartsForCarTypeAndCategory.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -25,3 +25,4 @@
     String cartype;
     String category;
+    String pmname;
 }
Index: src/main/java/com/example/autopartz/repository/CarRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/CarRepository.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
+++ src/main/java/com/example/autopartz/repository/CarRepository.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -0,0 +1,9 @@
+package com.example.autopartz.repository;
+
+import com.example.autopartz.model.Car;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface CarRepository extends JpaRepository<Car,Long> {
+}
Index: src/main/java/com/example/autopartz/repository/CategoryRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/CategoryRepository.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
+++ src/main/java/com/example/autopartz/repository/CategoryRepository.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -0,0 +1,9 @@
+package com.example.autopartz.repository;
+
+import com.example.autopartz.model.Category;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface CategoryRepository extends JpaRepository<Category,Long> {
+}
Index: src/main/java/com/example/autopartz/service/CarService.java
===================================================================
--- src/main/java/com/example/autopartz/service/CarService.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
+++ src/main/java/com/example/autopartz/service/CarService.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -0,0 +1,9 @@
+package com.example.autopartz.service;
+
+import com.example.autopartz.model.Car;
+
+import java.util.List;
+
+public interface CarService {
+    List<Car> findAll();
+}
Index: src/main/java/com/example/autopartz/service/CategoryService.java
===================================================================
--- src/main/java/com/example/autopartz/service/CategoryService.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
+++ src/main/java/com/example/autopartz/service/CategoryService.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -0,0 +1,9 @@
+package com.example.autopartz.service;
+
+import com.example.autopartz.model.Category;
+
+import java.util.List;
+
+public interface CategoryService {
+    List<Category> findAll();
+}
Index: src/main/java/com/example/autopartz/service/impl/CarServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/CarServiceImpl.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
+++ src/main/java/com/example/autopartz/service/impl/CarServiceImpl.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -0,0 +1,22 @@
+package com.example.autopartz.service.impl;
+
+import com.example.autopartz.model.Car;
+import com.example.autopartz.repository.CarRepository;
+import com.example.autopartz.service.CarService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CarServiceImpl implements CarService {
+    private final CarRepository carRepository;
+
+    public CarServiceImpl(CarRepository carRepository) {
+        this.carRepository = carRepository;
+    }
+
+    @Override
+    public List<Car> findAll() {
+        return carRepository.findAll();
+    }
+}
Index: src/main/java/com/example/autopartz/service/impl/CategoryServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/CategoryServiceImpl.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
+++ src/main/java/com/example/autopartz/service/impl/CategoryServiceImpl.java	(revision 60de3eb30a33d09f7332ce3daf2fdef34340c353)
@@ -0,0 +1,22 @@
+package com.example.autopartz.service.impl;
+
+import com.example.autopartz.model.Category;
+import com.example.autopartz.repository.CategoryRepository;
+import com.example.autopartz.service.CategoryService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CategoryServiceImpl implements CategoryService {
+    private final CategoryRepository categoryRepository;
+
+    public CategoryServiceImpl(CategoryRepository categoryRepository) {
+        this.categoryRepository = categoryRepository;
+    }
+
+    @Override
+    public List<Category> findAll() {
+        return categoryRepository.findAll();
+    }
+}
