Index: docs/todo.txt
===================================================================
--- docs/todo.txt	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ docs/todo.txt	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -38,5 +38,5 @@
 - to so referenciranje da go napreme
 - view channels page da sa napret, imas ideja toska ke ti teknit to so chatojte ko preview da sa. (ova samo za mene e viktor uzivaj)
-
+- edit na chat messages
 ------------
 
@@ -50,5 +50,5 @@
     - create za kreiranje novi obj
     - Najcesti zborcinja za koristenje: get, create,update,delete
-
+    - html pagese tie sho prikazhvat neshto da se vikat show
 - Optionals vo repo ponatamu
 
Index: src/main/java/com/db/finki/www/build_board/config/WebSecurityConfig.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/config/WebSecurityConfig.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/config/WebSecurityConfig.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -16,4 +16,7 @@
 import org.springframework.security.web.SecurityFilterChain;
 import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
+import org.springframework.security.web.context.DelegatingSecurityContextRepository;
+import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
+import org.springframework.security.web.context.SecurityContextRepository;
 import org.springframework.security.web.util.matcher.AndRequestMatcher;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
@@ -34,5 +37,4 @@
         this.successHandler = successHandler;
     }
-
     @Bean
     public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
@@ -48,5 +50,7 @@
                                 "*.jpg",
                                 "*.png",
-                                "/register"
+                                "/register",
+                                        "/css/**",
+                                        "/js/**"
                                 ).permitAll()
                                 .requestMatchers(
@@ -64,5 +68,9 @@
                 )
                 .logout(logout ->
-                        logout.logoutSuccessUrl("/"));
+                        logout.logoutSuccessUrl("/")
+                                .clearAuthentication(true)
+                                .invalidateHttpSession(true)
+                                .deleteCookies("JSESSIONID")
+                );
 
         return http.build();
@@ -82,3 +90,8 @@
         return config.getAuthenticationManager();
     }
+
+    @Bean
+    public SecurityContextRepository securityContextRepository() {
+        return new DelegatingSecurityContextRepository(new HttpSessionSecurityContextRepository());
+    }
 }
Index: src/main/java/com/db/finki/www/build_board/config/WebSocketConfig.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/config/WebSocketConfig.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/config/WebSocketConfig.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -12,4 +12,5 @@
 import java.util.List;
 
+
 @Configuration
 @EnableWebSocketMessageBroker
@@ -24,6 +25,6 @@
     @Override
     public void configureMessageBroker(MessageBrokerRegistry config) {
-        config.enableSimpleBroker("/project");
-        config.setApplicationDestinationPrefixes("/project");
+        config.enableSimpleBroker("/projects");
+        config.setApplicationDestinationPrefixes("/projects");
     }
 
Index: src/main/java/com/db/finki/www/build_board/controller/ExceptionHandler.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/ExceptionHandler.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/controller/ExceptionHandler.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,4 +1,5 @@
 package com.db.finki.www.build_board.controller;
 
+import org.springframework.dao.DataIntegrityViolationException;
 import org.springframework.security.access.AccessDeniedException;
 import org.springframework.web.bind.annotation.ControllerAdvice;
@@ -40,5 +41,3 @@
         return mavBuilder(exception,"Unknown exception",-1);
     }
-
-
 }
