Index: springapp/src/main/java/mk/profesori/springapp/Controller/PublicController.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Controller/PublicController.java	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
+++ springapp/src/main/java/mk/profesori/springapp/Controller/PublicController.java	(revision 62b653fbfa2f2521de0bbd3bc445083c3cf5f032)
@@ -23,5 +23,5 @@
 @RestController
 @RequestMapping("/public")
-@CrossOrigin(origins = { "http://192.168.0.19:3000", "http://192.168.0.24:3000" })
+@CrossOrigin(origins = { "http://192.168.0.17:3000", "http://192.168.0.24:3000" })
 public class PublicController {
 
Index: springapp/src/main/java/mk/profesori/springapp/Controller/SecureController.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Controller/SecureController.java	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
+++ springapp/src/main/java/mk/profesori/springapp/Controller/SecureController.java	(revision 62b653fbfa2f2521de0bbd3bc445083c3cf5f032)
@@ -25,5 +25,5 @@
 @RestController
 @RequestMapping("/secure")
-@CrossOrigin(origins = { "http://192.168.0.19:3000", "http://192.168.0.24:3000" })
+@CrossOrigin(origins = { "http://192.168.0.17:3000", "http://192.168.0.24:3000" })
 public class SecureController {
 
@@ -72,3 +72,27 @@
     }
 
+    @RequestMapping(value = "/professor/{professorId}/upvoteOpinion/{postId}", method = RequestMethod.GET)
+    public void upvoteOpinion(@PathVariable Long professorId,
+            @PathVariable Long postId, @CurrentSecurityContext SecurityContext context) {
+
+        Authentication authentication = context.getAuthentication();
+
+        if (authentication != null && authentication.getPrincipal() instanceof CustomUserDetails) {
+            CustomUserDetails currentUser = (CustomUserDetails) authentication.getPrincipal();
+            mainService.upvoteOpinion(postId, currentUser);
+        }
+    }
+
+    @RequestMapping(value = "/professor/{professorId}/downvoteOpinion/{postId}", method = RequestMethod.GET)
+    public void downvoteOpinion(@PathVariable Long professorId,
+            @PathVariable Long postId, @CurrentSecurityContext SecurityContext context) {
+
+        Authentication authentication = context.getAuthentication();
+
+        if (authentication != null && authentication.getPrincipal() instanceof CustomUserDetails) {
+            CustomUserDetails currentUser = (CustomUserDetails) authentication.getPrincipal();
+            mainService.downvoteOpinion(postId, currentUser);
+        }
+    }
+
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
+++ springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java	(revision 62b653fbfa2f2521de0bbd3bc445083c3cf5f032)
@@ -12,7 +12,11 @@
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
+import javax.persistence.JoinTable;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToMany;
 import javax.persistence.OneToMany;
 import javax.persistence.SequenceGenerator;
@@ -50,9 +54,15 @@
     private Boolean locked = false;
     private Boolean enabled = false;
-    @OneToMany(mappedBy = "customUserDetails", cascade = CascadeType.ALL)
+    @OneToMany(mappedBy = "customUserDetails", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
     private Set<ConfirmationToken> confirmationTokens = new HashSet<>();
-    @OneToMany(mappedBy = "author", cascade = CascadeType.ALL)
+    @OneToMany(mappedBy = "author", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
     private Set<Post> authoredPosts = new HashSet<>();
-    private Integer karma;
+    private Integer karma = 0;
+    @ManyToMany(fetch = FetchType.EAGER)
+    @JoinTable(name = "post_like", joinColumns = @JoinColumn(name = "custom_user_details_id"), inverseJoinColumns = @JoinColumn(name = "post_id"))
+    Set<Post> likedPosts;
+    @ManyToMany(fetch = FetchType.EAGER)
+    @JoinTable(name = "post_dislike", joinColumns = @JoinColumn(name = "custom_user_details_id"), inverseJoinColumns = @JoinColumn(name = "post_id"))
+    Set<Post> dislikedPosts;
 
     public CustomUserDetails(String fullName, String username, String email, String password, UserRole userRole) {
@@ -105,10 +115,25 @@
 
     public Integer getKarma() {
-        Integer karma = 0;
-        for (Post post : this.authoredPosts) {
-            karma += post.getUpvoteCount() - post.getDownvoteCount();
-        }
-        return karma;
+        return this.karma;
     }
 
+    public void setKarma(Integer karma) {
+        this.karma = karma;
+    }
+
+    public Set<Post> getLikedPosts() {
+        return this.likedPosts;
+    }
+
+    public void setLikedPosts(Set<Post> likedPosts) {
+        this.likedPosts = likedPosts;
+    }
+
+    public Set<Post> getDislikedPosts() {
+        return this.dislikedPosts;
+    }
+
+    public void setDislikedPosts(Set<Post> dislikedPosts) {
+        this.likedPosts = dislikedPosts;
+    }
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/Opinion.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Opinion.java	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Opinion.java	(revision 62b653fbfa2f2521de0bbd3bc445083c3cf5f032)
@@ -23,6 +23,6 @@
     public Opinion(String title, String content, CustomUserDetails author, LocalDateTime timePosted,
             LocalDateTime timeLastEdited,
-            Integer upvoteCount, Integer downvoteCount, Post parent, List<Post> children, Professor targetProfessor) {
-        super(title, content, author, timePosted, timeLastEdited, upvoteCount, downvoteCount, parent, children);
+            Post parent, List<Post> children, Professor targetProfessor) {
+        super(title, content, author, timePosted, timeLastEdited, parent, children);
         this.targetProfessor = targetProfessor;
     }
@@ -31,6 +31,6 @@
     public Opinion(String title, String content, CustomUserDetails author, LocalDateTime timePosted,
             LocalDateTime timeLastEdited,
-            Integer upvoteCount, Integer downvoteCount, List<Post> children, Professor targetProfessor) {
-        super(title, content, author, timePosted, timeLastEdited, upvoteCount, downvoteCount, children);
+            List<Post> children, Professor targetProfessor) {
+        super(title, content, author, timePosted, timeLastEdited, children);
         this.targetProfessor = targetProfessor;
     }
Index: springapp/src/main/java/mk/profesori/springapp/Model/Post.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Post.java	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Post.java	(revision 62b653fbfa2f2521de0bbd3bc445083c3cf5f032)
@@ -4,4 +4,5 @@
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 
 import javax.persistence.CascadeType;
@@ -16,4 +17,5 @@
 import javax.persistence.InheritanceType;
 import javax.persistence.JoinColumn;
+import javax.persistence.ManyToMany;
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
@@ -52,10 +54,4 @@
     private LocalDateTime timeLastEdited;
 
-    @Column(name = "upvote_count")
-    private Integer upvoteCount;
-
-    @Column(name = "downvote_count")
-    private Integer downvoteCount;
-
     @ManyToOne
     @JoinColumn(name = "parent_post_id", nullable = true)
@@ -64,4 +60,10 @@
     @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL)
     private List<Post> children = new ArrayList<>();
+
+    @ManyToMany(mappedBy = "likedPosts")
+    Set<CustomUserDetails> likes;
+
+    @ManyToMany(mappedBy = "dislikedPosts")
+    Set<CustomUserDetails> dislikes;
 
     // getters and setters
@@ -114,20 +116,4 @@
     }
 
-    public Integer getUpvoteCount() {
-        return upvoteCount;
-    }
-
-    public void setUpvoteCount(Integer upvoteCount) {
-        this.upvoteCount = upvoteCount;
-    }
-
-    public Integer getDownvoteCount() {
-        return downvoteCount;
-    }
-
-    public void setDownvoteCount(Integer downvoteCount) {
-        this.downvoteCount = downvoteCount;
-    }
-
     public Post getParent() {
         return parent;
@@ -146,8 +132,24 @@
     }
 
+    public Set<CustomUserDetails> getLikes() {
+        return likes;
+    }
+
+    public void setLikes(Set<CustomUserDetails> likes) {
+        this.likes = likes;
+    }
+
+    public Set<CustomUserDetails> getDislikes() {
+        return dislikes;
+    }
+
+    public void setDislikes(Set<CustomUserDetails> dislikes) {
+        this.dislikes = dislikes;
+    }
+
     // konstruktor so parent (koga e reply)
     public Post(String title, String content, CustomUserDetails author, LocalDateTime timePosted,
             LocalDateTime timeLastEdited,
-            Integer upvoteCount, Integer downvoteCount, Post parent, List<Post> children) {
+            Post parent, List<Post> children) {
         this.title = title;
         this.content = content;
@@ -155,6 +157,4 @@
         this.timePosted = LocalDateTime.now();
         this.timeLastEdited = LocalDateTime.now();
-        this.upvoteCount = 0;
-        this.downvoteCount = 0;
         this.parent = parent;
         this.children = new ArrayList<>();
@@ -164,5 +164,5 @@
     public Post(String title, String content, CustomUserDetails author, LocalDateTime timePosted,
             LocalDateTime timeLastEdited,
-            Integer upvoteCount, Integer downvoteCount, List<Post> children) {
+            List<Post> children) {
         this.title = title;
         this.content = content;
@@ -170,6 +170,4 @@
         this.timePosted = LocalDateTime.now();
         this.timeLastEdited = LocalDateTime.now();
-        this.upvoteCount = 0;
-        this.downvoteCount = 0;
         this.parent = null;
         this.children = new ArrayList<>();
Index: springapp/src/main/java/mk/profesori/springapp/Security/SecurityConfiguration.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Security/SecurityConfiguration.java	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
+++ springapp/src/main/java/mk/profesori/springapp/Security/SecurityConfiguration.java	(revision 62b653fbfa2f2521de0bbd3bc445083c3cf5f032)
@@ -37,5 +37,5 @@
             @Override
             public void addCorsMappings(CorsRegistry registry) {
-                registry.addMapping("/**").allowedOrigins("http://192.168.0.19:3000", "http://192.168.0.24:3000")
+                registry.addMapping("/**").allowedOrigins("http://192.168.0.17:3000", "http://192.168.0.24:3000")
                         .allowCredentials(true);
             }
Index: springapp/src/main/java/mk/profesori/springapp/Service/ConfirmationTokenService.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/ConfirmationTokenService.java	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
+++ springapp/src/main/java/mk/profesori/springapp/Service/ConfirmationTokenService.java	(revision 62b653fbfa2f2521de0bbd3bc445083c3cf5f032)
@@ -13,5 +13,5 @@
 @AllArgsConstructor
 public class ConfirmationTokenService {
-    
+
     private final ConfirmationTokenRepository confirmationTokenRepository;
 
Index: springapp/src/main/java/mk/profesori/springapp/Service/CustomUserDetailsService.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/CustomUserDetailsService.java	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
+++ springapp/src/main/java/mk/profesori/springapp/Service/CustomUserDetailsService.java	(revision 62b653fbfa2f2521de0bbd3bc445083c3cf5f032)
@@ -22,9 +22,10 @@
 
     private final UserRepository userRepository;
+
     @Autowired
-    public PasswordEncoder passwordEncoder()
-    {
+    public PasswordEncoder passwordEncoder() {
         return new BCryptPasswordEncoder();
     }
+
     private final static String USER_NOT_FOUND_MSG = "User with email %s not found";
     private final ConfirmationTokenService confirmationTokenService;
@@ -33,6 +34,5 @@
     public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException {
         return userRepository.findByEmail(email).orElseThrow(
-            () -> new UsernameNotFoundException(String.format(USER_NOT_FOUND_MSG,email))
-            );
+                () -> new UsernameNotFoundException(String.format(USER_NOT_FOUND_MSG, email)));
     }
 
@@ -51,10 +51,9 @@
         String token = UUID.randomUUID().toString();
         ConfirmationToken confirmationToken = new ConfirmationToken(
-            token,
-            LocalDateTime.now(),
-            LocalDateTime.now().plusMinutes(10),
-            customUserDetails
-        );
-        
+                token,
+                LocalDateTime.now(),
+                LocalDateTime.now().plusMinutes(10),
+                customUserDetails);
+
         confirmationTokenService.saveConfirmationToken(confirmationToken);
         return token;
Index: springapp/src/main/java/mk/profesori/springapp/Service/MainService.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/MainService.java	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
+++ springapp/src/main/java/mk/profesori/springapp/Service/MainService.java	(revision 62b653fbfa2f2521de0bbd3bc445083c3cf5f032)
@@ -13,4 +13,5 @@
 import mk.profesori.springapp.Repository.StudyProgrammeRepository;
 import mk.profesori.springapp.Repository.UniversityRepository;
+import mk.profesori.springapp.Repository.UserRepository;
 import mk.profesori.springapp.Model.City;
 import mk.profesori.springapp.Model.CustomUserDetails;
@@ -36,4 +37,6 @@
     @Autowired
     private OpinionRepository opinionRepository;
+    @Autowired
+    private UserRepository userRepository;
 
     public List<Professor> getAllProfessors() {
@@ -138,5 +141,5 @@
 
         Opinion opinionToAdd = new Opinion(title, content, currentUser, null, null,
-                null, null, null, targetProfessor);
+                null, targetProfessor);
 
         opinionRepository.save(opinionToAdd);
@@ -149,5 +152,5 @@
 
         Opinion opinionToAdd = new Opinion(null, content, currentUser, null, null,
-                null, null, targetOpinion, null, targetProfessor);
+                targetOpinion, null, targetProfessor);
         opinionRepository.save(opinionToAdd);
 
@@ -155,3 +158,35 @@
         opinionRepository.save(targetOpinion);
     }
+
+    public void upvoteOpinion(Long postId, CustomUserDetails currentUser) {
+        Opinion targetOpinion = opinionRepository.findByPostId(postId);
+
+        if (!targetOpinion.getLikes().contains(currentUser)) {
+
+            targetOpinion.getLikes().add(currentUser);
+            // opinionRepository.save(targetOpinion);
+
+            targetOpinion.getAuthor().setKarma(targetOpinion.getAuthor().getKarma() + 1);
+            userRepository.save(targetOpinion.getAuthor());
+
+            currentUser.getLikedPosts().add(targetOpinion);
+            userRepository.save(currentUser);
+        }
+    }
+
+    public void downvoteOpinion(Long postId, CustomUserDetails currentUser) {
+        Opinion targetOpinion = opinionRepository.findByPostId(postId);
+
+        if (!targetOpinion.getDislikes().contains(currentUser)) {
+
+            targetOpinion.getDislikes().add(currentUser);
+            // opinionRepository.save(targetOpinion);
+
+            targetOpinion.getAuthor().setKarma(targetOpinion.getAuthor().getKarma() - 1);
+            userRepository.save(targetOpinion.getAuthor());
+
+            currentUser.getDislikedPosts().add(targetOpinion);
+            userRepository.save(currentUser);
+        }
+    }
 }
Index: springapp/src/main/java/mk/profesori/springapp/Service/RegistrationService.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/RegistrationService.java	(revision 6221ab65b38aad2d2b041055cb1aa8825b624f00)
+++ springapp/src/main/java/mk/profesori/springapp/Service/RegistrationService.java	(revision 62b653fbfa2f2521de0bbd3bc445083c3cf5f032)
@@ -45,5 +45,5 @@
                 String tokenToResend = customUserDetailsService
                         .createToken(userRepository.findByEmail(request.getEmail()).get());
-                String link = "http://192.168.0.19:8080/registration/confirm?token=" + tokenToResend;
+                String link = "http://192.168.0.17:8080/registration/confirm?token=" + tokenToResend;
                 emailSender.send(request.getEmail(), emailSender.buildEmail(request.getUsername(), link));
                 return tokenToResend;
@@ -66,5 +66,5 @@
                         UserRole.REGULAR));
 
-        String link = "http://192.168.0.19:8080/registration/confirm?token=" + token;
+        String link = "http://192.168.0.17:8080/registration/confirm?token=" + token;
 
         emailSender.send(request.getEmail(), emailSender.buildEmail(request.getUsername(), link));