Index: src/main/java/com/db/finki/www/build_board/controller/channel/ChannelController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/channel/ChannelController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/channel/ChannelController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,81 @@
+package com.db.finki.www.build_board.controller.channel;
+
+import com.db.finki.www.build_board.entity.channel.Channel;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.mapper.MessageMapper;
+import com.db.finki.www.build_board.service.channel.ChannelService;
+import com.db.finki.www.build_board.service.channel.MessageService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.parameters.P;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import java.util.List;
+
+
+@Controller
+@RequestMapping("/projects/{title}/channels")
+public class ChannelController {
+    private final ChannelService channelService;
+    private final MessageMapper messageMapper;
+    private final MessageService messageService;
+
+    public ChannelController(ChannelService channelService, MessageMapper messageMapper, MessageService messageService) {
+        this.channelService = channelService;
+        this.messageMapper = messageMapper;
+        this.messageService = messageService;
+    }
+
+    @GetMapping()
+    public String getChannels(@PathVariable("title") Project project, Model model) {
+        List<Channel> channels = channelService.getAllChannelsForProject(project);
+        model.addAttribute("channels", channels);
+        return "channels/list-channels";
+    }
+
+    @PreAuthorize("#project.getDevelopers().contains(#user)")
+    @GetMapping("/{channelName}")
+    public String getChannel(@PathVariable String channelName,
+                             @PathVariable("title") @P("project") Project project,
+                             Model model,
+                             RedirectAttributes redirectAttributes,
+                             @SessionAttribute @P("user") BBUser user
+    ) {
+        Channel c = (Channel) redirectAttributes.getAttribute("channel");
+        if (c == null) {
+            c = channelService.getByNameAndProject(channelName, project);
+            model.addAttribute("channel", c);
+            model.addAttribute("messages", messageMapper.toDTO(
+                    messageService.getAllMessagesForProjectChannel(project.getId(), channelName)));
+        } else {
+            model.addAttribute("channel", c);
+        }
+
+        return "channels/show-channel";
+    }
+
+    @PreAuthorize("@channelService.getByNameAndProject(#channelName,#project).getDeveloper().equals(#user)")
+    @PostMapping("/{channelName}/delete")
+    public String deleteChannel(@PathVariable @P("channelName") String channelName, @PathVariable("title") @P("project") Project project,
+                                @SessionAttribute @P("user") BBUser user, RedirectAttributes redirectAttributes) {
+        channelService.deleteChannel(channelName, project);
+        return "redirect:/projects/" + project.getTitle();
+    }
+
+    @PreAuthorize("#project.getDevelopers().contains(#user)")
+    @PostMapping("/add")
+    public String add(@PathVariable("title") @P("project") Project project, @RequestParam String channelName, @RequestParam String channelDescription, @SessionAttribute @P("user") BBUser user, RedirectAttributes redirectAttributes) {
+        try {
+            Channel channel = channelService.create(project, channelName, channelDescription, user);
+            redirectAttributes.addFlashAttribute("channel", channel);
+        } catch (Exception e) {
+            redirectAttributes.addFlashAttribute("error", e.getMessage());
+        }
+
+        return "redirect:/projects/" + project.getTitle();
+    }
+
+}
Index: src/main/java/com/db/finki/www/build_board/controller/channel/ChannelWebSocketController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/channel/ChannelWebSocketController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/channel/ChannelWebSocketController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,33 @@
+package com.db.finki.www.build_board.controller.channel;
+
+import com.db.finki.www.build_board.dto.channel.MessageDTO;
+import com.db.finki.www.build_board.entity.channel.Message;
+import com.db.finki.www.build_board.mapper.MessageMapper;
+import com.db.finki.www.build_board.service.channel.MessageService;
+import jakarta.transaction.Transactional;
+import org.springframework.messaging.handler.annotation.MessageMapping;
+import org.springframework.stereotype.Controller;
+
+import java.time.LocalDateTime;
+
+@Controller
+public class ChannelWebSocketController {
+
+    private final MessageService messageService;
+    private final MessageMapper messageMapper;
+
+    public ChannelWebSocketController(MessageService messageService, MessageMapper messageMapper) {
+        this.messageService = messageService;
+        this.messageMapper = messageMapper;
+    }
+
+    @MessageMapping("/{projectName}/channels/{channelName}")
+    @Transactional
+    MessageDTO chatMessage(MessageDTO messageDTO) {
+        messageDTO.setSentAt(LocalDateTime.now());
+        Message m = messageService.save(messageDTO);
+        MessageDTO rabotaj = messageMapper.toDTO(m);
+        rabotaj.setAvatarUrl(m.getSentBy().getAvatarUrl());
+        return rabotaj;
+    }
+}
Index: c/main/java/com/db/finki/www/build_board/controller/channels/ChannelController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/channels/ChannelController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,77 +1,0 @@
-package com.db.finki.www.build_board.controller.channels;
-
-import com.db.finki.www.build_board.entity.channels.Channel;
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.mappers.MessageMapper;
-import com.db.finki.www.build_board.service.channel.ChannelService;
-import com.db.finki.www.build_board.service.channel.MessageService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.security.core.parameters.P;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-import java.util.List;
-
-@Controller
-@RequestMapping("/project/{title}/channels")
-public class ChannelController {
-    private final ChannelService channelService;
-    private final MessageMapper messageMapper;
-    private final MessageService messageService;
-
-    public ChannelController(ChannelService channelService, MessageMapper messageMapper, MessageService messageService) {
-        this.channelService = channelService;
-        this.messageMapper = messageMapper;
-        this.messageService = messageService;
-    }
-
-    @GetMapping()
-    public String getChannels(@PathVariable("title") Project project, Model model) {
-        List<Channel> channels = channelService.getAllChannelsForProject(project);
-        model.addAttribute("channels", channels);
-        return "channels/list-channels";
-    }
-
-    @PreAuthorize("#project.getDevelopers().contains(#user)")
-    @GetMapping("/{channelName}")
-    public String getChannel(@PathVariable String channelName, @PathVariable("title") @P("project") Project project,
-                             Model model,
-                             RedirectAttributes redirectAttributes,
-                             @SessionAttribute @P("user") BBUser user) {
-        Channel c = (Channel) redirectAttributes.getAttribute("channel");
-        if (c == null) {
-            c = channelService.getByNameAndProject(channelName, project);
-            model.addAttribute("channel", c);
-            model.addAttribute("messages",messageMapper.toDTO(messageService.getAllMessagesForProjectChannel(project.getId(),channelName)));
-        } else {
-            model.addAttribute("channel", c);
-        }
-
-        return "channels/view-channel";
-    }
-
-    @PreAuthorize("@channelService.getByNameAndProject(#channelName,#project).getDeveloper().equals(#user)")
-    @PostMapping("/{channelName}/delete")
-    public String deleteChannel(@PathVariable @P("channelName") String channelName, @PathVariable("title") @P("project") Project project,
-                                @SessionAttribute @P("user") BBUser user, RedirectAttributes redirectAttributes) {
-        channelService.deleteChannel(channelName, project);
-        return "redirect:/project/" + project.getTitle();
-    }
-
-    @PreAuthorize("#project.getDevelopers().contains(#user)")
-    @PostMapping("/add")
-    public String add(@PathVariable("title") @P("project") Project project, @RequestParam String channelName, @RequestParam String channelDescription, @SessionAttribute @P("user") BBUser user, RedirectAttributes redirectAttributes) {
-        try {
-            Channel channel = channelService.create(project, channelName, channelDescription, user);
-            redirectAttributes.addFlashAttribute("channel", channel);
-        } catch (Exception e) {
-            redirectAttributes.addFlashAttribute("error", e.getMessage());
-        }
-
-        return "redirect:/project/" + project.getTitle();
-    }
-
-}
Index: c/main/java/com/db/finki/www/build_board/controller/channels/ChannelWebSocketController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/channels/ChannelWebSocketController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,37 +1,0 @@
-package com.db.finki.www.build_board.controller.channels;
-
-import com.db.finki.www.build_board.dto.channel.MessageDTO;
-import com.db.finki.www.build_board.entity.channels.Message;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.mappers.MessageMapper;
-import com.db.finki.www.build_board.service.channel.MessageService;
-import jakarta.transaction.Transactional;
-import org.springframework.messaging.handler.annotation.MessageMapping;
-import org.springframework.messaging.handler.annotation.SendTo;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.SessionAttribute;
-
-import java.time.LocalDateTime;
-
-@Controller
-public class ChannelWebSocketController {
-
-    private final MessageService messageService;
-    private final MessageMapper messageMapper;
-
-    public ChannelWebSocketController(MessageService messageService, MessageMapper messageMapper) {
-        this.messageService = messageService;
-        this.messageMapper = messageMapper;
-    }
-
-    @MessageMapping("/{projectName}/channels/{channelName}")
-    @Transactional
-    MessageDTO chatMessage(MessageDTO messageDTO) {
-        messageDTO.setSentAt(LocalDateTime.now());
-        Message m = messageService.saveMessage(messageDTO);
-        MessageDTO rabotaj = messageMapper.toDTO(m);
-        rabotaj.setAvatarUrl(m.getSentBy().getAvatarUrl());
-        return rabotaj;
-    }
-}
Index: src/main/java/com/db/finki/www/build_board/controller/home_page/HomePageController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/home_page/HomePageController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/home_page/HomePageController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,91 @@
+package com.db.finki.www.build_board.controller.home_page;
+
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.service.BBUserDetailsService;
+import com.db.finki.www.build_board.service.search.SearchService;
+import com.db.finki.www.build_board.service.thread.itf.TagService;
+import jakarta.servlet.http.HttpSession;
+import org.springframework.dao.DataIntegrityViolationException;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContext;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.web.context.SecurityContextRepository;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Controller
+public class HomePageController {
+    private final SearchService searchService;
+    private final TagService tagService;
+    private final BBUserDetailsService bbUserDetailsService;
+    private final SecurityContextRepository securityContextRepository;
+
+    public HomePageController(SearchService searchService, TagService tagService, BBUserDetailsService bbUserDetailsService, SecurityContextRepository securityContextRepository) {
+        this.searchService = searchService;
+        this.tagService = tagService;
+        this.bbUserDetailsService = bbUserDetailsService;
+        this.securityContextRepository = securityContextRepository;
+    }
+
+    @GetMapping("/")
+    public String search( @RequestParam(required = false)String query, @RequestParam(required = false) List<String> filters,  @RequestParam(required = false) String type , Model model) {
+        if(filters == null || filters.isEmpty()) {
+            filters = new ArrayList<>();
+            filters.add("all");
+        }
+
+        model.addAttribute("threads", searchService.search(query,filters,type));
+
+        System.out.println("TAGS: " + tagService.getAll());
+        model.addAttribute("tags",tagService.getAll());
+        return "home_pages/home";
+    }
+
+    @GetMapping("/about")
+    public String getAboutPage(){
+        return "home_pages/project_description";
+    }
+
+    @GetMapping("/register")
+    public String getRegisterPage(Model model) {
+        model.addAttribute("user", new BBUser());
+        model.addAttribute("canEdit",true);
+        return "home_pages/register";
+    }
+
+    @PostMapping("/register")
+    public String registerPost(
+            @RequestParam String username,
+            @RequestParam String email,
+            @RequestParam String name,
+            @RequestParam String password,
+            @RequestParam String description,
+            @RequestParam String sex,
+            RedirectAttributes redirectAttributes,
+            HttpSession session
+    ) {
+        try {
+            Authentication authentication = bbUserDetailsService.registerUser(username, email, name, password,description, sex);
+
+            SecurityContext context = SecurityContextHolder.getContext();
+            context.setAuthentication(authentication);
+
+            session.setAttribute("user", authentication.getPrincipal());
+            return "redirect:/";
+        }catch (DataIntegrityViolationException e) {
+            if(e.getMessage().contains("users_username_key"))
+            {
+                redirectAttributes.addFlashAttribute("duplicatedUsername",username);
+                return "redirect:/register";
+            }
+            throw e;
+        }
+    }
+}
Index: src/main/java/com/db/finki/www/build_board/controller/home_page/LoginPageController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/home_page/LoginPageController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/home_page/LoginPageController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,20 @@
+package com.db.finki.www.build_board.controller.home_page;
+
+import jakarta.servlet.http.HttpServletRequest;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@Controller
+public class LoginPageController {
+    @GetMapping("/login")
+    public String getLoginPage() {
+        return "login";
+    }
+    @PostMapping("/login")
+    public String login(@RequestParam String username, @RequestParam String password, Model model, HttpServletRequest request) {
+        return "redirect:/";
+    }
+}
Index: src/main/java/com/db/finki/www/build_board/controller/home_page/UserProfileController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/home_page/UserProfileController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/home_page/UserProfileController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,100 @@
+package com.db.finki.www.build_board.controller.home_page;
+
+import com.db.finki.www.build_board.entity.entity_enum.Status;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.service.BBUserDetailsService;
+import com.db.finki.www.build_board.service.request.ProjectRequestService;
+import com.db.finki.www.build_board.service.util.FileUploadService;
+import jakarta.servlet.http.HttpSession;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.parameters.P;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import java.io.IOException;
+
+//TODO: napraj poseben za edit i poseben samo za geldanje
+
+@Controller
+@RequestMapping("{username}")
+public class UserProfileController {
+    private final BBUserDetailsService userService;
+    private final FileUploadService fileUploadService;
+    private final ProjectRequestService projectRequestService;
+
+    public UserProfileController(BBUserDetailsService userService, FileUploadService fileUploadService, ProjectRequestService projectRequestService) {
+        this.userService = userService;
+        this.fileUploadService = fileUploadService;
+        this.projectRequestService = projectRequestService;
+    }
+   
+    @GetMapping("/profile")
+    public String getProfilePage(@PathVariable String username, @SessionAttribute BBUser user, Model model) {
+        try {
+            model.addAttribute("user", userService.loadUserByUsername(username));
+            model.addAttribute("canEdit", user.getUsername().equals(username));
+            return "home_pages/profile";
+        }catch(Exception ignore){
+            return "redirect:/";
+        }
+    }
+
+    @GetMapping("/project-requests")
+    public String getProjectRequestsPage(
+            @PathVariable String username,
+            Model model,
+            @RequestParam(required = false) Status status
+    ) {
+        BBUser forUser = (BBUser) userService.loadUserByUsername(username);
+        model.addAttribute("user", forUser);
+        model.addAttribute("requests", projectRequestService.getByStatusAndUser(status,forUser));
+        model.addAttribute("status", Status.values());
+        return "project_pages/requests/show-user-requests";
+    }
+
+    @PreAuthorize("#requestedByUsername==#username")
+    @PostMapping("/upload-avatar")
+    public String uploadAvatar(Model model,
+                               @PathVariable @P("username") String username,
+                               @RequestParam MultipartFile userImage,
+                               RedirectAttributes redirectAttributes,
+                               @RequestParam(name = "cur_user_username") @P("requestedByUsername") String requestedByUsername
+    ) {
+        BBUser u = (BBUser) userService.loadUserByUsername(username);
+        try{
+            fileUploadService.uploadAvatar(userImage,u.getId());
+            redirectAttributes.addFlashAttribute("message", "Avatar uploaded successfully");
+        } catch (IOException e) {
+            redirectAttributes.addFlashAttribute("message", "Cant upload avatar");
+        }
+
+        return "redirect:/" + username + "/profile";
+    }
+
+    @PreAuthorize("#requestedByUsername==#oldUsername")
+    @PostMapping("/profile/change")
+    public String changeInfo(
+            @RequestParam String email,
+            @RequestParam String name,
+            @RequestParam String description,
+            @PathVariable(name = "username") @P("oldUsername") String oldUsername,
+            @RequestParam(name = "username") String newUsername,
+            @RequestParam(name = "cur_user_username") @P("requestedByUsername") String requestedByUsername,
+            @RequestParam String password,
+            HttpSession session
+    ){
+        BBUser user = userService.changeInfoForUserWithUsername(
+                oldUsername,
+                newUsername,
+                email,
+                name,
+                description,
+                password
+        );
+        session.setAttribute("user", user);
+        return "redirect:/";
+    }
+}
Index: c/main/java/com/db/finki/www/build_board/controller/home_pages/HomePageController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/home_pages/HomePageController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,73 +1,0 @@
-package com.db.finki.www.build_board.controller.home_pages;
-
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.service.BBUserDetailsService;
-import com.db.finki.www.build_board.service.search.SearchService;
-import com.db.finki.www.build_board.service.thread.itfs.TagService;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@Controller
-public class HomePageController {
-    private final SearchService searchService;
-    private final TagService tagService;
-    private final BBUserDetailsService bbUserDetailsService;
-
-    public HomePageController(SearchService searchService, TagService tagService, BBUserDetailsService bbUserDetailsService) {
-        this.searchService = searchService;
-        this.tagService = tagService;
-        this.bbUserDetailsService = bbUserDetailsService;
-    }
-
-    @GetMapping("/")
-    public String search( @RequestParam(required = false)String query, @RequestParam(required = false) List<String> filters,  @RequestParam(required = false) String type , Model model) {
-        if(filters == null || filters.isEmpty()) {
-            filters = new ArrayList<>();
-            filters.add("all");
-        }
-
-        model.addAttribute("threads", searchService.search(query,filters,type));
-
-        System.out.println("TAGS: " + tagService.findAll());
-        model.addAttribute("tags",tagService.findAll());
-        return "home_pages/home";
-    }
-
-    @GetMapping("/about")
-    public String getAboutPage(){
-        return "home_pages/project_description";
-    }
-
-    @GetMapping("/register")
-    public String getRegisterPage(Model model){
-        model.addAttribute("user", new BBUser());
-        model.addAttribute("canEdit",true);
-        return "home_pages/register";
-    }
-
-    @PostMapping("/register")
-    public String registerPost(
-            @RequestParam String username,
-            @RequestParam String email,
-            @RequestParam String name,
-            @RequestParam String password,
-            @RequestParam String description,
-            @RequestParam String sex
-    ) {
-        bbUserDetailsService.createUser(
-                username,
-                email,
-                name,
-                password,
-                description,
-                sex
-        );
-        return "redirect:/login";
-    }
-}
Index: c/main/java/com/db/finki/www/build_board/controller/home_pages/LoginPageController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/home_pages/LoginPageController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,20 +1,0 @@
-package com.db.finki.www.build_board.controller.home_pages;
-
-import jakarta.servlet.http.HttpServletRequest;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-@Controller
-public class LoginPageController {
-    @GetMapping("/login")
-    public String getLoginPage() {
-        return "login";
-    }
-    @PostMapping("/login")
-    public String login(@RequestParam String username, @RequestParam String password, Model model, HttpServletRequest request) {
-        return "redirect:/";
-    }
-}
Index: c/main/java/com/db/finki/www/build_board/controller/home_pages/UserProfileController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/home_pages/UserProfileController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,99 +1,0 @@
-package com.db.finki.www.build_board.controller.home_pages;
-
-import com.db.finki.www.build_board.entity.enums.Status;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.service.BBUserDetailsService;
-import com.db.finki.www.build_board.service.request.ProjectRequestService;
-import com.db.finki.www.build_board.service.util.FileUploadService;
-import jakarta.servlet.http.HttpSession;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.security.core.parameters.P;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-import java.io.IOException;
-
-
-@Controller
-@RequestMapping("{username}")
-public class UserProfileController {
-    private final BBUserDetailsService userService;
-    private final FileUploadService fileUploadService;
-    private final ProjectRequestService projectRequestService;
-
-    public UserProfileController(BBUserDetailsService userService, FileUploadService fileUploadService, ProjectRequestService projectRequestService) {
-        this.userService = userService;
-        this.fileUploadService = fileUploadService;
-        this.projectRequestService = projectRequestService;
-    }
-   
-    @GetMapping("/profile")
-    public String getProfilePage(@PathVariable String username, @SessionAttribute BBUser user, Model model) {
-        try {
-            model.addAttribute("user", userService.loadUserByUsername(username));
-            model.addAttribute("canEdit", user.getUsername().equals(username));
-            return "home_pages/profile";
-        }catch(Exception ignore){
-            return "redirect:/";
-        }
-    }
-
-    @GetMapping("/project-requests")
-    public String getProjectRequestsPage(
-            @PathVariable String username,
-            Model model,
-            @RequestParam(required = false) Status status
-    ) {
-        BBUser forUser = (BBUser) userService.loadUserByUsername(username);
-        model.addAttribute("user", forUser);
-        model.addAttribute("requests", projectRequestService.getByStatusAndUser(status,forUser));
-        model.addAttribute("status", Status.values());
-        return "project_pages/requests/show-user-requests";
-    }
-
-    @PreAuthorize("#requestedByUsername==#username")
-    @PostMapping("/upload-avatar")
-    public String uploadAvatar(Model model,
-                               @PathVariable @P("username") String username,
-                               @RequestParam MultipartFile userImage,
-                               RedirectAttributes redirectAttributes,
-                               @RequestParam(name = "cur_user_username") @P("requestedByUsername") String requestedByUsername
-    ) {
-        BBUser u = (BBUser) userService.loadUserByUsername(username);
-        try{
-            fileUploadService.uploadAvatar(userImage,u.getId());
-            redirectAttributes.addFlashAttribute("message", "Avatar uploaded successfully");
-        } catch (IOException e) {
-            redirectAttributes.addFlashAttribute("message", "Cant upload avatar");
-        }
-
-        return "redirect:/" + username + "/profile";
-    }
-
-    @PreAuthorize("#requestedByUsername==#oldUsername")
-    @PostMapping("/profile/change")
-    public String changeInfo(
-            @RequestParam String email,
-            @RequestParam String name,
-            @RequestParam String description,
-            @PathVariable(name = "username") @P("oldUsername") String oldUsername,
-            @RequestParam(name = "username") String newUsername,
-            @RequestParam(name = "cur_user_username") @P("requestedByUsername") String requestedByUsername,
-            @RequestParam String password,
-            HttpSession session
-    ){
-        BBUser user = userService.changeInfoForUserWithUsername(
-                oldUsername,
-                newUsername,
-                email,
-                name,
-                description,
-                password
-        );
-        session.setAttribute("user", user);
-        return "redirect:/";
-    }
-}
Index: src/main/java/com/db/finki/www/build_board/controller/thread_controller/DiscussionController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/thread_controller/DiscussionController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/thread_controller/DiscussionController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,55 @@
+package com.db.finki.www.build_board.controller.thread_controller;
+
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.service.thread.impl.DiscussionService;
+import com.db.finki.www.build_board.service.thread.impl.TopicServiceImpl;
+import com.db.finki.www.build_board.service.thread.itf.TopicService;
+import jakarta.servlet.http.HttpSession;
+import org.springframework.data.repository.query.Param;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.parameters.P;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.SessionAttribute;
+
+@Controller
+public class DiscussionController {
+    private final DiscussionService discussionService;
+
+    public DiscussionController(DiscussionService discussionService) {
+        this.discussionService = discussionService;
+    }
+
+    @PostMapping("/topics/{topic-name}/discussions/add")
+    public String addReply(
+            @PathVariable(name = "topic-name") String topicName,
+            @RequestParam int parentId, @RequestParam String content, Model model,
+            @SessionAttribute @P("user") BBUser user) {
+        try {
+            discussionService.create(content, parentId, user);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return "redirect:/topics/" + topicName;
+    }
+
+    @PreAuthorize("@discussionService.discussionById(#replyId).user.username==#username")
+    @PostMapping("/topics/{topic-name}/discussions/{replyId}/edit")
+    public String editReply(@PathVariable(name = "topic-name") String topicName, @PathVariable @P("replyId") int replyId, @RequestParam String content, Model model, HttpSession session
+    , @P("username") String username) {
+        discussionService.edit(replyId, content);
+        return "redirect:/topics/" + topicName;
+    }
+
+    @PreAuthorize("@discussionService.discussionById(#discussionId).getUser().getId()==#user.getId()")
+    @PostMapping("/topics/{topic-name}/discussions/{discussionId}/delete")
+    public String deleteDiscussion(@PathVariable(name = "topic-name") String topicName, @PathVariable @P("discussionId") int discussionId, @SessionAttribute @P("user") BBUser user, @RequestParam @Param("username") String username) {
+        discussionService.delete(discussionId);
+        return "redirect:/topics/" + topicName;
+    }
+
+}
Index: src/main/java/com/db/finki/www/build_board/controller/thread_controller/ProjectController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/thread_controller/ProjectController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/thread_controller/ProjectController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,131 @@
+package com.db.finki.www.build_board.controller.thread_controller;
+
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.service.thread.impl.ProjectService;
+import com.db.finki.www.build_board.service.thread.impl.TagServiceImpl;
+import com.db.finki.www.build_board.service.thread.itf.TagService;
+import org.hibernate.Hibernate;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.parameters.P;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+//TODO: confirm pred kick
+
+@Controller
+@RequestMapping("/projects")
+public class ProjectController {
+
+    private final ProjectService projectService;
+    private final TagService tagService;
+
+    public ProjectController(ProjectService projectService, TagServiceImpl topicService) {
+        this.projectService = projectService;
+        this.tagService = topicService;
+    }
+
+    @GetMapping("/{title}")
+    public String getProjectPage(@PathVariable(name = "title") Project project, Model model, RedirectAttributes redirectAttributes) {
+        model.addAttribute("project", project);
+        model.addAttribute("tags", tagService.getAll());
+        String error = (String) redirectAttributes.getAttribute("error");
+        if(error != null){
+            model.addAttribute("error", error);
+        }
+        
+        Hibernate.initialize(project.getTags());
+
+        return "project_pages/show-project";
+    }
+
+    @GetMapping("/create")
+    public String getCreateProjectPage(Model model) {
+        model.addAttribute("project", new Project());
+        model.addAttribute("isCreatingProject", tagService.getAll());
+        return "project_pages/project-create";
+    }
+
+
+    @GetMapping("{title}/topics/add")
+    public String getAddTopicPage(
+            @PathVariable String title,
+            Model model
+    ){
+        model.addAttribute("project_title",title);
+        return "create-topic" ;
+    }
+
+    @GetMapping("/{pr-title}/edit")
+    public String getModifyPage(
+            @PathVariable(name = "pr-title") Project project,
+            Model model
+    ) {
+        model.addAttribute("project", project);
+        return "project_pages/project-create";
+    }
+
+    @GetMapping("/{pr-title}/members")
+    public String getProjectMembersPage(
+            Model model,
+            @PathVariable(name = "pr-title") Project project
+    )
+    {
+        model.addAttribute("project", project);
+        return "project_pages/members";
+    }
+    @PreAuthorize("#project.getUser().equals(#user)")
+    @PostMapping("/{pr-title}/members/kick")
+    public String kickMember(@PathVariable(name = "pr-title") @P("project") Project project,@RequestParam int memberId,@SessionAttribute @P("user") BBUser user){
+        projectService.deleteMember(project, memberId);
+        return "redirect:/projects/" + project.getTitle() + "/members";
+    }
+
+    @PreAuthorize("#project.getUser().getUsername().equals(#username)")
+    @PostMapping("/{title}/edit")
+    public String modifyProject(
+            @PathVariable(name = "title") @P("project") Project project,
+            @RequestParam(name = "title") String newTitle,
+            @RequestParam(name = "repo_url") String repoUrl,
+            @RequestParam @P("username") String username,
+            @RequestParam String description
+    ){
+        return "redirect:/projects/" +  projectService.update(project, repoUrl, description, newTitle).getTitle();
+    }
+
+    @PostMapping("/add")
+    public String createProject(
+            @RequestParam String title,
+            @RequestParam(required = false, name = "repo_url") String repoUrl,
+            @RequestParam(required = false) String description,
+            @SessionAttribute BBUser user
+    ) {
+        projectService.create(title,repoUrl,description,user);
+        return "redirect:/";
+    }
+
+    @PreAuthorize("#project.getUser().getUsername().equals(#username)")
+    @PostMapping("/topics/add")
+    public String addTopic(
+            @RequestParam(name = "project_title") @P("project") Project project,
+            @RequestParam(name = "title") String topicsTitle,
+            @RequestParam String description,
+            @RequestParam @P("username") String username
+    ){
+        projectService.createTopic(project, topicsTitle, description, username);
+        return "redirect:/projects/" + project.getTitle();
+    }
+
+    @PreAuthorize("#project.getUser().username.equals(#username)")
+    @PostMapping("/{title}/delete")
+    public String delete(
+            @PathVariable(name = "title") @P("project") Project project,
+            @RequestParam @P("username") String username
+    ) {
+        projectService.delete(project);
+        return "redirect:/" ;
+    }
+
+}
Index: src/main/java/com/db/finki/www/build_board/controller/thread_controller/TagController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/thread_controller/TagController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/thread_controller/TagController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,74 @@
+package com.db.finki.www.build_board.controller.thread_controller;
+
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.thread.Topic;
+import com.db.finki.www.build_board.service.thread.impl.ProjectService;
+import com.db.finki.www.build_board.service.thread.itf.TagService;
+import com.db.finki.www.build_board.service.thread.itf.TopicService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.parameters.P;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+
+@Controller
+public class TagController {
+    private final TopicService topicService;
+    private final TagService tagService;
+    private final ProjectService projectService;
+
+    public TagController(TopicService topicService, TagService tagService, ProjectService projectService) {
+        this.topicService = topicService;
+        this.tagService = tagService;
+        this.projectService = projectService;
+    }
+
+    @PreAuthorize("@topicServiceImpl.getById(#id).getUser().getUsername().equals(#username)")
+    @PostMapping("/topics/{id}/tags/add")
+    public String addTagToTopic(
+            @PathVariable(name = "id") @P("id") long id,
+            @RequestParam String tagName,
+            @P("username") String username,
+            Model model
+    ) {
+        Topic t = topicService.getById(id);
+        topicService.addTagToTopic(t, tagName);
+        model.addAttribute("topic", t);
+        model.addAttribute("tags", tagService.getAllNotUsed(t));
+        return "redirect:/topics/" + t.getTitle();
+    }
+
+    @PreAuthorize("@topicServiceImpl.getById(#topicId).getUser().getUsername()==#username")
+    @PostMapping("/topics/{topicId}/tags/{tag-name}/delete")
+    public String deleteTagTopic(@PathVariable @P("topicId") long topicId, @PathVariable(name = "tag-name") String tagName, Model model, @RequestParam @P("username") String username) {
+        Topic t = topicService.deleteTagFromTopic(topicId, tagName);
+        model.addAttribute("topic", t);
+        model.addAttribute("tags", tagService.getAllNotUsed(t));
+        return "redirect:/topics/" + t.getTitle();
+    }
+
+    @PreAuthorize("#project.getUser().getUsername()==#username")
+    @PostMapping("/projects/{title}/tags/add")
+    public String addTagToProject(
+            @PathVariable(name = "title") @P("project") Project project,
+            @RequestParam(name = "tagName") String tagName,
+            @RequestParam @P("username") String username
+    ) {
+        projectService.addTag(project, tagName);
+        return "redirect:/projects/" + project.getTitle();
+    }
+
+    @PreAuthorize("#project.getUser().getUsername().equals(#username)")
+    @PostMapping("/projects/{projectTitle}/tags/{tagName}/delete")
+    public String deleteTagProject(
+            @PathVariable(name = "projectTitle") @P("project") Project project,
+            @PathVariable String tagName,
+            @RequestParam @P("username") String username
+    ) {
+        projectService.deleteTag(project, tagName);
+        return "redirect:/projects/" + project.getTitle();
+    }
+}
Index: src/main/java/com/db/finki/www/build_board/controller/thread_controller/TopicController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/thread_controller/TopicController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/thread_controller/TopicController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,69 @@
+package com.db.finki.www.build_board.controller.thread_controller;
+
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.entity.thread.Topic;
+import com.db.finki.www.build_board.service.thread.impl.DiscussionService;
+import com.db.finki.www.build_board.service.thread.itf.TagService;
+import com.db.finki.www.build_board.service.thread.itf.TopicService;
+import jakarta.servlet.http.HttpSession;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.parameters.P;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+//TODO: trgni go toj trigerot da developer sho brishit
+
+@Controller
+@RequestMapping("/topics")
+public class TopicController {
+
+    private final TopicService topicService;
+    private final TagService tagService;
+    private final DiscussionService discussionService;
+
+    public TopicController(TopicService topicService, TagService tagService, DiscussionService discussionService) {
+        this.topicService = topicService;
+        this.tagService = tagService;
+        this.discussionService = discussionService;
+    }
+
+    @GetMapping("/create")
+    public String getCreateTopicPage() {
+        return "create-topic";
+    }
+
+    @GetMapping("/{topic-name}")
+    public String showTopic(@PathVariable(name = "topic-name") String topicName, Model model) {
+        Topic t = topicService.getByTitle(topicName);
+        model.addAttribute("topic", t);
+        model.addAttribute("tags", tagService.getAllNotUsed(t));
+        model.addAttribute("replies", discussionService.getByTopic(t.getId()));
+        return "show-topic";
+    }
+
+    @PostMapping("/add")
+    public String createTopic(@RequestParam String title, @RequestParam String description, HttpSession session) {
+        BBUser user = (BBUser) session.getAttribute("user");
+        topicService.create(title, description, user);
+        return "redirect:/";
+    }
+
+    @PreAuthorize("@topicServiceImpl.getById(#id).getUser().getUsername().equals(#username)")
+    @PostMapping("/{id}/delete")
+    public String deleteTopic(@PathVariable(name = "id") @P("id") long id, HttpSession session, @RequestParam @P("username") String username) {
+        topicService.deleteTopicById(id);
+        return "redirect:/";
+    }
+
+    @PreAuthorize("@topicServiceImpl.getById(#id).getUser().getUsername().equals(#username)")
+    @PostMapping("/{id}/edit")
+    public String editTopic(@PathVariable @P("id") long id, @RequestParam String title, @RequestParam String content, Model model, @RequestParam @P("username")String username) {
+        Topic t = topicService.create(id, title, content);
+        model.addAttribute("topic", t);
+        model.addAttribute("tags", tagService.getAllNotUsed(t));
+        return "redirect:/topics/" + t.getTitle();
+    }
+
+
+}
Index: src/main/java/com/db/finki/www/build_board/controller/thread_controller/request/ProjectRequestController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/thread_controller/request/ProjectRequestController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/thread_controller/request/ProjectRequestController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,74 @@
+package com.db.finki.www.build_board.controller.thread_controller.request;
+
+import com.db.finki.www.build_board.entity.entity_enum.Status;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.service.request.ProjectRequestService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.parameters.P;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.view.RedirectView;
+
+//TODO: filter za najnov request spored user i po mozhnost po user da se searchvit
+//TODO: da se prikazvit date na requestot
+
+@Controller
+@RequestMapping("/projects/{pr-title}/requests")
+public class ProjectRequestController {
+
+    private final ProjectRequestService projectRequestService;
+
+    public ProjectRequestController(ProjectRequestService projectService) {
+        this.projectRequestService = projectService;
+    }
+
+    @GetMapping("")
+    public String getRequestPage(
+            Model model,
+            @PathVariable(name = "pr-title") Project project,
+            @RequestParam(required = false) Status status
+    ) {
+        model.addAttribute("project", project);
+        model.addAttribute("requests", projectRequestService.getByStatusAndProject(status,project));
+        model.addAttribute("status", Status.values());
+        return "project_pages/requests/show-requests";
+    }
+
+    @PostMapping("/{req-id}/accept")
+    @PreAuthorize("#project.getUser().getId()==#user.getId()")
+    public RedirectView acceptRequest(@PathVariable(name = "req-id") Integer reqId,
+                                      @PathVariable(name = "pr-title") @P("project") Project project,
+                                      @RequestParam(name = "feedback-desc") String feedbackDesc,
+                                      @SessionAttribute @P("user") BBUser user
+    ) {
+        projectRequestService.accept(feedbackDesc,user,reqId);
+        return new RedirectView(
+                String.format("/projects/%s/requests", project.getTitle())
+        );
+    }
+
+    @PostMapping("/{req-id}/deny")
+    @PreAuthorize("#project.getUser().getId()==#user.getId()")
+    public RedirectView denyRequest(@PathVariable(name = "req-id") Integer reqId,
+                                    @PathVariable(name = "pr-title") @P("project") Project project,
+                                    @RequestParam(name = "feedback-desc") String feedbackDesc,
+                                    @SessionAttribute @P("user") BBUser user
+    ) {
+        projectRequestService.deny(reqId, feedbackDesc, user);
+        return new RedirectView(
+                String.format("/projects/%s/requests", project.getTitle())
+        );
+    }
+
+    @PostMapping("/create")
+    public RedirectView createRequestToJoin(
+            @PathVariable(name = "pr-title") Project project,
+            @RequestParam(name = "reason-desc") String reason,
+            @SessionAttribute BBUser user
+    ){
+        projectRequestService.createRequestFor(project,reason,user);
+        return new RedirectView("/projects/"+project.getTitle());
+    }
+}
Index: c/main/java/com/db/finki/www/build_board/controller/thread_controllers/DiscussionController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/thread_controllers/DiscussionController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,50 +1,0 @@
-package com.db.finki.www.build_board.controller.thread_controllers;
-
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.service.thread.impl.DiscussionService;
-import jakarta.servlet.http.HttpSession;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-@Controller
-public class DiscussionController {
-    private final DiscussionService discussionService;
-
-    public DiscussionController(DiscussionService discussionService) {
-        this.discussionService = discussionService;
-    }
-
-    @PostMapping("/topic/{topic-name}/reply/add")
-    public String addReply(@PathVariable(name = "topic-name") String topicName, @RequestParam int parentId, @RequestParam String content, Model model, HttpSession session) {
-
-        BBUser user = (BBUser) session.getAttribute("user");
-        try {
-            discussionService.create(content, parentId, user);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        return "redirect:/topic/" + topicName;
-    }
-
-    @PreAuthorize("@discussionService.findDiscussionById(replyId).user.username==username")
-    @PostMapping("/topic/{topic-name}/reply/edit")
-    public String editReply(@PathVariable(name = "topic-name") String topicName, @RequestParam int replyId, @RequestParam String content, Model model, HttpSession session
-    ,String username) {
-        discussionService.edit(replyId, content);
-        return "redirect:/topic/" + topicName;
-    }
-
-    @PreAuthorize("@discussionService.findDiscussionById(threadId).user.username==username")
-    @PostMapping("/topic/{topic-name}/discussion/delete")
-    public String deleteDiscussion(@PathVariable(name = "topic-name") String topicName, @RequestParam int threadId, HttpSession session, @RequestParam String username) {
-        BBUser user = (BBUser) session.getAttribute("user");
-        discussionService.delete(threadId);
-        return "redirect:/topic/" + topicName;
-    }
-
-}
Index: c/main/java/com/db/finki/www/build_board/controller/thread_controllers/ProjectController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/thread_controllers/ProjectController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,130 +1,0 @@
-package com.db.finki.www.build_board.controller.thread_controllers;
-
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.service.thread.impl.ProjectService;
-import com.db.finki.www.build_board.service.thread.impl.TagServiceImpl;
-import com.db.finki.www.build_board.service.thread.itfs.TagService;
-import org.hibernate.Hibernate;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.security.core.parameters.P;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-@Controller
-@RequestMapping("/project")
-public class ProjectController {
-
-    private final ProjectService projectService;
-    private final TagService tagService;
-
-    public ProjectController(ProjectService projectService, TagServiceImpl topicService) {
-        this.projectService = projectService;
-        this.tagService = topicService;
-    }
-
-    @GetMapping("/{title}")
-    public String getProjectPage(@PathVariable(name = "title") Project project, Model model, RedirectAttributes redirectAttributes) {
-        model.addAttribute("project", project);
-        model.addAttribute("tags", tagService.findAll());
-        String error = (String) redirectAttributes.getAttribute("error");
-        if(error != null){
-            model.addAttribute("error", error);
-        }
-        
-        Hibernate.initialize(project.getTags());
-
-        return "project_pages/show-project";
-    }
-
-    @GetMapping("/create")
-    public String getCreateProjectPage(Model model) {
-        model.addAttribute("project", new Project());
-        model.addAttribute("isCreatingProject", tagService.findAll());
-        return "project_pages/project-create";
-    }
-
-
-    @GetMapping("{title}/topic/add")
-    public String getAddTopicPage(
-            @PathVariable String title,
-            Model model
-    ){
-        model.addAttribute("project_title",title);
-        return "create-topic" ;
-    }
-
-    @GetMapping("/{pr_title}/modify")
-    public String getModifyPage(
-            @PathVariable(name = "pr_title") Project project,
-            Model model
-    ) {
-        model.addAttribute("project", project);
-        return "project_pages/project-create";
-    }
-
-    @GetMapping("/{pr_title}/members")
-    public String getProjectMembersPage(
-            Model model,
-            @PathVariable(name = "pr_title") Project project
-    )
-    {
-        model.addAttribute("project", project);
-        return "project_pages/members";
-    }
-    @PreAuthorize("#project.getUser().equals(#user)")
-    @PostMapping("/{pr_title}/members/kick")
-    public String kickMember(@PathVariable(name = "pr_title") @P("project") Project project,@RequestParam int memberId,@SessionAttribute @P("user") BBUser user){
-        projectService.removeMember(project, memberId);
-        return "redirect:/project/" + project.getTitle() + "/members";
-    }
-
-    @PreAuthorize("#project.getUser().getUsername().equals(#username)")
-    @PostMapping("/{title}/modify")
-    public String modifyProject(
-            @PathVariable(name = "title") @P("project") Project project,
-            @RequestParam(name = "title") String newTitle,
-            @RequestParam(name = "repo_url") String repoUrl,
-            @RequestParam @P("username") String username,
-            @RequestParam String description
-    ){
-        return "redirect:/project/" +  projectService.updateProject(project,repoUrl,description,newTitle).getTitle();
-    }
-
-    @PostMapping("/add")
-    public String createProject(
-            @RequestParam String title,
-            @RequestParam(required = false, name = "repo_url") String repoUrl,
-            @RequestParam(required = false) String description,
-            @SessionAttribute BBUser user
-    ) {
-        projectService.create(title,repoUrl,description,user);
-        return "redirect:/";
-    }
-
-    @PreAuthorize("#project.getUser().getUsername().equals(#username)")
-    @PostMapping("/topic/add")
-    public String addTopic(
-            @RequestParam(name = "project_title") @P("project") Project project,
-            @RequestParam(name = "title") String topicsTitle,
-            @RequestParam String description,
-            @RequestParam @P("username") String username
-    ){
-        projectService.addToProjecNewTopic(project,topicsTitle,description,username);
-        return "redirect:/project/" + project.getTitle();
-    }
-
-    @PreAuthorize("#project.getUser().username.equals(#username)")
-    @PostMapping("/delete/*")
-    public String delete(
-            @RequestParam(name = "id") @P("project") Project project,
-            @RequestParam @P("username") String username
-    ) {
-        projectService.delete(project);
-        return "redirect:/" ;
-    }
-
-}
-///projects/topics/add
Index: c/main/java/com/db/finki/www/build_board/controller/thread_controllers/TagController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/thread_controllers/TagController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,75 +1,0 @@
-package com.db.finki.www.build_board.controller.thread_controllers;
-
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.threads.Topic;
-import com.db.finki.www.build_board.service.thread.impl.ProjectService;
-import com.db.finki.www.build_board.service.thread.itfs.TagService;
-import com.db.finki.www.build_board.service.thread.itfs.TopicService;
-import jakarta.servlet.http.HttpSession;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.security.core.parameters.P;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-
-@Controller
-public class TagController {
-    private final TopicService topicService;
-    private final TagService tagService;
-    private final ProjectService projectService;
-
-    public TagController(TopicService topicService, TagService tagService, ProjectService projectService) {
-        this.topicService = topicService;
-        this.tagService = tagService;
-        this.projectService = projectService;
-    }
-
-    @PreAuthorize("@topicServiceImpl.getById(#id).getUser().getUsername().equals(#username)")
-    @PostMapping("/topic/add-tag/{id}")
-    public String addTagToTopic(@PathVariable(name = "id") @P("id") long id,
-                         @RequestParam String tagName,
-                         HttpSession session,
-                         @P("username") String username,
-                         Model model) {
-        Topic t = topicService.getById(id);
-        topicService.addTagToTopic(t, tagName);
-        model.addAttribute("topic", t);
-        model.addAttribute("tags", tagService.findAllNotUsed(t));
-        return "redirect:/topic/" + t.getTitle();
-    }
-
-    @PreAuthorize("@topicServiceImpl.getById(#topicId).getUser().getUsername()==#username")
-    @PostMapping("/topic/delete-tag/{topicId}/{tagName}")
-    public String deleteTagTopic(@PathVariable @P("topicId") long topicId, @PathVariable String tagName, Model model, @RequestParam @P("username") String username) {
-        Topic t = topicService.deleteTagFromTopic(topicId, tagName);
-        model.addAttribute("topic", t);
-        model.addAttribute("tags", tagService.findAllNotUsed(t));
-        return "redirect:/topic/" + t.getTitle();
-    }
-
-    @PreAuthorize("#project.getUser().getUsername()==#username")
-    @PostMapping("/project/{title}/add-tag")
-    public String addTagToProject(
-            @PathVariable(name="title") @P("project") Project project,
-            @RequestParam(name = "tagName") String tagName,
-            @RequestParam @P("username") String username
-    )
-    {
-        projectService.addTagToProject(project,tagName);
-        return "redirect:/project/" + project.getTitle();
-    }
-
-    @PreAuthorize("#project.getUser().getUsername().equals(#username)")
-    @PostMapping("/project/delete-tag/{projectTitle}/{tagName}")
-    public String deleteTagProject(
-            @PathVariable(name = "projectTitle") @P("project") Project project,
-            @PathVariable String tagName,
-            @RequestParam @P("username") String username
-    ){
-        projectService.removeTagFromProject(project,tagName);
-        return "redirect:/project/" + project.getTitle();
-    }
-}
Index: c/main/java/com/db/finki/www/build_board/controller/thread_controllers/TopicController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/thread_controllers/TopicController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,71 +1,0 @@
-package com.db.finki.www.build_board.controller.thread_controllers;
-
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.entity.threads.Topic;
-import com.db.finki.www.build_board.service.thread.impl.DiscussionService;
-import com.db.finki.www.build_board.service.util.ThreadService;
-import com.db.finki.www.build_board.service.thread.itfs.TagService;
-import com.db.finki.www.build_board.service.thread.itfs.TopicService;
-import jakarta.servlet.http.HttpSession;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.security.core.parameters.P;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
-
-
-@Controller
-@RequestMapping("/topic")
-public class TopicController {
-
-    private final TopicService topicService;
-    private final TagService tagService;
-    private final DiscussionService discussionService;
-    private final ThreadService threadService;
-
-    public TopicController(TopicService topicService, TagService tagService, DiscussionService discussionService, ThreadService threadService) {
-        this.topicService = topicService;
-        this.tagService = tagService;
-        this.discussionService = discussionService;
-        this.threadService = threadService;
-    }
-
-    @GetMapping("/create")
-    public String getCreateTopicPage() {
-        return "create-topic";
-    }
-
-    @GetMapping("/{topic-name}")
-    public String showTopic(@PathVariable(name = "topic-name") String topicName, Model model) {
-        Topic t = topicService.getByTitle(topicName);
-        model.addAttribute("topic", t);
-        model.addAttribute("tags", tagService.findAllNotUsed(t));
-        model.addAttribute("replies", discussionService.findByTopic(t.getId()));
-        return "show-topic";
-    }
-
-    @PostMapping("/add")
-    public String createTopic(@RequestParam String title, @RequestParam String description, HttpSession session) {
-        BBUser user = (BBUser) session.getAttribute("user");
-        topicService.create(title, description, user);
-        return "redirect:/";
-    }
-
-    @PreAuthorize("@topicServiceImpl.getById(#id).getUser().getUsername().equals(#username)")
-    @PostMapping("/delete/{id}")
-    public String deleteTopic(@PathVariable(name = "id") @P("id") long id, HttpSession session, @RequestParam @P("username") String username) {
-        topicService.deleteTopicById(id);
-        return "redirect:/";
-    }
-
-    @PreAuthorize("@topicServiceImpl.getById(#id).getUser().getUsername().equals(#username)")
-    @PostMapping("/edit/{id}")
-    public String editTopic(@PathVariable @P("id") long id, @RequestParam String title, @RequestParam String content, Model model, @RequestParam @P("username")String username) {
-        Topic t = topicService.save(id, title, content);
-        model.addAttribute("topic", t);
-        model.addAttribute("tags", tagService.findAllNotUsed(t));
-        return "redirect:/topic/" + t.getTitle();
-    }
-
-
-}
Index: c/main/java/com/db/finki/www/build_board/controller/thread_controllers/requests/ProjectRequestController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/thread_controllers/requests/ProjectRequestController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,71 +1,0 @@
-package com.db.finki.www.build_board.controller.thread_controllers.requests;
-
-import com.db.finki.www.build_board.entity.enums.Status;
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.service.request.ProjectRequestService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.security.core.parameters.P;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.view.RedirectView;
-
-@Controller
-@RequestMapping("/project/{pr-title}/request")
-public class ProjectRequestController {
-
-    private final ProjectRequestService projectRequestService;
-
-    public ProjectRequestController(ProjectRequestService projectService) {
-        this.projectRequestService = projectService;
-    }
-
-    @GetMapping("")
-    public String getRequestPage(
-            Model model,
-            @PathVariable(name = "pr-title") Project project,
-            @RequestParam(required = false) Status status
-    ) {
-        model.addAttribute("project", project);
-        model.addAttribute("requests", projectRequestService.getByStatusAndProject(status,project));
-        model.addAttribute("status", Status.values());
-        return "project_pages/requests/show-requests";
-    }
-
-    @PostMapping("/{req-id}/accept")
-    @PreAuthorize("#project.getUser().getId()==#user.getId()")
-    public RedirectView acceptRequest(@PathVariable(name = "req-id") Integer reqId,
-                                      @PathVariable(name = "pr-title") @P("project") Project project,
-                                      @RequestParam(name = "feedback-desc") String feedbackDesc,
-                                      @SessionAttribute @P("user") BBUser user
-    ) {
-        projectRequestService.accept(feedbackDesc,user,reqId);
-        return new RedirectView(
-                String.format("/project/%s/request", project.getTitle())
-        );
-    }
-
-    @PostMapping("/{req-id}/deny")
-    @PreAuthorize("#project.getUser().getId()==#user.getId()")
-    public RedirectView denyRequest(@PathVariable(name = "req-id") Integer reqId,
-                                    @PathVariable(name = "pr-title") @P("project") Project project,
-                                    @RequestParam(name = "feedback-desc") String feedbackDesc,
-                                    @SessionAttribute @P("user") BBUser user
-    ) {
-        projectRequestService.deny(reqId, feedbackDesc, user);
-        return new RedirectView(
-                String.format("/project/%s/request", project.getTitle())
-        );
-    }
-
-    @PostMapping("/create")
-    public RedirectView createRequestToJoin(
-            @PathVariable(name = "pr-title") Project project,
-            @RequestParam(name = "reason-desc") String reason,
-            @SessionAttribute BBUser user
-    ){
-        projectRequestService.createRequestFor(project,reason,user);
-        return new RedirectView("/project/"+project.getTitle());
-    }
-}
Index: src/main/java/com/db/finki/www/build_board/controller/util/LikesController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/util/LikesController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/util/LikesController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,56 @@
+package com.db.finki.www.build_board.controller.util;
+
+import com.db.finki.www.build_board.entity.thread.BBThread;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.thread.Topic;
+import com.db.finki.www.build_board.entity.thread.discussion_thread.Discussion;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.service.util.ThreadService;
+import jakarta.servlet.http.HttpSession;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.SessionAttribute;
+
+import java.util.function.Function;
+
+@Controller
+public class LikesController {
+    private final ThreadService threadService;
+
+    public LikesController(ThreadService threadService) {
+        this.threadService = threadService;
+    }
+
+    private BBThread rate(int threadId, BBUser user, boolean likes) {
+        return threadService.rate(threadId,user.getId(),likes );
+    }
+
+    private String getUrlForThraed(BBThread thread, String topicName){
+        if(topicName!=null)
+            return "redirect:/topics/" + topicName;
+
+        if(thread instanceof Topic topic){
+            return "redirect:/topics/" + topic.getTitle();
+        }else{
+            return "redirect:/projects/" + ((Project)thread).getTitle();
+        }
+    }
+
+    @PostMapping("/threads/{thread-id}/dislike")
+    public String dislikeThread(@SessionAttribute BBUser user,
+                                @PathVariable(name = "thread-id") int threadId,
+                                @RequestParam(required = false,name = "topic-name") String topicName
+    ) {
+        return getUrlForThraed(rate(threadId,user,false),topicName);
+    }
+
+    @PostMapping("/threads/{thread-id}/like")
+    public String likeThread(@SessionAttribute BBUser user,
+                             @RequestParam(required = false,name = "topic-name") String topicName,
+                             @PathVariable(name = "thread-id") int threadId) {
+        return getUrlForThraed(rate(threadId,user,true),topicName);
+    }
+
+}
Index: src/main/java/com/db/finki/www/build_board/controller/util/SearchController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/util/SearchController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/controller/util/SearchController.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,31 @@
+package com.db.finki.www.build_board.controller.util;
+
+import com.db.finki.www.build_board.service.search.SearchService;
+import com.db.finki.www.build_board.service.thread.itf.TopicService;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Controller
+public class SearchController {
+    private final SearchService searchService;
+
+    public SearchController(SearchService searchService) {
+        this.searchService = searchService;
+    }
+
+    @PostMapping("/search")
+    public String search(@RequestParam String query, @RequestParam(required = false) List<String> filters, @RequestParam String type , Model model, RedirectAttributes redirectAttributes) {
+        if(filters == null || filters.isEmpty()) {
+            filters = new ArrayList<>();
+            filters.add("all");
+        }
+        model.addAttribute("threads", searchService.search(query,filters,type));
+        return "/?";
+    }
+}
Index: c/main/java/com/db/finki/www/build_board/controller/utils/LikesController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/utils/LikesController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,47 +1,0 @@
-package com.db.finki.www.build_board.controller.utils;
-
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.service.util.ThreadService;
-import jakarta.servlet.http.HttpSession;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-@Controller
-public class LikesController {
-    private final ThreadService threadService;
-
-    public LikesController(ThreadService threadService) {
-        this.threadService = threadService;
-    }
-
-    private void rate(int threadId, HttpSession session, boolean likes) {
-        BBUser user = (BBUser) session.getAttribute("user");
-        threadService.rate(threadId,user.getId(),likes );
-    }
-
-    @PostMapping("/topic/{topic-name}/discussion/dislike")
-    public String dislikeTopic(@PathVariable(name = "topic-name") String topicName, @RequestParam int threadId, HttpSession session) {
-        rate(threadId,session,false);
-        return "redirect:/topic/" + topicName;
-    }
-
-    @PostMapping("/topic/{topic-name}/discussion/like")
-    public String likeTopic(@PathVariable(name = "topic-name") String topicName, @RequestParam int threadId, HttpSession session) {
-        rate(threadId, session, true);
-        return "redirect:/topic/" + topicName;
-    }
-
-    @PostMapping("/project/{thread-name}/discussion/like")
-    public String likeProject(@PathVariable(name = "thread-name") String projectName, @RequestParam int threadId, HttpSession session) {
-        rate(threadId,session,true);
-        return "redirect:/project/" + projectName;
-    }
-
-    @PostMapping("/project/{thread-name}/discussion/dislike")
-    public String dislikeProject(@PathVariable(name = "thread-name") String threadName, @RequestParam int threadId, HttpSession session) {
-        rate(threadId,session,false);
-        return "redirect:/project/" + threadName;
-    }
-}
Index: c/main/java/com/db/finki/www/build_board/controller/utils/SearchController.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/controller/utils/SearchController.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,33 +1,0 @@
-package com.db.finki.www.build_board.controller.utils;
-
-import com.db.finki.www.build_board.service.search.SearchService;
-import com.db.finki.www.build_board.service.thread.itfs.TopicService;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@Controller
-public class SearchController {
-    private final TopicService topicService;
-    private final SearchService searchService;
-
-    public SearchController(TopicService topicService, SearchService searchService) {
-        this.topicService = topicService;
-        this.searchService = searchService;
-    }
-
-    @PostMapping("/search")
-    public String search(@RequestParam String query, @RequestParam(required = false) List<String> filters, @RequestParam String type , Model model, RedirectAttributes redirectAttributes) {
-        if(filters == null || filters.isEmpty()) {
-            filters = new ArrayList<>();
-            filters.add("all");
-        }
-        model.addAttribute("threads", searchService.search(query,filters,type));
-        return "/?";
-    }
-}
Index: src/main/java/com/db/finki/www/build_board/converter/ProjectConverter.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/converter/ProjectConverter.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/converter/ProjectConverter.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,30 @@
+package com.db.finki.www.build_board.converter;
+
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.service.thread.impl.ProjectService;
+import lombok.NonNull;
+import org.springframework.core.convert.converter.Converter;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ProjectConverter implements Converter<String, Project> {
+
+    private final ProjectService projectService;
+    private final String REGEX_TO_CHECK_IF_ITS_A_NUMBER="^[0-9]+$";
+
+    public ProjectConverter(ProjectService projectService) {
+        this.projectService = projectService;
+    }
+
+    @Override
+    public Project convert(@NonNull String something) {
+        if(something.matches(REGEX_TO_CHECK_IF_ITS_A_NUMBER)) {
+            Long id = Long.parseLong(something);
+            return projectService.getById(id);
+        }else{
+            String title = something;
+            return projectService.getByTitle(title);
+        }
+    }
+
+}
Index: c/main/java/com/db/finki/www/build_board/converters/ProjectConverter.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/converters/ProjectConverter.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,30 +1,0 @@
-package com.db.finki.www.build_board.converters;
-
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.service.thread.impl.ProjectService;
-import lombok.NonNull;
-import org.springframework.core.convert.converter.Converter;
-import org.springframework.stereotype.Component;
-
-@Component
-public class ProjectConverter implements Converter<String, Project> {
-
-    private final ProjectService projectService;
-    private final String REGEX_TO_CHECK_IF_ITS_A_NUMBER="^[0-9]+$";
-
-    public ProjectConverter(ProjectService projectService) {
-        this.projectService = projectService;
-    }
-
-    @Override
-    public Project convert(@NonNull String something) {
-        if(something.matches(REGEX_TO_CHECK_IF_ITS_A_NUMBER)) {
-            Long id = Long.parseLong(something);
-            return projectService.findById(id);
-        }else{
-            String title = something;
-            return projectService.findByTitle(title);
-        }
-    }
-
-}
Index: src/main/java/com/db/finki/www/build_board/dto/channel/MessageDTO.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/dto/channel/MessageDTO.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/dto/channel/MessageDTO.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,6 +1,4 @@
 package com.db.finki.www.build_board.dto.channel;
 
-import com.db.finki.www.build_board.entity.channels.Message;
-import com.db.finki.www.build_board.mappers.DTO;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
@@ -12,4 +10,6 @@
 @NoArgsConstructor
 @AllArgsConstructor
+@Getter
+@Setter
 public class MessageDTO {
     private String channelName;
@@ -19,51 +19,3 @@
     private Integer projectId;
     private String avatarUrl;
-
-    public void setChannelName(String channelName) {
-        this.channelName = channelName;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-
-    public void setSenderUsername(String senderUsername) {
-        this.senderUsername = senderUsername;
-    }
-
-    public void setSentAt(LocalDateTime sentAt) {
-        this.sentAt = sentAt;
-    }
-
-    public void setProjectId(Integer projectId) {
-        this.projectId = projectId;
-    }
-
-    public void setAvatarUrl(String avatarUrl) {
-        this.avatarUrl = avatarUrl;
-    }
-
-    public String getChannelName() {
-        return channelName;
-    }
-
-    public String getContent() {
-        return content;
-    }
-
-    public String getSenderUsername() {
-        return senderUsername;
-    }
-
-    public LocalDateTime getSentAt() {
-        return sentAt;
-    }
-
-    public Integer getProjectId() {
-        return projectId;
-    }
-
-    public String getAvatarUrl() {
-        return avatarUrl;
-    }
 }
Index: src/main/java/com/db/finki/www/build_board/entity/channel/Channel.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/channel/Channel.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/channel/Channel.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,33 @@
+package com.db.finki.www.build_board.entity.channel;
+
+import com.db.finki.www.build_board.entity.compositeId.ChannelId;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.user_type.Developer;
+import jakarta.persistence.*;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Table(name = "channel")
+@Entity
+@Getter
+@Setter
+@IdClass(ChannelId.class)
+@AllArgsConstructor
+@NoArgsConstructor
+public class Channel {
+
+    @Id
+    private String name;
+    @Id
+    @ManyToOne
+    @JoinColumn(name = "project_id",referencedColumnName = "id",nullable = false)
+    private Project project;
+
+    private String description;
+
+    @ManyToOne
+    @JoinColumn(name = "developer_id",referencedColumnName = "id",nullable = false)
+    private Developer developer;
+}
Index: src/main/java/com/db/finki/www/build_board/entity/channel/Message.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/channel/Message.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/channel/Message.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,38 @@
+package com.db.finki.www.build_board.entity.channel;
+
+import com.db.finki.www.build_board.entity.compositeId.MessageId;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.user_type.Developer;
+import jakarta.persistence.*;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+@Table(name = "messages")
+@Entity
+@Getter
+@Setter
+@NoArgsConstructor
+@IdClass(MessageId.class)
+@AllArgsConstructor
+public class Message {
+    @Id
+    @Column(name = "channel_name")
+    private String name;
+    @Id
+    @ManyToOne
+    @JoinColumn(name = "project_id",referencedColumnName = "id",nullable = false)
+    private Project project;
+    @Id
+    @ManyToOne
+    @JoinColumn(name = "sent_by",referencedColumnName = "id",nullable = false)
+    private Developer sentBy;
+    @Id
+    @Column(name = "sent_at")
+    private LocalDateTime sentAt;
+
+    private String content;
+}
Index: c/main/java/com/db/finki/www/build_board/entity/channels/Channel.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/channels/Channel.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,33 +1,0 @@
-package com.db.finki.www.build_board.entity.channels;
-
-import com.db.finki.www.build_board.entity.compositeId.ChannelId;
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.Developer;
-import jakarta.persistence.*;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-@Table(name = "channel")
-@Entity
-@Getter
-@Setter
-@IdClass(ChannelId.class)
-@AllArgsConstructor
-@NoArgsConstructor
-public class Channel {
-
-    @Id
-    private String name;
-    @Id
-    @ManyToOne
-    @JoinColumn(name = "project_id",referencedColumnName = "id",nullable = false)
-    private Project project;
-
-    private String description;
-
-    @ManyToOne
-    @JoinColumn(name = "developer_id",referencedColumnName = "id",nullable = false)
-    private Developer developer;
-}
Index: c/main/java/com/db/finki/www/build_board/entity/channels/Message.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/channels/Message.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,38 +1,0 @@
-package com.db.finki.www.build_board.entity.channels;
-
-import com.db.finki.www.build_board.entity.compositeId.MessageId;
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.Developer;
-import jakarta.persistence.*;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-import java.time.LocalDateTime;
-
-@Table(name = "messages")
-@Entity
-@Getter
-@Setter
-@NoArgsConstructor
-@IdClass(MessageId.class)
-@AllArgsConstructor
-public class Message {
-    @Id
-    @Column(name = "channel_name")
-    private String name;
-    @Id
-    @ManyToOne
-    @JoinColumn(name = "project_id",referencedColumnName = "id",nullable = false)
-    private Project project;
-    @Id
-    @ManyToOne
-    @JoinColumn(name = "sent_by",referencedColumnName = "id",nullable = false)
-    private Developer sentBy;
-    @Id
-    @Column(name = "sent_at")
-    private LocalDateTime sentAt;
-
-    private String content;
-}
Index: src/main/java/com/db/finki/www/build_board/entity/compositeId/MessageId.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/compositeId/MessageId.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/entity/compositeId/MessageId.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,10 +1,4 @@
 package com.db.finki.www.build_board.entity.compositeId;
 
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.Developer;
-import jakarta.persistence.Column;
-import jakarta.persistence.Id;
-import jakarta.persistence.JoinColumn;
-import jakarta.persistence.ManyToOne;
 import lombok.Getter;
 import lombok.Setter;
Index: src/main/java/com/db/finki/www/build_board/entity/entity_enum/FeedbackFor.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/entity_enum/FeedbackFor.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/entity_enum/FeedbackFor.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,6 @@
+package com.db.finki.www.build_board.entity.entity_enum;
+
+public enum FeedbackFor {
+    R, //report
+    P //project-request
+}
Index: src/main/java/com/db/finki/www/build_board/entity/entity_enum/Status.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/entity_enum/Status.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/entity_enum/Status.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,7 @@
+package com.db.finki.www.build_board.entity.entity_enum;
+
+public enum Status {
+    ACCEPTED,
+    DENIED,
+    PENDING
+}
Index: c/main/java/com/db/finki/www/build_board/entity/enums/FeedbackFor.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/enums/FeedbackFor.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,6 +1,0 @@
-package com.db.finki.www.build_board.entity.enums;
-
-public enum FeedbackFor {
-    R, //report
-    P //project-request
-}
Index: c/main/java/com/db/finki/www/build_board/entity/enums/Status.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/enums/Status.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package com.db.finki.www.build_board.entity.enums;
-
-public enum Status {
-    ACCEPTED,
-    DENIED,
-    PENDING
-}
Index: src/main/java/com/db/finki/www/build_board/entity/request/Feedback.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/request/Feedback.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/request/Feedback.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,38 @@
+package com.db.finki.www.build_board.entity.request;
+
+import com.db.finki.www.build_board.entity.entity_enum.FeedbackFor;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+@Entity
+@Getter
+@Setter
+@NoArgsConstructor
+public class Feedback {
+    @Id
+    @Column(name = "submission_id")
+    Integer id;
+
+    private String description;
+
+    @Enumerated(EnumType.STRING)
+    private FeedbackFor submissionType;
+
+    @ManyToOne
+    @JoinColumn(name = "created_by")
+    private BBUser creator;
+
+    private LocalDateTime createdAt;
+
+    public Feedback(FeedbackFor submissionType, BBUser creator, String description, Integer reqId) {
+        setDescription(description);
+        setSubmissionType(submissionType);
+        setCreator(creator);
+        setId(reqId);
+    }
+}
Index: src/main/java/com/db/finki/www/build_board/entity/request/ProjectRequests.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/request/ProjectRequests.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/request/ProjectRequests.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,48 @@
+package com.db.finki.www.build_board.entity.request;
+
+import com.db.finki.www.build_board.entity.entity_enum.Status;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@Entity
+@Table(name = "project_request")
+public class ProjectRequests {
+    @Id
+    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "project_req_gen")
+    @SequenceGenerator(name = "project_req_gen", sequenceName = "project_request_id_seq", initialValue = 1, allocationSize = 1)
+    private int id;
+    private String description;
+
+    private LocalDateTime createdAt;
+
+    @ManyToOne
+    @JoinColumn(name = "project_id")
+    private Project project;
+
+    @ManyToOne
+    @JoinColumn(name = "user_id")
+    private BBUser creator;
+
+    @Enumerated(EnumType.STRING)
+    private Status status;
+
+    @OneToOne(cascade = { CascadeType.PERSIST })
+    @JoinColumn(name = "submission_id")
+    private Feedback feedback;
+
+    public ProjectRequests(Project project, BBUser creator, String description) {
+        setDescription(description);
+        setCreator(creator);
+        setProject(project);
+        setStatus(Status.PENDING);
+    }
+}
Index: src/main/java/com/db/finki/www/build_board/entity/request/Report.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/request/Report.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/request/Report.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,4 @@
+package com.db.finki.www.build_board.entity.request;
+
+public class Report {
+}
Index: c/main/java/com/db/finki/www/build_board/entity/requests/Feedback.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/requests/Feedback.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,38 +1,0 @@
-package com.db.finki.www.build_board.entity.requests;
-
-import com.db.finki.www.build_board.entity.enums.FeedbackFor;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-import java.time.LocalDateTime;
-
-@Entity
-@Getter
-@Setter
-@NoArgsConstructor
-public class Feedback {
-    @Id
-    @Column(name = "submission_id")
-    Integer id;
-
-    private String description;
-
-    @Enumerated(EnumType.STRING)
-    private FeedbackFor submissionType;
-
-    @ManyToOne
-    @JoinColumn(name = "created_by")
-    private BBUser creator;
-
-    private LocalDateTime createdAt;
-
-    public Feedback(FeedbackFor submissionType, BBUser creator, String description, Integer reqId) {
-        setDescription(description);
-        setSubmissionType(submissionType);
-        setCreator(creator);
-        setId(reqId);
-    }
-}
Index: c/main/java/com/db/finki/www/build_board/entity/requests/ProjectRequests.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/requests/ProjectRequests.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,44 +1,0 @@
-package com.db.finki.www.build_board.entity.requests;
-
-import com.db.finki.www.build_board.entity.enums.Status;
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-@Getter
-@Setter
-@NoArgsConstructor
-@Entity
-@Table(name = "project_request")
-public class ProjectRequests {
-    @Id
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "project_req_gen")
-    @SequenceGenerator(name = "project_req_gen", sequenceName = "project_request_id_seq", initialValue = 1, allocationSize = 1)
-    private int id;
-    private String description;
-
-    @ManyToOne
-    @JoinColumn(name = "project_id")
-    private Project project;
-
-    @ManyToOne
-    @JoinColumn(name = "user_id")
-    private BBUser creator;
-
-    @Enumerated(EnumType.STRING)
-    private Status status;
-
-    @OneToOne(cascade = { CascadeType.PERSIST })
-    @JoinColumn(name = "submission_id")
-    private Feedback feedback;
-
-    public ProjectRequests(Project project, BBUser creator, String description) {
-        setDescription(description);
-        setCreator(creator);
-        setProject(project);
-        setStatus(Status.PENDING);
-    }
-}
Index: c/main/java/com/db/finki/www/build_board/entity/requests/Report.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/requests/Report.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,4 +1,0 @@
-package com.db.finki.www.build_board.entity.requests;
-
-public class Report {
-}
Index: src/main/java/com/db/finki/www/build_board/entity/thread/BBThread.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/thread/BBThread.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/thread/BBThread.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,50 @@
+package com.db.finki.www.build_board.entity.thread;
+
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import jakarta.persistence.*;
+import lombok.*;
+
+import java.time.LocalDateTime;
+import java.util.HashSet;
+import java.util.Set;
+
+@Entity
+@Getter
+@Setter
+@NoArgsConstructor
+@Table(name = "thread")
+@Inheritance(strategy = InheritanceType.JOINED)
+public class BBThread {
+    @Id
+    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "thread_gen")
+    @SequenceGenerator(name = "thread_gen", sequenceName = "thread_id_seq", allocationSize = 1)
+    protected Integer id;
+
+    protected String content;
+
+    @ManyToOne
+    @JoinColumn(name="user_id")
+    protected BBUser user;
+
+    @ManyToMany
+    @JoinTable(
+            name = "tag_threads",
+            joinColumns = @JoinColumn(name = "thread_id"),
+            inverseJoinColumns = @JoinColumn(name = "tag_name")
+    )
+    protected Set<Tag> tags = new HashSet<>();
+
+    @ManyToMany
+    @JoinTable(
+            name = "likes",
+            joinColumns = @JoinColumn(name = "thread_id"),
+            inverseJoinColumns = @JoinColumn(name = "user_id")
+    )
+    protected Set<BBUser> likes = new HashSet<>();
+
+    private LocalDateTime createdAt;
+
+    public int getNumLikes(){
+        return likes.size();
+    }
+}
Index: src/main/java/com/db/finki/www/build_board/entity/thread/Project.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/thread/Project.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/thread/Project.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,58 @@
+package com.db.finki.www.build_board.entity.thread;
+
+import com.db.finki.www.build_board.entity.request.ProjectRequests;
+import com.db.finki.www.build_board.entity.channel.Channel;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.entity.thread.itf.NamedThread;
+import jakarta.persistence.*;
+import lombok.*;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@Entity
+@Table(name = "project_thread")
+public class Project extends BBThread implements NamedThread {
+
+    private String title;
+
+    @Column(name = "repo_url")
+    private String repoUrl;
+
+    public Project(String title, String repoUrl, String description, BBUser user){
+        setTitle(title);
+        setRepoUrl(repoUrl);
+        setDescription(description);
+        setUser(user);
+    }
+
+    @OneToMany(cascade = {CascadeType.PERSIST,CascadeType.MERGE}, mappedBy = "parent")
+    private List<Topic> topics = new ArrayList<>();
+
+    @ManyToMany(cascade = {CascadeType.PERSIST,CascadeType.MERGE})
+    @JoinTable(
+            name ="developer_associated_with_project",
+            joinColumns = @JoinColumn(name = "project_id"),
+            inverseJoinColumns = @JoinColumn(name = "developer_id")
+    )
+    private Set<BBUser> developers = new HashSet<>(); // vaj dis
+
+    @OneToMany(mappedBy = "project")
+    private Set<ProjectRequests> requests = new HashSet<>();
+    @OneToMany(mappedBy = "project")
+    private Set<Channel> channels;
+
+    @Override
+    public String getTypeName() {
+        return "projects";
+    }
+    public String getDescription() {return content;}
+    public void setDescription(String description) {this.content = description;}
+
+}
Index: src/main/java/com/db/finki/www/build_board/entity/thread/Tag.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/thread/Tag.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/thread/Tag.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,46 @@
+package com.db.finki.www.build_board.entity.thread;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.ManyToMany;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@Entity
+@Table(name = "tag")
+public class Tag implements Serializable {
+    @Id
+    String name;
+
+    public Tag(String name) {
+        this.name = name;
+    }
+
+    @JsonIgnore
+    @ManyToMany(mappedBy = "tags")
+    private List<BBThread> threads = new ArrayList<>();
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        Tag tag = (Tag) o;
+        return Objects.equals(name, tag.name);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(name);
+    }
+}
Index: src/main/java/com/db/finki/www/build_board/entity/thread/Topic.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/thread/Topic.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/thread/Topic.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,30 @@
+package com.db.finki.www.build_board.entity.thread;
+
+import com.db.finki.www.build_board.entity.thread.itf.NamedThread;
+import com.db.finki.www.build_board.entity.thread.multi_valued_attribute.Guideline;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import jakarta.persistence.*;
+import lombok.*;
+
+import java.util.List;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@Entity
+@Table(name = "topic_thread")
+public class Topic extends BBThread implements NamedThread {
+
+    private String title;
+
+    @JsonIgnore
+    @OneToMany(mappedBy = "topic")
+    private List<Guideline> guidelines;
+
+    @ManyToOne
+    @JoinColumn(name = "parent_id")
+    private BBThread parent;
+
+    @Override
+    public String getTypeName() {return "topics";}
+}
Index: src/main/java/com/db/finki/www/build_board/entity/thread/discussion_thread/Discussion.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/thread/discussion_thread/Discussion.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/thread/discussion_thread/Discussion.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,16 @@
+package com.db.finki.www.build_board.entity.thread.discussion_thread;
+
+import com.db.finki.www.build_board.entity.thread.BBThread;
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.Setter;
+
+@Entity
+@Table(name = "discussion_thread")
+@Getter
+@Setter
+public class Discussion extends BBThread {
+    @ManyToOne
+    @JoinColumn(name = "parent_id")
+    private BBThread parent;
+}
Index: src/main/java/com/db/finki/www/build_board/entity/thread/discussion_thread/VDiscussion.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/thread/discussion_thread/VDiscussion.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/thread/discussion_thread/VDiscussion.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,44 @@
+package com.db.finki.www.build_board.entity.thread.discussion_thread;
+
+
+import com.db.finki.www.build_board.entity.thread.Topic;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.annotations.Immutable;
+
+import java.time.LocalDateTime;
+
+@Entity
+@Immutable
+@Table(name="v_discussion_thread")
+@Getter
+@Setter
+@NoArgsConstructor
+public class VDiscussion {
+    @Id
+    private Integer id;
+
+    @MapsId
+    @OneToOne
+    @JoinColumn(name="id")
+    private Discussion discussion;
+
+    private int depth;
+
+    @ManyToOne
+    @JoinColumn(name="user_id")
+    private BBUser user;
+
+    public String getAvatarUrl(){
+        return user.getAvatarUrl();
+    }
+
+    @ManyToOne
+    @JoinColumn(name="parent_id")
+    private Topic parentTopic;
+
+    private LocalDateTime createdAt;
+}
Index: src/main/java/com/db/finki/www/build_board/entity/thread/itf/NamedThread.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/thread/itf/NamedThread.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/thread/itf/NamedThread.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,7 @@
+package com.db.finki.www.build_board.entity.thread.itf;
+
+public interface NamedThread {
+    String getTitle();
+    String getTypeName();
+    Integer getId();
+}
Index: src/main/java/com/db/finki/www/build_board/entity/thread/multi_valued_attribute/Guideline.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/thread/multi_valued_attribute/Guideline.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/thread/multi_valued_attribute/Guideline.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,26 @@
+package com.db.finki.www.build_board.entity.thread.multi_valued_attribute;
+
+import com.db.finki.www.build_board.entity.thread.Topic;
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@Entity
+@Table(name = "topic_guidelines")
+public class Guideline {
+    @Id
+    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "guideline_gen")
+    @SequenceGenerator(name = "guideline_gen", sequenceName = "topic_guidelines_id_seq",  allocationSize = 1)
+    private Integer id;
+
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "topic_id")
+    private Topic topic;
+
+    private String description;
+
+}
Index: c/main/java/com/db/finki/www/build_board/entity/threads/BBThread.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/threads/BBThread.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,49 +1,0 @@
-package com.db.finki.www.build_board.entity.threads;
-
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import jakarta.persistence.*;
-import lombok.*;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-@Entity
-@Getter
-@Setter
-@NoArgsConstructor
-@Table(name = "thread")
-@Inheritance(strategy = InheritanceType.JOINED)
-public class BBThread {
-    @Id
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "thread_gen")
-    @SequenceGenerator(name = "thread_gen", sequenceName = "thread_id_seq", allocationSize = 1)
-    protected Integer id;
-
-    protected String content;
-
-    @ManyToOne
-    @JoinColumn(name="user_id")
-    protected BBUser user;
-
-    @ManyToMany
-    @JoinTable(
-            name = "tag_threads",
-            joinColumns = @JoinColumn(name = "thread_id"),
-            inverseJoinColumns = @JoinColumn(name = "tag_name")
-    )
-    protected Set<Tag> tags = new HashSet<>();
-
-    @ManyToMany
-    @JoinTable(
-            name = "likes",
-            joinColumns = @JoinColumn(name = "thread_id"),
-            inverseJoinColumns = @JoinColumn(name = "user_id")
-    )
-    protected Set<BBUser> likes = new HashSet<>();
-
-    public int getNumLikes(){
-        return likes.size();
-    }
-}
Index: c/main/java/com/db/finki/www/build_board/entity/threads/Project.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/threads/Project.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,62 +1,0 @@
-package com.db.finki.www.build_board.entity.threads;
-
-import com.db.finki.www.build_board.entity.requests.ProjectRequests;
-import com.db.finki.www.build_board.entity.channels.Channel;
-import com.db.finki.www.build_board.entity.requests.ProjectRequests;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.entity.threads.interfaces.NamedThread;
-import com.db.finki.www.build_board.entity.user_types.Developer;
-import jakarta.persistence.*;
-import lombok.*;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-//TODO: project request
-//TODO: crud na kanali
-@Getter
-@Setter
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = false)
-@Entity
-@Table(name = "project_thread")
-public class Project extends BBThread implements NamedThread {
-
-    private String title;
-
-    @Column(name = "repo_url")
-    private String repoUrl;
-
-    public Project(String title, String repoUrl, String description, BBUser user){
-        setTitle(title);
-        setRepoUrl(repoUrl);
-        setDescription(description);
-        setUser(user);
-    }
-
-    @OneToMany(cascade = {CascadeType.PERSIST,CascadeType.MERGE}, mappedBy = "parent")
-    private List<Topic> topics = new ArrayList<>();
-
-    @ManyToMany(cascade = {CascadeType.PERSIST,CascadeType.MERGE})
-    @JoinTable(
-            name ="developer_associated_with_project",
-            joinColumns = @JoinColumn(name = "project_id"),
-            inverseJoinColumns = @JoinColumn(name = "developer_id")
-    )
-    private Set<BBUser> developers = new HashSet<>(); // vaj dis
-
-    @OneToMany(mappedBy = "project")
-    private Set<ProjectRequests> requests = new HashSet<>();
-    @OneToMany(mappedBy = "project")
-    private Set<Channel> channels;
-
-    @Override
-    public String getTypeName() {
-        return "project";
-    }
-    public String getDescription() {return content;}
-    public void setDescription(String description) {this.content = description;}
-
-}
Index: c/main/java/com/db/finki/www/build_board/entity/threads/Tag.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/threads/Tag.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,47 +1,0 @@
-package com.db.finki.www.build_board.entity.threads;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.ManyToMany;
-import jakarta.persistence.Table;
-import lombok.Data;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-@Getter
-@Setter
-@NoArgsConstructor
-@Entity
-@Table(name = "tag")
-public class Tag implements Serializable {
-    @Id
-    String name;
-
-    public Tag(String name) {
-        this.name = name;
-    }
-
-    @JsonIgnore
-    @ManyToMany(mappedBy = "tags")
-    private List<BBThread> threads = new ArrayList<>();
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Tag tag = (Tag) o;
-        return Objects.equals(name, tag.name);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hashCode(name);
-    }
-}
Index: c/main/java/com/db/finki/www/build_board/entity/threads/Topic.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/threads/Topic.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,30 +1,0 @@
-package com.db.finki.www.build_board.entity.threads;
-
-import com.db.finki.www.build_board.entity.threads.interfaces.NamedThread;
-import com.db.finki.www.build_board.entity.threads.multi_valued_attributes.Guideline;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import jakarta.persistence.*;
-import lombok.*;
-
-import java.util.List;
-
-@Getter
-@Setter
-@NoArgsConstructor
-@Entity
-@Table(name = "topic_thread")
-public class Topic extends BBThread implements NamedThread {
-
-    private String title;
-
-    @JsonIgnore
-    @OneToMany(mappedBy = "topic")
-    private List<Guideline> guidelines;
-
-    @ManyToOne
-    @JoinColumn(name = "parent_id")
-    private BBThread parent;
-
-    @Override
-    public String getTypeName() {return "topic";}
-}
Index: c/main/java/com/db/finki/www/build_board/entity/threads/discussion_threads/Discussion.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/threads/discussion_threads/Discussion.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,16 +1,0 @@
-package com.db.finki.www.build_board.entity.threads.discussion_threads;
-
-import com.db.finki.www.build_board.entity.threads.BBThread;
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.Setter;
-
-@Entity
-@Table(name = "discussion_thread")
-@Getter
-@Setter
-public class Discussion extends BBThread {
-    @ManyToOne
-    @JoinColumn(name = "parent_id")
-    private BBThread parent;
-}
Index: c/main/java/com/db/finki/www/build_board/entity/threads/discussion_threads/VDiscussion.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/threads/discussion_threads/VDiscussion.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,41 +1,0 @@
-package com.db.finki.www.build_board.entity.threads.discussion_threads;
-
-
-import com.db.finki.www.build_board.entity.threads.Topic;
-import com.db.finki.www.build_board.entity.threads.discussion_threads.Discussion;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import org.hibernate.annotations.Immutable;
-
-@Entity
-@Immutable
-@Table(name="v_discussion_thread")
-@Getter
-@Setter
-@NoArgsConstructor
-public class VDiscussion {
-    @Id
-    private Integer id;
-
-    @MapsId
-    @OneToOne
-    @JoinColumn(name="id")
-    private Discussion discussion;
-
-    private int depth;
-
-    @ManyToOne
-    @JoinColumn(name="user_id")
-    private BBUser user;
-
-    public String getAvatarUrl(){
-        return user.getAvatarUrl();
-    }
-
-    @ManyToOne
-    @JoinColumn(name="parent_id")
-    private Topic parentTopic;
-}
Index: c/main/java/com/db/finki/www/build_board/entity/threads/interfaces/NamedThread.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/threads/interfaces/NamedThread.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package com.db.finki.www.build_board.entity.threads.interfaces;
-
-public interface NamedThread {
-    String getTitle();
-    String getTypeName();
-    Integer getId();
-}
Index: c/main/java/com/db/finki/www/build_board/entity/threads/multi_valued_attributes/Guideline.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/threads/multi_valued_attributes/Guideline.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,26 +1,0 @@
-package com.db.finki.www.build_board.entity.threads.multi_valued_attributes;
-
-import com.db.finki.www.build_board.entity.threads.Topic;
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-@Getter
-@Setter
-@NoArgsConstructor
-@Entity
-@Table(name = "topic_guidelines")
-public class Guideline {
-    @Id
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "guideline_gen")
-    @SequenceGenerator(name = "guideline_gen", sequenceName = "topic_guidelines_id_seq",  allocationSize = 1)
-    private Integer id;
-
-    @ManyToOne(fetch = FetchType.LAZY)
-    @JoinColumn(name = "topic_id")
-    private Topic topic;
-
-    private String description;
-
-}
Index: src/main/java/com/db/finki/www/build_board/entity/user_type/BBUser.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/user_type/BBUser.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/user_type/BBUser.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,101 @@
+package com.db.finki.www.build_board.entity.user_type;
+
+import com.db.finki.www.build_board.entity.thread.BBThread;
+import com.db.finki.www.build_board.service.util.FileUploadService;
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+
+import java.io.File;
+import java.io.Serializable;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.time.LocalDateTime;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+
+@Getter
+@Setter
+@NoArgsConstructor
+@Entity
+@Table(name = "users")
+@Inheritance(strategy = InheritanceType.JOINED)
+public class BBUser implements UserDetails, Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "user_gen")
+    @SequenceGenerator(name = "user_gen", sequenceName = "users_id_seq", allocationSize = 1)
+    private int id;
+
+    private String username;
+    private String password;
+    private String description;
+
+    private String name;
+    private String email;
+
+    @Column(name = "registered_at")
+    private LocalDateTime registeredAt;
+
+    @Column(name = "is_activate")
+    private boolean isEnabled;
+    private String sex;
+
+    @OneToMany(mappedBy = "user")
+    private List<BBThread> threads;
+
+    @Override
+    public boolean isEnabled() {
+        return isEnabled;
+    }
+
+    @Override
+    public Collection<? extends GrantedAuthority> getAuthorities() {
+        return List.of();
+    }
+
+    public String getAvatarUrl() {
+        Path path = Path.of(FileUploadService.USER_AVATAR_DIR + File.separator + "avatar-" + id);
+        return Files.exists(path) ? File.separator + "avatars" + File.separator + "avatar-"+id : File.separator + "default-avatar.jpg";
+    }
+
+
+
+    @Override
+    public boolean equals(Object other){
+        System.out.println("VLEZE EQUALS");
+        if(!(other instanceof BBUser)){
+            return false;
+        }
+        BBUser otherCasted = (BBUser) other;
+        return otherCasted.getId() == this.id;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(id);
+    }
+
+    public BBUser(
+            String username, String email, String name, String password, String description, String sex
+    ){
+        this.username = username;
+        this.email = email;
+        this.name = name;
+        this.password = password;
+        this.description = description;
+        this.sex=sex;
+        this.isEnabled=true;
+    }
+
+    public Collection<GrantedAuthority> getAuthority(){
+        return Collections.singleton(new SimpleGrantedAuthority("ROLE_USER"));
+    }
+}
Index: src/main/java/com/db/finki/www/build_board/entity/user_type/Developer.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/user_type/Developer.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/user_type/Developer.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,24 @@
+package com.db.finki.www.build_board.entity.user_type;
+
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+
+import java.util.Collection;
+import java.util.Collections;
+
+@Entity
+@Table(name = "developer")
+@Getter
+@Setter
+@NoArgsConstructor
+public class Developer extends BBUser{
+    @Override
+    public Collection<GrantedAuthority> getAuthority(){
+        return Collections.singleton(new SimpleGrantedAuthority("ROLE_DEVELOPER"));
+    }
+}
Index: src/main/java/com/db/finki/www/build_board/entity/user_type/Moderator.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/user_type/Moderator.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/user_type/Moderator.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,24 @@
+package com.db.finki.www.build_board.entity.user_type;
+
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+
+import java.util.Collection;
+import java.util.Collections;
+
+@Entity
+@Getter
+@Setter
+@NoArgsConstructor
+@Table(name = "moderator")
+public class Moderator extends BBUser {
+    @Override
+    public Collection<GrantedAuthority> getAuthority(){
+        return Collections.singleton(new SimpleGrantedAuthority("ROLE_MODERATOR"));
+    }
+}
Index: src/main/java/com/db/finki/www/build_board/entity/user_type/ProjectOwner.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/user_type/ProjectOwner.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/entity/user_type/ProjectOwner.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,24 @@
+package com.db.finki.www.build_board.entity.user_type;
+
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+
+import java.util.Collection;
+import java.util.Collections;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@Entity
+@Table(name = "project_manager")
+public class ProjectOwner extends Developer{
+    @Override
+    public Collection<GrantedAuthority> getAuthority(){
+        return Collections.singleton(new SimpleGrantedAuthority("ROLE_PROJECT_OWNER"));
+    }
+}
Index: c/main/java/com/db/finki/www/build_board/entity/user_types/BBUser.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/user_types/BBUser.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,95 +1,0 @@
-package com.db.finki.www.build_board.entity.user_types;
-
-import com.db.finki.www.build_board.entity.threads.BBThread;
-import com.db.finki.www.build_board.service.util.FileUploadService;
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.userdetails.UserDetails;
-
-import java.io.File;
-import java.io.Serializable;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.time.LocalDateTime;
-import java.util.Collection;
-import java.util.List;
-import java.util.Objects;
-
-
-@Getter
-@Setter
-@NoArgsConstructor
-@Entity
-@Table(name = "users")
-@Inheritance(strategy = InheritanceType.JOINED)
-public class BBUser implements UserDetails, Serializable {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "user_gen")
-    @SequenceGenerator(name = "user_gen", sequenceName = "users_id_seq", allocationSize = 1)
-    private int id;
-
-    private String username;
-    private String password;
-    private String description;
-
-    private String name;
-    private String email;
-
-    @Column(name = "registered_at")
-    private LocalDateTime registeredAt;
-
-    @Column(name = "is_activate")
-    private boolean isEnabled;
-    private String sex;
-
-    @OneToMany(mappedBy = "user")
-    private List<BBThread> threads;
-
-    @Override
-    public boolean isEnabled() {
-        return isEnabled;
-    }
-
-    @Override
-    public Collection<? extends GrantedAuthority> getAuthorities() {
-        return List.of();
-    }
-
-    public String getAvatarUrl() {
-        Path path = Path.of(FileUploadService.USER_AVATAR_DIR + File.separator + "avatar-" + id);
-        return Files.exists(path) ? File.separator + "avatars" + File.separator + "avatar-"+id : File.separator + "default-avatar.jpg";
-    }
-
-
-
-    @Override
-    public boolean equals(Object other){
-        System.out.println("VLEZE EQUALS");
-        if(!(other instanceof BBUser)){
-            return false;
-        }
-        BBUser otherCasted = (BBUser) other;
-        return otherCasted.getId() == this.id;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hashCode(id);
-    }
-
-    public BBUser(
-            String username, String email, String name, String password, String description, String sex
-    ){
-        this.username = username;
-        this.email = email;
-        this.name = name;
-        this.password = password;
-        this.description = description;
-        this.sex=sex;
-        this.isEnabled=true;
-    }
-}
Index: c/main/java/com/db/finki/www/build_board/entity/user_types/Developer.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/user_types/Developer.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,16 +1,0 @@
-package com.db.finki.www.build_board.entity.user_types;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.Table;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-@Entity
-@Table(name = "developer")
-@Getter
-@Setter
-@NoArgsConstructor
-public class Developer extends BBUser{
-
-}
Index: c/main/java/com/db/finki/www/build_board/entity/user_types/Moderator.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/user_types/Moderator.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,16 +1,0 @@
-package com.db.finki.www.build_board.entity.user_types;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.Table;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-@Entity
-@Getter
-@Setter
-@NoArgsConstructor
-@Table(name = "moderator")
-public class Moderator extends BBUser {
-
-}
Index: c/main/java/com/db/finki/www/build_board/entity/user_types/ProjectOwner.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/entity/user_types/ProjectOwner.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,16 +1,0 @@
-package com.db.finki.www.build_board.entity.user_types;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.Table;
-import lombok.Data;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-@Getter
-@Setter
-@NoArgsConstructor
-@Entity
-@Table(name = "project_manager")
-public class ProjectOwner extends Developer{
-}
Index: src/main/java/com/db/finki/www/build_board/mapper/Mapper.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/mapper/Mapper.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/mapper/Mapper.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,12 @@
+package com.db.finki.www.build_board.mapper;
+
+import java.util.List;
+
+
+public interface Mapper<T,S> {
+    S toDTO(T entity);
+    List<S> toDTO(List<T> entities);
+
+    T fromDTO(S dto);
+    List<T> fromDTO(List<S> dtos);
+}
Index: src/main/java/com/db/finki/www/build_board/mapper/MessageMapper.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/mapper/MessageMapper.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/mapper/MessageMapper.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,45 @@
+package com.db.finki.www.build_board.mapper;
+
+import com.db.finki.www.build_board.dto.channel.MessageDTO;
+import com.db.finki.www.build_board.entity.channel.Message;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.user_type.Developer;
+import com.db.finki.www.build_board.repository.DeveloperRepository;
+import com.db.finki.www.build_board.service.thread.impl.ProjectService;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class MessageMapper implements Mapper<Message,MessageDTO>{
+
+    private final ProjectService projectService;
+    private final DeveloperRepository developerRepository;
+
+    public MessageMapper(ProjectService projectService, DeveloperRepository developerRepository) {
+        this.projectService = projectService;
+        this.developerRepository = developerRepository;
+    }
+
+    @Override
+    public MessageDTO toDTO(Message message) {
+        return new MessageDTO(message.getName(),message.getContent(),message.getSentBy().getUsername(),message.getSentAt(),message.getProject().getId(),message.getSentBy().getAvatarUrl());
+    }
+
+    @Override
+    public List<MessageDTO> toDTO(List<Message> messages) {
+        return messages.stream().map(this::toDTO).toList();
+    }
+
+    @Override
+    public Message fromDTO(MessageDTO dto) {
+        Developer d =  developerRepository.findByUsername(dto.getSenderUsername());
+        Project p =  projectService.getById((long)dto.getProjectId());
+        return new Message(dto.getChannelName(),p,d,dto.getSentAt(), dto.getContent());
+    }
+
+    @Override
+    public List<Message> fromDTO(List<MessageDTO> dtos) {
+        return dtos.stream().map(this::fromDTO).toList();
+    }
+}
Index: c/main/java/com/db/finki/www/build_board/mappers/DTO.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/mappers/DTO.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,5 +1,0 @@
-package com.db.finki.www.build_board.mappers;
-
-public interface DTO<T> {
-
-}
Index: c/main/java/com/db/finki/www/build_board/mappers/Mapper.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/mappers/Mapper.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,12 +1,0 @@
-package com.db.finki.www.build_board.mappers;
-
-import java.util.List;
-
-
-public interface Mapper<T,S> {
-    S toDTO(T entity);
-    List<S> toDTO(List<T> entities);
-
-    T fromDTO(S dto);
-    List<T> fromDTO(List<S> dtos);
-}
Index: c/main/java/com/db/finki/www/build_board/mappers/MessageMapper.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/mappers/MessageMapper.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,48 +1,0 @@
-package com.db.finki.www.build_board.mappers;
-
-import com.db.finki.www.build_board.dto.channel.MessageDTO;
-import com.db.finki.www.build_board.entity.channels.Message;
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.Developer;
-import com.db.finki.www.build_board.repository.DeveloperRepository;
-import com.db.finki.www.build_board.repository.UserRepository;
-import com.db.finki.www.build_board.repository.thread.ProjectRepository;
-import com.db.finki.www.build_board.service.thread.impl.ProjectService;
-import org.hibernate.Hibernate;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-
-@Component
-public class MessageMapper implements Mapper<Message,MessageDTO>{
-
-    private final ProjectService projectService;
-    private final DeveloperRepository developerRepository;
-
-    public MessageMapper(ProjectService projectService, DeveloperRepository developerRepository) {
-        this.projectService = projectService;
-        this.developerRepository = developerRepository;
-    }
-
-    @Override
-    public MessageDTO toDTO(Message message) {
-        return new MessageDTO(message.getName(),message.getContent(),message.getSentBy().getUsername(),message.getSentAt(),message.getProject().getId(),message.getSentBy().getAvatarUrl());
-    }
-
-    @Override
-    public List<MessageDTO> toDTO(List<Message> messages) {
-        return messages.stream().map(this::toDTO).toList();
-    }
-
-    @Override
-    public Message fromDTO(MessageDTO dto) {
-        Developer d =  developerRepository.findByUsername(dto.getSenderUsername());
-        Project p =  projectService.findById((long)dto.getProjectId());
-        return new Message(dto.getChannelName(),p,d,dto.getSentAt(), dto.getContent());
-    }
-
-    @Override
-    public List<Message> fromDTO(List<MessageDTO> dtos) {
-        return dtos.stream().map(this::fromDTO).toList();
-    }
-}
Index: src/main/java/com/db/finki/www/build_board/repository/DeveloperRepository.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/DeveloperRepository.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/DeveloperRepository.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.repository;
 
-import com.db.finki.www.build_board.entity.user_types.Developer;
+import com.db.finki.www.build_board.entity.user_type.Developer;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
Index: src/main/java/com/db/finki/www/build_board/repository/UserRepository.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/UserRepository.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/UserRepository.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.repository;
 
-import com.db.finki.www.build_board.entity.user_types.BBUser;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
Index: src/main/java/com/db/finki/www/build_board/repository/channel/ChannelRepository.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/channel/ChannelRepository.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/channel/ChannelRepository.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.repository.channel;
 
-import com.db.finki.www.build_board.entity.channels.Channel;
+import com.db.finki.www.build_board.entity.channel.Channel;
 import com.db.finki.www.build_board.entity.compositeId.ChannelId;
 import org.springframework.data.jpa.repository.JpaRepository;
@@ -10,6 +10,6 @@
 @Repository
 public interface ChannelRepository extends JpaRepository<Channel, ChannelId> {
-    List<Channel> findAllByProjectId(Integer projectId);
-    List<Channel> findAllByDeveloperId(Integer developerId);
+    List<Channel> findAllByProjectIdOrderByNameAsc(Integer projectId);
+    List<Channel> findAllByDeveloperIdOrderByNameAsc(Integer developerId);
     Channel findByProjectTitleAndName(String title, String name);
 }
Index: src/main/java/com/db/finki/www/build_board/repository/channel/MessageRepository.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/channel/MessageRepository.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/channel/MessageRepository.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.repository.channel;
 
-import com.db.finki.www.build_board.entity.channels.Message;
+import com.db.finki.www.build_board.entity.channel.Message;
 import com.db.finki.www.build_board.entity.compositeId.MessageId;
 import org.springframework.data.jpa.repository.JpaRepository;
Index: src/main/java/com/db/finki/www/build_board/repository/request/FeedbackRepo.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/request/FeedbackRepo.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/request/FeedbackRepo.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.repository.request;
 
-import com.db.finki.www.build_board.entity.requests.Feedback;
+import com.db.finki.www.build_board.entity.request.Feedback;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
Index: src/main/java/com/db/finki/www/build_board/repository/request/ProjectRequestRepo.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/request/ProjectRequestRepo.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/request/ProjectRequestRepo.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,9 +1,8 @@
 package com.db.finki.www.build_board.repository.request;
 
-import com.db.finki.www.build_board.entity.enums.Status;
-import com.db.finki.www.build_board.entity.requests.ProjectRequests;
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import org.springframework.data.jpa.domain.Specification;
+import com.db.finki.www.build_board.entity.entity_enum.Status;
+import com.db.finki.www.build_board.entity.request.ProjectRequests;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
@@ -13,10 +12,8 @@
 @Repository
 public interface ProjectRequestRepo extends JpaRepository<ProjectRequests,Long> {
-    List<ProjectRequests> findByStatus(Status status);
-    List<ProjectRequests> findByStatusAndCreator(Status status, BBUser forUser);
-    List<ProjectRequests> findByCreator(BBUser forUser);
-
-    List<ProjectRequests> findByProject(Project project);
-
-    List<ProjectRequests> findByStatusAndProject(Status status, Project project);
+    List<ProjectRequests> findByStatusOrderByCreatedAtDesc(Status status);
+    List<ProjectRequests> findByStatusAndCreatorOrderByCreatedAtDesc(Status status, BBUser forUser);
+    List<ProjectRequests> findByCreatorOrderByCreatedAtDesc(BBUser forUser);
+    List<ProjectRequests> findByProjectOrderByCreatedAtDesc(Project project);
+    List<ProjectRequests> findByStatusAndProjectOrderByCreatedAtDesc(Status status, Project project);
 }
Index: src/main/java/com/db/finki/www/build_board/repository/thread/BBThreadRepository.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/thread/BBThreadRepository.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/thread/BBThreadRepository.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.repository.thread;
 
-import com.db.finki.www.build_board.entity.threads.BBThread;
+import com.db.finki.www.build_board.entity.thread.BBThread;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
Index: src/main/java/com/db/finki/www/build_board/repository/thread/DiscussionRepository.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/thread/DiscussionRepository.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/thread/DiscussionRepository.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.repository.thread;
 
-import com.db.finki.www.build_board.entity.threads.discussion_threads.Discussion;
+import com.db.finki.www.build_board.entity.thread.discussion_thread.Discussion;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
@@ -7,5 +7,4 @@
 @Repository
 public interface DiscussionRepository extends JpaRepository<Discussion,Long> {
-
     Discussion findDiscussionById(int discussionId);
 }
Index: src/main/java/com/db/finki/www/build_board/repository/thread/ProjectRepository.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/thread/ProjectRepository.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/thread/ProjectRepository.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.repository.thread;
 
-import com.db.finki.www.build_board.entity.threads.Project;
+import com.db.finki.www.build_board.entity.thread.Project;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
Index: src/main/java/com/db/finki/www/build_board/repository/thread/TagRepository.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/thread/TagRepository.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/thread/TagRepository.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.repository.thread;
 
-import com.db.finki.www.build_board.entity.threads.Tag;
+import com.db.finki.www.build_board.entity.thread.Tag;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
Index: src/main/java/com/db/finki/www/build_board/repository/thread/TopicRepository.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/thread/TopicRepository.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/thread/TopicRepository.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.repository.thread;
 
-import com.db.finki.www.build_board.entity.threads.Topic;
+import com.db.finki.www.build_board.entity.thread.Topic;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
Index: src/main/java/com/db/finki/www/build_board/repository/thread/VDiscussRepo.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/repository/thread/VDiscussRepo.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/repository/thread/VDiscussRepo.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.repository.thread;
 
-import com.db.finki.www.build_board.entity.threads.discussion_threads.VDiscussion;
+import com.db.finki.www.build_board.entity.thread.discussion_thread.VDiscussion;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
@@ -9,5 +9,5 @@
 @Repository
 public interface VDiscussRepo extends JpaRepository<VDiscussion,Long> {
-    List<VDiscussion> findVDiscussionByParentTopicId(Integer topicId);
+    List<VDiscussion> findVDiscussionByParentTopicIdOrderByCreatedAtDesc(Integer topicId);
     VDiscussion findVDiscussionByDiscussionId(Integer discussionId);
 }
Index: src/main/java/com/db/finki/www/build_board/service/AuthenticationSuccessHandlerImpl.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/AuthenticationSuccessHandlerImpl.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/AuthenticationSuccessHandlerImpl.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,5 +1,5 @@
 package com.db.finki.www.build_board.service;
 
-import com.db.finki.www.build_board.entity.user_types.BBUser;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
 import jakarta.servlet.ServletException;
 import jakarta.servlet.http.HttpServletRequest;
Index: src/main/java/com/db/finki/www/build_board/service/BBUserDetailsService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/BBUserDetailsService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/BBUserDetailsService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,10 +1,13 @@
 package com.db.finki.www.build_board.service;
 
-import com.db.finki.www.build_board.entity.user_types.BBUser;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
 import com.db.finki.www.build_board.repository.UserRepository;
+import org.springframework.dao.DataIntegrityViolationException;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.security.core.userdetails.UserDetailsService;
 import org.springframework.security.core.userdetails.UsernameNotFoundException;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.stereotype.Service;
@@ -22,5 +25,7 @@
     @Override
     public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
-        return userRepository.findByUsername(username).orElseThrow(() -> new UsernameNotFoundException("User not found with username: " + username));
+        return userRepository.findByUsername(username)
+                             .orElseThrow(
+                                     () -> new UsernameNotFoundException("User not found with username: " + username));
     }
 
@@ -57,5 +62,10 @@
     }
 
-    public BBUser loadUserById(int id){
+    public Authentication registerUser(String username, String email, String name, String password, String description, String sex) {
+        BBUser user = createUser(username, email, name, password, description, sex);
+        return new UsernamePasswordAuthenticationToken(user,user.getPassword(),user.getAuthorities());
+    }
+
+    public BBUser loadUserById(int id) {
         return userRepository.findById(id);
     }
Index: src/main/java/com/db/finki/www/build_board/service/channel/ChannelService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/channel/ChannelService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/channel/ChannelService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,9 +1,9 @@
 package com.db.finki.www.build_board.service.channel;
 
-import com.db.finki.www.build_board.entity.channels.Channel;
+import com.db.finki.www.build_board.entity.channel.Channel;
 import com.db.finki.www.build_board.entity.compositeId.ChannelId;
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.entity.user_types.Developer;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.entity.user_type.Developer;
 import com.db.finki.www.build_board.repository.DeveloperRepository;
 import com.db.finki.www.build_board.repository.channel.ChannelRepository;
@@ -29,5 +29,5 @@
 
     public List<Channel> getAllChannelsForProject(Project project) {
-        return channelRepository.findAllByProjectId(project.getId());
+        return channelRepository.findAllByProjectIdOrderByNameAsc(project.getId());
     }
 
Index: src/main/java/com/db/finki/www/build_board/service/channel/MessageService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/channel/MessageService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/channel/MessageService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -2,6 +2,6 @@
 
 import com.db.finki.www.build_board.dto.channel.MessageDTO;
-import com.db.finki.www.build_board.entity.channels.Message;
-import com.db.finki.www.build_board.mappers.MessageMapper;
+import com.db.finki.www.build_board.entity.channel.Message;
+import com.db.finki.www.build_board.mapper.MessageMapper;
 import com.db.finki.www.build_board.repository.channel.MessageRepository;
 import org.springframework.stereotype.Service;
@@ -21,5 +21,5 @@
         return messageRepository.findAllByNameAndProjectIdOrderBySentAtAsc(channelName,projectId);
     }
-    public Message saveMessage(MessageDTO messageDTO) {
+    public Message save(MessageDTO messageDTO) {
         Message message = messageMapper.fromDTO(messageDTO);
         return messageRepository.save(message);
Index: src/main/java/com/db/finki/www/build_board/service/request/FeedbackService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/request/FeedbackService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/request/FeedbackService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,7 +1,7 @@
 package com.db.finki.www.build_board.service.request;
 
-import com.db.finki.www.build_board.entity.enums.FeedbackFor;
-import com.db.finki.www.build_board.entity.requests.Feedback;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
+import com.db.finki.www.build_board.entity.entity_enum.FeedbackFor;
+import com.db.finki.www.build_board.entity.request.Feedback;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
 import com.db.finki.www.build_board.repository.request.FeedbackRepo;
 import org.springframework.stereotype.Service;
Index: src/main/java/com/db/finki/www/build_board/service/request/ProjectRequestService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/request/ProjectRequestService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/request/ProjectRequestService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,9 +1,9 @@
 package com.db.finki.www.build_board.service.request;
 
-import com.db.finki.www.build_board.entity.enums.FeedbackFor;
-import com.db.finki.www.build_board.entity.enums.Status;
-import com.db.finki.www.build_board.entity.requests.ProjectRequests;
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
+import com.db.finki.www.build_board.entity.entity_enum.FeedbackFor;
+import com.db.finki.www.build_board.entity.entity_enum.Status;
+import com.db.finki.www.build_board.entity.request.ProjectRequests;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
 import com.db.finki.www.build_board.repository.request.ProjectRequestRepo;
 import org.springframework.stereotype.Service;
@@ -41,14 +41,14 @@
     public List<ProjectRequests> getByStatusAndProject(Status status,Project project) {
         if(status == null){
-            return prReqRepo.findByProject(project);
+            return prReqRepo.findByProjectOrderByCreatedAtDesc(project);
         }
-        return prReqRepo.findByStatusAndProject(status,project);
+        return prReqRepo.findByStatusAndProjectOrderByCreatedAtDesc(status,project);
     }
 
     public List<ProjectRequests> getByStatusAndUser(Status status, BBUser forUser) {
         if(status == null){
-            return prReqRepo.findByCreator(forUser);
+            return prReqRepo.findByCreatorOrderByCreatedAtDesc(forUser);
         }
-        return prReqRepo.findByStatusAndCreator(status,forUser);
+        return prReqRepo.findByStatusAndCreatorOrderByCreatedAtDesc(status,forUser);
     }
 
Index: src/main/java/com/db/finki/www/build_board/service/search/FilterMap.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/search/FilterMap.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/search/FilterMap.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,7 +1,5 @@
 package com.db.finki.www.build_board.service.search;
 
-import com.db.finki.www.build_board.entity.threads.BBThread;
-import com.db.finki.www.build_board.entity.threads.interfaces.NamedThread;
-import org.springframework.context.annotation.Scope;
+import com.db.finki.www.build_board.entity.thread.itf.NamedThread;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Component;
Index: src/main/java/com/db/finki/www/build_board/service/search/SearchFilterConfig.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/search/SearchFilterConfig.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/search/SearchFilterConfig.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,6 +1,6 @@
 package com.db.finki.www.build_board.service.search;
 
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.threads.Topic;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.thread.Topic;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
Index: src/main/java/com/db/finki/www/build_board/service/search/SearchService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/search/SearchService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/search/SearchService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -3,6 +3,5 @@
 //spored title, content, type
 
-import com.db.finki.www.build_board.entity.threads.Topic;
-import com.db.finki.www.build_board.entity.threads.interfaces.NamedThread;
+import com.db.finki.www.build_board.entity.thread.itf.NamedThread;
 
 import java.util.List;
Index: src/main/java/com/db/finki/www/build_board/service/search/SearchServiceImpl.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/search/SearchServiceImpl.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/search/SearchServiceImpl.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,7 +1,7 @@
 package com.db.finki.www.build_board.service.search;
 
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.threads.Topic;
-import com.db.finki.www.build_board.entity.threads.interfaces.NamedThread;
+import com.db.finki.www.build_board.entity.thread.Project;
+import com.db.finki.www.build_board.entity.thread.Topic;
+import com.db.finki.www.build_board.entity.thread.itf.NamedThread;
 import com.db.finki.www.build_board.repository.thread.ProjectRepository;
 import com.db.finki.www.build_board.repository.thread.TopicRepository;
@@ -33,5 +33,4 @@
 
 
-    //todo strictmode so and spec
 
     private List<Topic> searchTopics(String query, List<String> filters) {
Index: src/main/java/com/db/finki/www/build_board/service/thread/impl/DiscussionService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/thread/impl/DiscussionService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/thread/impl/DiscussionService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,8 +1,8 @@
 package com.db.finki.www.build_board.service.thread.impl;
 
-import com.db.finki.www.build_board.entity.threads.BBThread;
-import com.db.finki.www.build_board.entity.threads.discussion_threads.Discussion;
-import com.db.finki.www.build_board.entity.threads.discussion_threads.VDiscussion;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
+import com.db.finki.www.build_board.entity.thread.BBThread;
+import com.db.finki.www.build_board.entity.thread.discussion_thread.Discussion;
+import com.db.finki.www.build_board.entity.thread.discussion_thread.VDiscussion;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
 import com.db.finki.www.build_board.repository.thread.BBThreadRepository;
 import com.db.finki.www.build_board.repository.thread.DiscussionRepository;
@@ -24,16 +24,16 @@
     }
 
-    public List<VDiscussion> findByTopic(int topicId){
-        return vDiscussRepo.findVDiscussionByParentTopicId(topicId);
+    public List<VDiscussion> getByTopic(int topicId){
+        return vDiscussRepo.findVDiscussionByParentTopicIdOrderByCreatedAtDesc(topicId);
     }
 
-    public VDiscussion findVDiscussionById(int discussionId){
+    public VDiscussion getVDiscussionById(int discussionId){
         return vDiscussRepo.findVDiscussionByDiscussionId(discussionId);
     }
-    public Discussion findDiscussionById(int discussionId){
+    public Discussion getDiscussionById(int discussionId){
         return discussionRepository.findDiscussionById(discussionId);
     }
 
-    public List<VDiscussion> findAll(){
+    public List<VDiscussion> getAll(){
         return vDiscussRepo.findAll();
     }
Index: src/main/java/com/db/finki/www/build_board/service/thread/impl/ProjectService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/thread/impl/ProjectService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/thread/impl/ProjectService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -3,13 +3,12 @@
 import java.util.List;
 
-import com.db.finki.www.build_board.entity.threads.Tag;
-import com.db.finki.www.build_board.entity.threads.Topic;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.entity.threads.Project;
-import com.db.finki.www.build_board.entity.user_types.Developer;
+import com.db.finki.www.build_board.entity.thread.Tag;
+import com.db.finki.www.build_board.entity.thread.Topic;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.entity.thread.Project;
 import com.db.finki.www.build_board.repository.thread.ProjectRepository;
 import com.db.finki.www.build_board.service.BBUserDetailsService;
-import com.db.finki.www.build_board.service.thread.itfs.TagService;
-import com.db.finki.www.build_board.service.thread.itfs.TopicService;
+import com.db.finki.www.build_board.service.thread.itf.TagService;
+import com.db.finki.www.build_board.service.thread.itf.TopicService;
 import jakarta.transaction.Transactional;
 import org.springframework.stereotype.Service;
@@ -39,9 +38,9 @@
     }
 
-    public Project findByTitle(String title) {
+    public Project getByTitle(String title) {
         return projectRepository.findByTitleStartingWith(title);
     }
 
-    public void addToProjecNewTopic(Project project, String title, String description, String username) {
+    public void createTopic(Project project, String title, String description, String username) {
         BBUser user = ((BBUser) userDetailsService.loadUserByUsername(username));
         Topic topic = topicService.create(title, description, user);
@@ -52,5 +51,5 @@
 
     @Transactional
-    public void removeMember(Project project, int memberId) {
+    public void deleteMember(Project project, int memberId) {
         BBUser user = userDetailsService.loadUserById(memberId);
         boolean removed = project.getDevelopers().remove(user);
@@ -58,8 +57,8 @@
     }
 
-    public void addTagToProject(Project project, String tagName) {
+    public void addTag(Project project, String tagName) {
         Tag tag = null ;
         try{
-            tag=tagService.findByName(tagName);
+            tag=tagService.getByName(tagName);
         }catch (IllegalArgumentException ignore){
              tag=tagService.create(tagName);
@@ -69,5 +68,5 @@
     }
 
-    public Project updateProject(Project project, String repoUrl, String description, String newTitle) {
+    public Project update(Project project, String repoUrl, String description, String newTitle) {
         project.setRepoUrl(repoUrl);
         project.setDescription(description);
@@ -76,5 +75,5 @@
     }
 
-    public Project findById(Long id) {
+    public Project getById(Long id) {
         return projectRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("Project not found"));
     }
@@ -84,6 +83,6 @@
     }
 
-    public void removeTagFromProject(Project project, String tagName) {
-        project.getTags().remove(tagService.findByName(tagName));
+    public void deleteTag(Project project, String tagName) {
+        project.getTags().remove(tagService.getByName(tagName));
         projectRepository.save(project);
     }
Index: src/main/java/com/db/finki/www/build_board/service/thread/impl/TagServiceImpl.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/thread/impl/TagServiceImpl.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/thread/impl/TagServiceImpl.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,8 +1,8 @@
 package com.db.finki.www.build_board.service.thread.impl;
 
-import com.db.finki.www.build_board.entity.threads.Tag;
-import com.db.finki.www.build_board.entity.threads.Topic;
+import com.db.finki.www.build_board.entity.thread.Tag;
+import com.db.finki.www.build_board.entity.thread.Topic;
 import com.db.finki.www.build_board.repository.thread.TagRepository;
-import com.db.finki.www.build_board.service.thread.itfs.TagService;
+import com.db.finki.www.build_board.service.thread.itf.TagService;
 import org.springframework.stereotype.Service;
 
@@ -18,10 +18,10 @@
 
     @Override
-    public Tag findByName(String name) {
+    public Tag getByName(String name) {
         return tagRepository.findByName(name).orElseThrow(() -> new IllegalArgumentException("Tag not found"));
     }
 
     @Override
-    public List<Tag> findAll() {
+    public List<Tag> getAll() {
         return tagRepository.findAll();
     }
@@ -32,5 +32,5 @@
 
     @Override
-    public List<Tag> findAllNotUsed(Topic t) {
+    public List<Tag> getAllNotUsed(Topic t) {
         return tagRepository.findAll().stream().filter(tag -> !t.getTags().contains(tag)).toList();
     }
Index: src/main/java/com/db/finki/www/build_board/service/thread/impl/TopicServiceImpl.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/thread/impl/TopicServiceImpl.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/thread/impl/TopicServiceImpl.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,10 +1,10 @@
 package com.db.finki.www.build_board.service.thread.impl;
 
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.entity.threads.Tag;
-import com.db.finki.www.build_board.entity.threads.Topic;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.entity.thread.Tag;
+import com.db.finki.www.build_board.entity.thread.Topic;
 import com.db.finki.www.build_board.repository.thread.TagRepository;
 import com.db.finki.www.build_board.repository.thread.TopicRepository;
-import com.db.finki.www.build_board.service.thread.itfs.TopicService;
+import com.db.finki.www.build_board.service.thread.itf.TopicService;
 import jakarta.transaction.Transactional;
 import org.springframework.stereotype.Service;
@@ -75,5 +75,5 @@
 
     @Override
-    public Topic save(long id, String title, String description) {
+    public Topic create(long id, String title, String description) {
         Topic t = getById(id);
         t.setTitle(title);
Index: src/main/java/com/db/finki/www/build_board/service/thread/itf/TagService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/thread/itf/TagService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/service/thread/itf/TagService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,13 @@
+package com.db.finki.www.build_board.service.thread.itf;
+
+import com.db.finki.www.build_board.entity.thread.Tag;
+import com.db.finki.www.build_board.entity.thread.Topic;
+
+import java.util.List;
+
+public interface TagService {
+    Tag getByName(String name);
+    List<Tag> getAll();
+    List<Tag> getAllNotUsed(Topic t);
+    Tag create(String name);
+}
Index: src/main/java/com/db/finki/www/build_board/service/thread/itf/TopicService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/thread/itf/TopicService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/java/com/db/finki/www/build_board/service/thread/itf/TopicService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,17 @@
+package com.db.finki.www.build_board.service.thread.itf;
+
+import com.db.finki.www.build_board.entity.user_type.BBUser;
+import com.db.finki.www.build_board.entity.thread.Topic;
+
+import java.util.List;
+public interface TopicService {
+    Topic create(String title, String description, BBUser user);
+    List<Topic> getAll();
+    Topic getByTitle(String title);
+    void deleteTopicById(Long id);
+    void deleteTopicByTitle(String title);
+    Topic getById(Long id);
+    void addTagToTopic(Topic topic, String tagName);
+    Topic create(long id, String title, String description);
+    Topic deleteTagFromTopic(long id, String tagName);
+}
Index: c/main/java/com/db/finki/www/build_board/service/thread/itfs/TagService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/thread/itfs/TagService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,13 +1,0 @@
-package com.db.finki.www.build_board.service.thread.itfs;
-
-import com.db.finki.www.build_board.entity.threads.Tag;
-import com.db.finki.www.build_board.entity.threads.Topic;
-
-import java.util.List;
-
-public interface TagService {
-    Tag findByName(String name);
-    List<Tag> findAll();
-    List<Tag> findAllNotUsed(Topic t);
-    Tag create(String name);
-}
Index: c/main/java/com/db/finki/www/build_board/service/thread/itfs/TopicService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/thread/itfs/TopicService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,17 +1,0 @@
-package com.db.finki.www.build_board.service.thread.itfs;
-
-import com.db.finki.www.build_board.entity.user_types.BBUser;
-import com.db.finki.www.build_board.entity.threads.Topic;
-
-import java.util.List;
-public interface TopicService {
-    Topic create(String title, String description, BBUser user);
-    List<Topic> getAll();
-    Topic getByTitle(String title);
-    void deleteTopicById(Long id);
-    void deleteTopicByTitle(String title);
-    Topic getById(Long id);
-    void addTagToTopic(Topic topic, String tagName);
-    Topic save(long id, String title, String description);
-    Topic deleteTagFromTopic(long id, String tagName);
-}
Index: src/main/java/com/db/finki/www/build_board/service/util/NamedThreadService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/util/NamedThreadService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/util/NamedThreadService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,8 +1,8 @@
 package com.db.finki.www.build_board.service.util;
 
-import com.db.finki.www.build_board.entity.threads.interfaces.NamedThread;
+import com.db.finki.www.build_board.entity.thread.itf.NamedThread;
 import com.db.finki.www.build_board.service.thread.impl.ProjectService;
 import com.db.finki.www.build_board.service.thread.impl.TopicServiceImpl;
-import com.db.finki.www.build_board.service.thread.itfs.TopicService;
+import com.db.finki.www.build_board.service.thread.itf.TopicService;
 import org.springframework.stereotype.Service;
 
@@ -19,5 +19,5 @@
     }
 
-    public List<NamedThread> findAll(){
+    public List<NamedThread> getAll(){
         List<NamedThread> results = (List<NamedThread>) (List<?>) topicService.getAll();
         results.addAll((List<NamedThread>)(List<?>) projectService.getAll());
Index: src/main/java/com/db/finki/www/build_board/service/util/ThreadService.java
===================================================================
--- src/main/java/com/db/finki/www/build_board/service/util/ThreadService.java	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/java/com/db/finki/www/build_board/service/util/ThreadService.java	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,6 +1,6 @@
 package com.db.finki.www.build_board.service.util;
 
-import com.db.finki.www.build_board.entity.threads.BBThread;
-import com.db.finki.www.build_board.entity.user_types.BBUser;
+import com.db.finki.www.build_board.entity.thread.BBThread;
+import com.db.finki.www.build_board.entity.user_type.BBUser;
 import com.db.finki.www.build_board.repository.UserRepository;
 import com.db.finki.www.build_board.repository.thread.BBThreadRepository;
@@ -19,5 +19,5 @@
     }
 
-    public void rate(int threadId, int userId,boolean like){
+    public BBThread rate(int threadId, int userId,boolean like){
         BBThread thread = bbThreadRepository.findById(threadId);
         BBUser user = userRepository.findById(userId);
@@ -31,5 +31,5 @@
             thread.getLikes().remove(user);
         }
-        bbThreadRepository.save(thread);
+        return bbThreadRepository.save(thread);
     }
 }
Index: src/main/resources/db/migration/V1__init_ddl.sql
===================================================================
--- src/main/resources/db/migration/V1__init_ddl.sql	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/resources/db/migration/V1__init_ddl.sql	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -71,5 +71,6 @@
     id      SERIAL PRIMARY KEY,
     content TEXT,
-    user_id INT REFERENCES users (id) NOT NULL
+    user_id INT REFERENCES users (id) NOT NULL,
+    created_at timestamp DEFAULT NOW()
 );
 CREATE TABLE topic_thread
@@ -295,5 +296,5 @@
             from depth_table
             group by id)
-select d.id as id, t.user_id as user_id, d.depth as depth, d1.parent_id as parent_id
+select d.id as id, t.user_id as user_id, d.depth as depth, d1.parent_id as parent_id, t.created_at as "created_at"
 from tmp d
          join depth_table d1
@@ -470,4 +471,23 @@
     $$;
 
+create or replace function fn_insert_general_for_project()
+    returns trigger
+    language plpgsql
+as $$
+DECLARE
+    developer_id INT;
+BEGIN
+    select user_id
+    into developer_id
+    from thread t
+    where t.id=NEW.id;
+
+    insert into channel(name,description,project_id,developer_id)
+    values ('General','General',NEW.id,developer_id);
+
+    return new;
+end;
+$$;
+
 -------------------------- TRIGGERS ----------------------
 CREATE OR REPLACE TRIGGER tr_check_topic_name
@@ -521,2 +541,8 @@
     execute function fn_add_dev_if_not_exist();
 
+create or replace trigger tr_insert_general_for_project
+    after insert on project_thread
+    for each row
+execute function fn_insert_general_for_project();
+
+
Index: src/main/resources/db/migration/V2__add_test_data.sql
===================================================================
--- src/main/resources/db/migration/V2__add_test_data.sql	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/resources/db/migration/V2__add_test_data.sql	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -102,10 +102,9 @@
 INSERT INTO channel (name, description, project_id, developer_id)
 VALUES
-    ('General', 'General discussion channel', 5, 3),
     ('Updates', 'Project updates channel', 5, 3);
 
 INSERT INTO messages (sent_at, content, sent_by, project_id, channel_name)
 VALUES
-    (NOW(), 'Hello, team!', 2, 5, 'General'),
+    (NOW(), 'Hello, team!', 3, 5, 'General'),
     (NOW(), 'We need to push the deadline.', 3, 5, 'Updates');
 
Index: src/main/resources/templates/channels/show-channel.html
===================================================================
--- src/main/resources/templates/channels/show-channel.html	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
+++ src/main/resources/templates/channels/show-channel.html	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -0,0 +1,205 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Channel</title>
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
+    <link href="/css/icon.css" rel="stylesheet">
+    <link href="/css/chat.css" rel="stylesheet">
+</head>
+<body>
+
+<div th:replace="~{/home_pages/home ::navigation}"></div>
+
+<main class="d-flex justify-content-between align-items-start vh-90 mt-5">
+
+    <div class="d-flex gap-1 flex-grow-1 h-100">
+        <!-- Channel List -->
+        <div class="channel-list border border-outline">
+            <h5 th:text="${channel.getProject().getTitle()}"></h5>
+            <hr>
+            <h6>Channels</h6>
+            <div th:each="channel : ${channel.getProject().getChannels()}" class="channel-item">
+                <a th:href="@{/projects/{projectName}/channels/{channelName} (projectName=${channel.getProject().getTitle()}, channelName=${channel.getName()})}"
+                   th:text="${channel.getName()}"
+                   class="nav-link"
+                >Channel Name</a>
+            </div>
+        </div>
+
+        <div class="container chat-container">
+            <!-- Header -->
+            <div class="chat-header">
+                <h3 class="mb-0" th:text="${channel.getName()}">Channel Name</h3>
+            </div>
+
+            <!-- Main Content (Messages Section) -->
+            <div id="messages-container" class="chat-messages">
+                <div class="message-bubble incoming" th:each="message : ${messages}">
+                    <div id="user-info">
+                        <img th:src="${message.getAvatarUrl()}" class="rounded-circle icon-small icon-small"
+                             alt="user-logo">
+                    </div>
+                    <div id="message-info" class="message-info">
+                        <small class="text-secondary fst-italic">
+                            <span th:text="${message.getSenderUsername()}">Username</span>
+                            <span th:text="${#temporals.format(message.getSentAt(), 'dd/MM/yyyy &bull; HH:mm')}">&nbsp;datum • vreme</span>
+                        </small>
+                        <p th:text="${message.getContent()}" class="lead text-break">Message Content</p>
+                    </div>
+
+                </div>
+                <!--                Tuka pocvat messages-->
+            </div>
+
+            <!-- Input Section -->
+            <div class="input-container">
+                <textarea id="chat-message" class="form-control h-fit-content" name="chatMessage"
+                          placeholder="Type your message..."></textarea>
+                <button id="send-message-button" class="btn btn-primary">Send</button>
+            </div>
+        </div>
+
+    </div>
+
+    <!-- User List -->
+    <div class="user-list me-3 border border-outline shadow">
+        <h5 style="text-align: center">Users</h5>
+        <hr>
+        <div th:each="developer : ${channel.getProject().getDevelopers()}" class="user-item">
+            <img th:src="${developer.getAvatarUrl()}" class="rounded-circle icon-small" alt="user-logo"
+                 style="width: 3rem;height: 3rem;">
+            <a class="text-break nav-link"
+               th:href="@{/{username}/profile(username=${developer.getUsername()})}"
+               th:text="${developer.getUsername()}"></a>
+        </div>
+    </div>
+</main>
+
+<div id="th-data" style="display: none"
+     th:data-project-id="${channel.getProject().getId()}"
+     th:data-channel-name="${channel.getName()}"
+     th:data-username="${session.user.getUsername()}"
+     th:data-project-name="${channel.getProject().getTitle()}"
+     th:data-avatar-url="${session.user.getAvatarUrl()}"
+>
+</div>
+
+
+<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
+<!--
+    JSPM Generator Import Map
+    Edit URL: https://generator.jspm.io/#U2NgYGBkDM0rySzJSU1hcCguyc8t0AeTWcUO5noGega6SakliaYAYTzJAykA
+  -->
+<script type="importmap">
+    {
+      "imports": {
+        "@stomp/stompjs": "https://ga.jspm.io/npm:@stomp/stompjs@7.0.0/esm6/index.js"
+      }
+    }
+</script>
+
+<!-- ES Module Shims: Import maps polyfill for modules browsers without import maps support (all except Chrome 89+) -->
+<script
+        async
+        src="https://ga.jspm.io/npm:es-module-shims@1.5.1/dist/es-module-shims.js"
+        crossorigin="anonymous"
+></script>
+
+<script type="module">
+    import {Client} from '@stomp/stompjs';
+
+    let projectId = document.getElementById("th-data").getAttribute("data-project-id")
+    let channelName = document.getElementById("th-data").getAttribute("data-channel-name")
+    let username = document.getElementById("th-data").getAttribute("data-username")
+    let projectName = document.getElementById("th-data").getAttribute("data-project-name")
+    let avatarUrl = document.getElementById("th-data").getAttribute("data-avatar-url")
+
+    const messageJson = {
+        channelName: channelName,
+        content: "",
+        senderUsername: username,
+        sentAt: "",
+        projectId: projectId,
+        avatarUrl: avatarUrl
+    };
+
+    let cont = document.getElementById("messages-container");
+    cont.scrollTop = cont.scrollHeight;
+
+
+    const createChatMessage = (messageDto) => {
+
+        messageDto = JSON.parse(messageDto)
+
+        console.log("MESSAGE DTO CELO VO CRETEA: " + Object.keys(messageDto).map(key => `${key} : ` + messageDto[key]))
+
+
+        console.log("vleze create")
+        const newMessageDiv = document.createElement("div");
+        let sentAt = new Date(); // Current date and time
+        let formattedDate = `${String(sentAt.getDate()).padStart(2, '0')}/${String(sentAt.getMonth() + 1).padStart(2, '0')}/${sentAt.getFullYear()} • ${String(sentAt.getHours()).padStart(2, '0')}:${String(sentAt.getMinutes()).padStart(2, '0')}`;
+
+        console.log("avatar: " + messageDto.avatarUrl)
+
+        newMessageDiv.innerHTML =
+            `
+
+                    <div id="user-info">
+                        <img src="${messageDto.avatarUrl}" class="rounded-circle icon-small icon-small"
+                             alt="user-logo">
+                    </div>
+                    <div id="message-info" class="message-info">
+                        <small class="text-secondary fst-italic">
+                            <span>${messageDto.senderUsername}</span>
+                            <span>${formattedDate}</span>
+                        </small>
+                        <p class="lead text-break">${messageDto.content}</p>
+                    </div>
+
+
+        `
+
+        newMessageDiv.classList.add("message-bubble", "incoming");
+
+        cont.append(newMessageDiv);
+        newMessageDiv.scrollTo()
+    }
+
+    const client = new Client({
+        brokerURL: 'ws://localhost:8080/channel-websocket',
+        onConnect: () => {
+            client.subscribe(`/projects/${projectName}/channels/${channelName}`, message => {
+                    createChatMessage(message.body)
+                    console.log("MESSAGE RECIEVED: " + Object.keys(JSON.parse(message.body)));
+                    document.getElementById("chat-message").value = '';
+                    cont.scrollTop = cont.scrollHeight;
+                }
+            );
+        },
+    });
+    client.activate();
+
+
+    let sendButton = document.getElementById("send-message-button");
+
+    sendButton.addEventListener("click", () => {
+        messageJson.content = document.getElementById("chat-message").value;
+        client.publish({
+            destination: `/projects/${projectName}/channels/${channelName}`,
+            body: JSON.stringify(messageJson)
+        });
+    })
+
+    document.getElementById("chat-message").addEventListener("keydown", (event) => {
+        if(event.key === 'Enter' && !event.shiftKey){
+            event.preventDefault();
+            sendButton.click();
+        }
+    })
+
+
+</script>
+</body>
+</html>
Index: c/main/resources/templates/channels/view-channel.html
===================================================================
--- src/main/resources/templates/channels/view-channel.html	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ 	(revision )
@@ -1,204 +1,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Channel</title>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
-    <link href="/css/icon.css" rel="stylesheet">
-    <link href="/css/chat.css" rel="stylesheet">
-</head>
-<body>
-
-<div th:replace="~{/home_pages/home ::navigation}"></div>
-
-<main class="d-flex justify-content-between align-items-start vh-90 mt-5">
-
-    <div class="d-flex gap-1 flex-grow-1 h-100">
-        <!-- Channel List -->
-        <div class="channel-list border border-outline">
-            <h5 th:text="${channel.getProject().getTitle()}"></h5>
-            <hr>
-            <h6>Channels</h6>
-            <div th:each="channel : ${channel.getProject().getChannels()}" class="channel-item">
-                <a th:href="@{/project/{projectName}/channels/{channelName} (projectName=${channel.getProject().getTitle()}, channelName=${channel.getName()})}"
-                   th:text="${channel.getName()}"
-                   class="nav-link"
-                >Channel Name</a>
-            </div>
-        </div>
-
-        <div class="container chat-container">
-            <!-- Header -->
-            <div class="chat-header">
-                <h3 class="mb-0" th:text="${channel.getName()}">Channel Name</h3>
-            </div>
-
-            <!-- Main Content (Messages Section) -->
-            <div id="messages-container" class="chat-messages">
-                <div class="message-bubble incoming" th:each="message : ${messages}">
-                    <div id="user-info">
-                        <img th:src="${message.getAvatarUrl()}" class="rounded-circle icon-small icon-small"
-                             alt="user-logo">
-                    </div>
-                    <div id="message-info" class="message-info">
-                        <small class="text-secondary fst-italic">
-                            <span th:text="${message.getSenderUsername()}">Username</span>
-                            <span th:text="${#temporals.format(message.getSentAt(), 'dd/MM/yyyy &bull; HH:mm')}">&nbsp;datum • vreme</span>
-                        </small>
-                        <p th:text="${message.getContent()}" class="lead text-break">Message Content</p>
-                    </div>
-
-                </div>
-                <!--                Tuka pocvat messages-->
-            </div>
-
-            <!-- Input Section -->
-            <div class="input-container">
-                <textarea id="chat-message" class="form-control h-fit-content" name="chatMessage"
-                          placeholder="Type your message..."></textarea>
-                <button id="send-message-button" class="btn btn-primary">Send</button>
-            </div>
-        </div>
-
-    </div>
-
-    <!-- User List -->
-    <div class="user-list me-3 border border-outline shadow">
-        <h5 style="text-align: center">Users</h5>
-        <hr>
-        <div th:each="developer : ${channel.getProject().getDevelopers()}" class="user-item">
-            <img th:src="${developer.getAvatarUrl()}" class="rounded-circle icon-small" alt="user-logo"
-                 style="width: 3rem;height: 3rem;">
-            <span class="text-break" th:text="${developer.getUsername()}"></span>
-        </div>
-    </div>
-</main>
-
-<div id="th-data" style="display: none"
-     th:data-project-id="${channel.getProject().getId()}"
-     th:data-channel-name="${channel.getName()}"
-     th:data-username="${session.user.getUsername()}"
-     th:data-project-name="${channel.getProject().getTitle()}"
-     th:data-avatar-url="${session.user.getAvatarUrl()}"
->
-</div>
-
-
-<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
-<!--
-    JSPM Generator Import Map
-    Edit URL: https://generator.jspm.io/#U2NgYGBkDM0rySzJSU1hcCguyc8t0AeTWcUO5noGega6SakliaYAYTzJAykA
-  -->
-<script type="importmap">
-    {
-      "imports": {
-        "@stomp/stompjs": "https://ga.jspm.io/npm:@stomp/stompjs@7.0.0/esm6/index.js"
-      }
-    }
-</script>
-
-<!-- ES Module Shims: Import maps polyfill for modules browsers without import maps support (all except Chrome 89+) -->
-<script
-        async
-        src="https://ga.jspm.io/npm:es-module-shims@1.5.1/dist/es-module-shims.js"
-        crossorigin="anonymous"
-></script>
-
-<script type="module">
-    import {Client} from '@stomp/stompjs';
-
-    let projectId = document.getElementById("th-data").getAttribute("data-project-id")
-    let channelName = document.getElementById("th-data").getAttribute("data-channel-name")
-    let username = document.getElementById("th-data").getAttribute("data-username")
-    let projectName = document.getElementById("th-data").getAttribute("data-project-name")
-    let avatarUrl = document.getElementById("th-data").getAttribute("data-avatar-url")
-
-    const messageJson = {
-        channelName: channelName,
-        content: "",
-        senderUsername: username,
-        sentAt: "",
-        projectId: projectId,
-        avatarUrl: avatarUrl
-    };
-
-    let cont = document.getElementById("messages-container");
-    cont.scrollTop = cont.scrollHeight;
-
-
-    const createChatMessage = (messageDto) => {
-
-        messageDto = JSON.parse(messageDto)
-
-        console.log("MESSAGE DTO CELO VO CRETEA: " + Object.keys(messageDto).map(key => `${key} : ` + messageDto[key]))
-
-
-        console.log("vleze create")
-        const newMessageDiv = document.createElement("div");
-        let sentAt = new Date(); // Current date and time
-        let formattedDate = `${String(sentAt.getDate()).padStart(2, '0')}/${String(sentAt.getMonth() + 1).padStart(2, '0')}/${sentAt.getFullYear()} • ${String(sentAt.getHours()).padStart(2, '0')}:${String(sentAt.getMinutes()).padStart(2, '0')}`;
-
-        console.log("avatar: " + messageDto.avatarUrl)
-
-        newMessageDiv.innerHTML =
-            `
-
-                    <div id="user-info">
-                        <img src="${messageDto.avatarUrl}" class="rounded-circle icon-small icon-small"
-                             alt="user-logo">
-                    </div>
-                    <div id="message-info" class="message-info">
-                        <small class="text-secondary fst-italic">
-                            <span>${messageDto.senderUsername}</span>
-                            <span>${formattedDate}</span>
-                        </small>
-                        <p class="lead text-break">${messageDto.content}</p>
-                    </div>
-
-
-        `
-
-        newMessageDiv.classList.add("message-bubble", "incoming");
-
-        cont.append(newMessageDiv);
-
-    }
-
-    const client = new Client({
-        brokerURL: 'ws://localhost:8080/channel-websocket',
-        onConnect: () => {
-            client.subscribe(`/project/${projectName}/channels/${channelName}`, message => {
-                    createChatMessage(message.body)
-                    console.log("MESSAGE RECIEVED: " + Object.keys(JSON.parse(message.body)));
-                    document.getElementById("chat-message").value = '';
-                    cont.scrollTop = cont.scrollHeight;
-                }
-            );
-        },
-    });
-    client.activate();
-
-
-    let sendButton = document.getElementById("send-message-button");
-
-    sendButton.addEventListener("click", () => {
-        messageJson.content = document.getElementById("chat-message").value;
-        client.publish({
-            destination: `/project/${projectName}/channels/${channelName}`,
-            body: JSON.stringify(messageJson)
-        });
-    })
-
-    document.getElementById("chat-message").addEventListener("keydown", (event) => {
-        if(event.key === 'Enter' && !event.shiftKey){
-            event.preventDefault();
-            sendButton.click();
-        }
-
-    })
-
-
-</script>
-</body>
-</html>
Index: src/main/resources/templates/create-topic.html
===================================================================
--- src/main/resources/templates/create-topic.html	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/resources/templates/create-topic.html	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -9,5 +9,5 @@
 <body>
 <div th:replace="/home_pages/home :: navigation"></div>
-<main th:with="prefix=${project_title==null ? '' : '/project'}" class="container mt-5">
+<main th:with="prefix=${project_title==null ? '' : '/projects'}" class="container mt-5">
   <div class="card shadow-sm">
     <div class="card-header bg-primary text-white">
@@ -15,5 +15,5 @@
     </div>
     <div class="card-body">
-      <form th:action="@{{prfx}/topic/add(prfx=${prefix})}" method="post">
+      <form th:action="@{{prfx}/topics/add(prfx=${prefix})}" method="post">
         <div class="mb-3">
           <label for="title" class="form-label">Title</label>
Index: src/main/resources/templates/home_pages/home.html
===================================================================
--- src/main/resources/templates/home_pages/home.html	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/resources/templates/home_pages/home.html	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -148,6 +148,6 @@
         <h1 class="h4">Threads</h1>
         <div th:if="${session.user!=null}">
-            <a href="/topic/create" class="btn btn-success btn-sm">Create Topic</a>
-            <a href="project/create" class="btn btn-success btn-sm">Create Project</a>
+            <a href="/topics/create" class="btn btn-success btn-sm">Create Topic</a>
+            <a href="projects/create" class="btn btn-success btn-sm">Create Project</a>
         </div>
     </div>
Index: src/main/resources/templates/home_pages/profile.html
===================================================================
--- src/main/resources/templates/home_pages/profile.html	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/resources/templates/home_pages/profile.html	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -1,3 +1,2 @@
-<!--TODO: make updates avaialbe i change password da mozish-->
 <!DOCTYPE html>
 <html lang="en">
Index: src/main/resources/templates/home_pages/project_description.html
===================================================================
--- src/main/resources/templates/home_pages/project_description.html	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/resources/templates/home_pages/project_description.html	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -57,5 +57,4 @@
             <li>
                 <span>Stefan Toskovski</span>
-                <!--            TODO: klaj si go mailot tuka -->
                 <a href="mailto:stefantoska84@gmail.com">stefantoska84@gmail.com</a>
             </li>
Index: src/main/resources/templates/home_pages/register.html
===================================================================
--- src/main/resources/templates/home_pages/register.html	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/resources/templates/home_pages/register.html	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -57,4 +57,13 @@
     </div>
 </div>
+<footer
+        th:if="${duplicatedUsername != null}"
+        class="w-100 d-flex justify-content-center">
+    <div class="bg-danger w-80 mt-5 rounded p-2 ">
+        <p
+                th:text="|The username ${duplicatedUsername?: ''}  already exists|"
+                class="text-center text-body mb-0"></p>
+    </div>
+</footer>
 </body>
 <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
Index: src/main/resources/templates/project_pages/project-create.html
===================================================================
--- src/main/resources/templates/project_pages/project-create.html	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/resources/templates/project_pages/project-create.html	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -18,5 +18,5 @@
         </div>
         <div class="card-body">
-            <form th:action="${isCreatingProject==null} ? '/project/' + ${project.getTitle()} + '/modify' : '/project/add'" method="post">
+            <form th:action="${isCreatingProject==null} ? '/projects/' + ${project.getTitle()} + '/edit' : '/projects/create'" method="post">
                 <div class="mb-3">
                     <label for="title" class="form-label">Title</label>
Index: src/main/resources/templates/project_pages/show-project.html
===================================================================
--- src/main/resources/templates/project_pages/show-project.html	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/resources/templates/project_pages/show-project.html	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -21,13 +21,13 @@
                     </button>
                     <a class="text-decoration-none text-reset p-2 border-success border rounded bg-success"
-                       th:href="@{/project/{pr_title}/topic/add(pr_title=${project.getTitle()})}">Add Topic</a>
+                       th:href="@{/projects/{pr_title}/topics/add(pr_title=${project.getTitle()})}">Add Topic</a>
                     <a class="text-decoration-none text-reset p-2 border-success border rounded bg-secondary"
-                       th:href="@{/project/{pr_title}/modify(pr_title=${project.getTitle()})}">Modify project</a>
+                       th:href="@{/projects/{pr_title}/edit(pr_title=${project.getTitle()})}">Modify project</a>
                     <a class="text-decoration-none text-reset p-2 border border-success rounded bg-success"
-                       th:href="@{/project/{pr_title}/request(pr_title=${project.getTitle()})}">View project
+                       th:href="@{/projects/{pr_title}/requests(pr_title=${project.getTitle()})}">View project
                         requests</a>
                 </div>
                 <a class="text-decoration-none text-reset p-2 border border-success rounded bg-secondary"
-                   th:href="@{/project/{pr_title}/members(pr_title=${project.getTitle()})}">Show members</a>
+                   th:href="@{/projects/{pr_title}/members(pr_title=${project.getTitle()})}">Show members</a>
                 <button th:if="${session.user != null && !project.getUser().equals(session.user)
                  && !project.getDevelopers().contains(session.user)}"
@@ -58,5 +58,5 @@
                         <span th:text="${tag.getName()}">Tag Name</span>
                         <form th:if="${session.user!=null && session.user.equals(project.getUser())}"
-                              th:action="@{/project/delete-tag/{projectTitle}/{tagName} (projectTitle=${project.getTitle()}, tagName=${tag.getName()})}"
+                              th:action="@{/projects/{projectTitle}/tags/{tagName}/delete (projectTitle=${project.getTitle()}, tagName=${tag.getName()})}"
                               method="post" style="margin-left: 5px;">
                             <button type="submit" class="btn btn-sm btn-link text-danger p-0 ms-1"
@@ -77,5 +77,5 @@
                             <div class="d-flex">
                                 <h5 class="mb-1">
-                                    <a th:href="@{/topic/{name} (name=${topic.getTitle()})}"
+                                    <a th:href="@{/topics/{name} (name=${topic.getTitle()})}"
                                        th:text="${topic.getTitle()}" class="text-decoration-none"></a>
                                 </h5>
@@ -92,8 +92,8 @@
                     <div class="list-group w-75">
                         <div class="list-group-item w-100" th:each="channel : ${project.getChannels()}">
-                            <form method="post" th:action="@{/project/{projectName}/channels/{channelName}/delete (projectName=${project.getTitle()},channelName=${channel.getName()})}">
+                            <form method="post" th:action="@{/projects/{projectName}/channels/{channelName}/delete (projectName=${project.getTitle()},channelName=${channel.getName()})}">
                                 <div class="d-flex justify-content-between">
                                     <h5 class="mb-1">
-                                        <a th:href="@{/project/{projectName}/channels/{name} (name=${channel.getName()},projectName=${project.getTitle()})}"
+                                        <a th:href="@{/projects/{projectName}/channels/{name} (name=${channel.getName()},projectName=${project.getTitle()})}"
                                            th:text="${channel.getName()}" class="text-decoration-none"></a>
                                     </h5>
@@ -114,5 +114,5 @@
             <div class="d-flex justify-content-between align-items-center mt-3 pt-3">
                 <div class="d-flex flex-row">
-                    <form th:action="'/project/' + ${project.getTitle()} + '/discussion/like'" method="post">
+                    <form th:action="'/threads/' + ${project.getId()} + '/like'" method="post">
                         <input type="hidden" name="threadId" th:value="${project.getId()}">
                         <button th:if="${session.user!=null}"
@@ -122,5 +122,5 @@
                         </button>
                     </form>
-                    <form th:action="'/project/' + ${project.getTitle()} + '/discussion/dislike'" method="post">
+                    <form th:action="'/threads/' + ${project.getId()} + '/dislike'" method="post">
                         <input type="hidden" name="threadId" th:value="${project.getId()}">
                         <button th:if="${session.user!=null}"
@@ -134,7 +134,6 @@
         </div>
         <div th:if="${isManager}" class="card-footer d-flex justify-content-between">
-            <form th:action="@{/project/delete/{title} (title=${project.getTitle()})}" method="post"
+            <form th:action="@{/projects/{title}/delete (title=${project.getTitle()})}" method="post"
                   style="display:inline;">
-                <input type="hidden" name="id" th:value="${project.getId()}"/>
                 <button type="submit" class="btn btn-danger btn-sm">Delete Project</button>
                 <input th:if="${session.user!=null}" type="hidden" name="username"
@@ -185,5 +184,5 @@
             </div>
             <div class="modal-body">
-                <form th:action="@{/project/{title}/add-tag(title=${project.getTitle()})}" method="post"
+                <form th:action="@{/projects/{title}/tags/add(title=${project.getTitle()})}" method="post"
                       id="addTagForm">
                     <div class="mb-3">
@@ -219,5 +218,5 @@
             </div>
             <div class="modal-body">
-                <form th:action="@{/project/{title}/channels/add(title=${project.getTitle()})}" method="post"
+                <form th:action="@{/projects/{title}/channels/add(title=${project.getTitle()})}" method="post"
                       id="addChannelForm">
 
Index: src/main/resources/templates/show-topic.html
===================================================================
--- src/main/resources/templates/show-topic.html	(revision 7af74d60c7603ba27bade2a00ff1beb106a69abd)
+++ src/main/resources/templates/show-topic.html	(revision 98f0402e41165e9d4aea94605119c3527f99933c)
@@ -9,4 +9,10 @@
     <style>
         .edit-reply-btn {
+            font-size: 12px;
+            padding: 2px 8px;
+            height: auto;
+            line-height: 1.2;
+        }
+        .edit-delete-btn {
             font-size: 12px;
             padding: 2px 8px;
@@ -41,5 +47,5 @@
                 <span th:text="${tag.getName()}">Tag Name</span>
                 <form th:if="${session.user!=null && session.user.equals(topic.getUser())}"
-                      th:action="@{/topic/delete-tag/{topicId}/{tagName} (topicId=${topic.getId()}, tagName=${tag.getName()})}"
+                      th:action="@{/topics/{topicId}/tags/{tag-name}/delete (topicId=${topic.getId()}, tag-name=${tag.getName()})}"
                       method="post" style="margin-left: 5px;">
                     <button type="submit" class="btn btn-sm btn-link text-danger p-0 ms-1" style="line-height: 1;">
@@ -59,5 +65,5 @@
                 </div>
                 <div th:attr="data-reply-id=${topic.getId()}" class="card-body d-none reply-body">
-                    <form th:action="'/topic/' + ${topic.getTitle()} + '/reply/add'" method="post">
+                    <form th:action="@{/topics/{topic-name}/discussions/add(topic-name=${topic.getTitle()})}" method="post">
                         <div class="mb-3">
                             <label for="reply" class="form-label">Your Reply</label>
@@ -81,5 +87,5 @@
             <div class="d-flex justify-content-between align-items-center mt-3 pt-3">
                 <div class="d-flex flex-row">
-                    <form th:action="'/topic/' + ${topic.getTitle()} + '/discussion/like'" method="post">
+                    <form th:action="@{/threads/{thread-id}/like(thread-id=${topic.getId()})}" method="post">
                         <input type="hidden" name="threadId" th:value="${topic.getId()}">
                         <button th:if="${session.user!=null}"
@@ -89,5 +95,5 @@
                         </button>
                     </form>
-                    <form th:action="'/topic/' + ${topic.getTitle()} + '/discussion/dislike'" method="post">
+                    <form th:action="@{/threads/{thread-id}/dislike(thread-id=${topic.getId()})}" method="post">
                         <input type="hidden" name="threadId" th:value="${topic.getId()}">
                         <button th:if="${session.user!=null}"
@@ -109,5 +115,5 @@
                     Topic
                 </button>
-                <form th:action="@{/topic/delete/{id} (id=${topic.getId()})}" method="post" style="display:inline;">
+                <form th:action="@{/topics/{id}/delete (id=${topic.getId()})}" method="post" style="display:inline;">
                     <input type="hidden" name="id" th:value="${topic.getId()}"/>
                     <button type="submit" class="btn btn-danger btn-sm">Delete Topic</button>
@@ -147,10 +153,11 @@
 
                 <div>
-                    <form th:action="'/topic/' + ${topic.getTitle()} + '/discussion/delete'" method="post">
+                    <form th:action="@{/topics/{topic-name}/discussions/{discussionId}/delete(topic-name=${topic.getTitle()
+                    },discussionId=${reply.getId()})}" method="post">
                         <input type="hidden" name="threadId" th:value="${reply.getDiscussion().getId()}" class="w-0">
-                        <button class="btn btn-danger btn-sm edit-reply-btn ms-2"
+                        <button class="btn btn-danger btn-sm edit-delete-btn ms-2"
                                 th:attr="data-reply-id=${reply.getDiscussion().getId()}">Delete
                         </button>
-                        <input th:if="${session.user!=null}" type="hidden" name="username"
+                        <input th:if="${secssion.user!=null}" type="hidden" name="username"
                                th:value="${session.user.username}"/>
                     </form>
@@ -165,5 +172,5 @@
             </div>
             <div class="d-none edit-reply" th:attr="data-reply-id=${reply.getDiscussion().getId()}">
-                <form th:action="'/topic/' + ${topic.getTitle()} + '/reply/edit'" method="post">
+                <form th:action="@{/topics/{topic-name}/discussions/{replyId}/edit(topic-name=${topic.getTitle()},replyId=${reply.getId()})}" method="post">
                     <input type="hidden" name="replyId" th:value="${reply.getDiscussion().getId()}">
                     <textarea name="content" th:text="${reply.getDiscussion().getContent()}" class="form-control"
@@ -183,6 +190,6 @@
             <div class="d-flex justify-content-between align-items-center mt-3 pt-3">
                 <div class="d-flex flex-row">
-                    <form th:action="'/topic/' + ${topic.getTitle()} + '/discussion/like'" method="post">
-                        <input type="hidden" name="threadId" th:value="${reply.getId()}">
+                    <form th:action="@{/threads/{thread-id}/like(thread-id=${reply.getId()})}" method="post">
+                        <input name="topic-name" type="hidden" th:value="${topic.getTitle()}">
                         <button th:if="${session.user!=null}"
                                 type="submit" class="btn btn-outline-success btn-sm me-2 like-button"
@@ -191,6 +198,6 @@
                         </button>
                     </form>
-                    <form th:action="'/topic/' + ${topic.getTitle()} + '/discussion/dislike'" method="post">
-                        <input type="hidden" name="threadId" th:value="${reply.getId()}">
+                    <form th:action="@{/threads/{thread-id}/dislike(thread-id=${reply.getId()})}" method="post">
+                        <input type="hidden" name="topic-name" th:value="${topic.getTitle()}">
                         <button th:if="${session.user!=null}"
                                 class="btn btn-outline-danger btn-sm dislike-button"
@@ -212,5 +219,5 @@
         <!-- Add Reply Card Hidden -->
         <div th:attr="data-reply-id=${reply.getDiscussion().getId()}" class="card-body d-none reply-body">
-            <form th:action="'/topic/' + ${topic.getTitle()} + '/reply/add'" method="post">
+            <form th:action="@{/topics/{topic-name}/discussions/add(topic-name=${topic.getTitle()})}" method="post">
                 <div class="mb-3">
                     <label for="reply" class="form-label">Your Reply</label>
@@ -244,5 +251,5 @@
             </div>
             <div class="modal-body">
-                <form th:action="@{/topic/add-tag/{id} (id=${topic.getId()})}" method="post" id="addTagForm">
+                <form th:action="@{/topics/{id}/tags/add (id=${topic.getId()})}" method="post" id="addTagForm">
                     <div class="mb-3">
                         <label for="tagName" class="form-label">Tag Name</label>
@@ -275,5 +282,5 @@
             </div>
             <div class="modal-body">
-                <form th:action="@{/topic/edit/{id} (id=${topic.getId()})}" method="post">
+                <form th:action="@{/topics/{id}/edit (id=${topic.getId()})}" method="post">
                     <div class="mb-3">
                         <label for="topicTitle" class="form-label">Title</label>
@@ -333,25 +340,4 @@
     });
 
-
-    //todo-func
-
-    //ova funckcija rabotat gore ja koristam vidi gore vo html
-    function hideEditReplyBox(id) {
-        console.log("HIDE EDIT REPLY")
-        const editBox = document.querySelector(`.edit-reply[data-reply-id="${id}"]`)
-        const contentBox = document.querySelector(`.reply-content[data-reply-id="${id}"]`)
-        editClasses(editBox, 'd-block', 'd-none')
-        editClasses(contentBox, 'd-none', 'd-block')
-        // editBox.classList.remove("d-block");
-        // editBox.classList.add("d-none");
-        // contentBox.classList.remove("d-none")
-        // contentBox.classList.add("d-block");
-    }
-
-
-    function displayAddReplyBox() {
-
-    }
-
     function editClasses(element, rmCls, addCls) {
         if (rmCls !== '') {
@@ -362,6 +348,5 @@
     }
 
-
-    // podeli go ova so ifojte vo funkcii
+    //TODO: ko ke se klavat karta za discussion trebat da se klajt na krajot ne na pochetokot
 
     document.querySelector("main").addEventListener("click", ev => {
@@ -372,7 +357,4 @@
             editClasses(dialog, 'd-none', 'd-block')
             editClasses(target, '', 'd-none')
-            // dialog.classList.remove("d-none")
-            // dialog.classList.add("d-block")
-            // target.classList.add('d-none');
         } else if (target.classList.contains("reply-cancel")) {
             const id = target.dataset.replyId
@@ -380,9 +362,5 @@
             const replyBtn = document.querySelector(`.reply-button[data-reply-id="${id}"]`)
             editClasses(dialog, 'd-block', 'd-none')
-            // dialog.classList.add("d-none")
-            // dialog.classList.remove("d-block")
             editClasses(replyBtn, 'd-none', 'd-block')
-            // replyBtn.classList.remove('d-none');
-            // replyBtn.classList.add('d-block');
         } else if (target.classList.contains("edit-reply-btn")) {
             const id = target.dataset.replyId;
@@ -390,6 +368,4 @@
             const contentBox = document.querySelector(`.reply-content[data-reply-id="${id}"]`)
             editClasses(editBox, 'd-none', 'd-block')
-            // editBox.classList.remove("d-none");
-            // editBox.classList.add("d-block");
             contentBox.classList.add("d-none")
         }
