Index: springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java	(revision b7ec74e9eb06c0df7df42fee97077dfa366495fb)
+++ springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
@@ -1,7 +1,9 @@
 package mk.profesori.springapp.Model;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
@@ -19,4 +21,6 @@
 import org.springframework.security.core.authority.SimpleGrantedAuthority;
 import org.springframework.security.core.userdetails.UserDetails;
+
+import com.fasterxml.jackson.annotation.JsonManagedReference;
 
 import lombok.EqualsAndHashCode;
@@ -46,4 +50,6 @@
     @OneToMany(mappedBy = "customUserDetails", cascade = CascadeType.ALL)
     private Set<ConfirmationToken> confirmationTokens = new HashSet<>();
+    @OneToMany(mappedBy = "author", cascade = CascadeType.ALL)
+    private List<Post> authoredPosts = new ArrayList<>();
 
     public CustomUserDetails(String fullName, String username, String email, String password, UserRole userRole) {
@@ -90,4 +96,9 @@
         return enabled;
     }
+
+    @JsonManagedReference
+    List<Post> getAuthoredPosts() {
+        return this.authoredPosts;
+    }
     
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/Opinion.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Opinion.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Opinion.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
@@ -0,0 +1,37 @@
+package mk.profesori.springapp.Model;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+
+import com.fasterxml.jackson.annotation.JsonBackReference;
+
+@Entity
+@DiscriminatorValue("opinion")
+public class Opinion extends Post{
+
+    @ManyToOne
+    @JoinColumn(name = "professor_id", nullable = false)
+    private Professor targetProfessor;
+
+    public Opinion(Long postId, String title, String content, CustomUserDetails author, LocalDateTime timePosted,
+            LocalDateTime timeLastEdited, Integer upvoteCount, Integer downvoteCount, Post parent,
+            List<Post> children, Professor targetProfessor) {
+        super(postId, title, content, author, timePosted, timeLastEdited, upvoteCount, downvoteCount, parent, children);
+        this.targetProfessor = targetProfessor;
+    }
+
+    //getters and setters
+    @JsonBackReference
+    public Professor getTargetProfessor() {
+        return targetProfessor;
+    }
+
+    public void setTargetProfessor(Professor targetProfessor) {
+        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 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Post.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
@@ -0,0 +1,163 @@
+package mk.profesori.springapp.Model;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorColumn;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.DiscriminatorType;
+import javax.persistence.InheritanceType;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+
+import com.fasterxml.jackson.annotation.JsonBackReference;
+import com.fasterxml.jackson.annotation.JsonManagedReference;
+
+@Entity(name="post")
+@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
+@DiscriminatorColumn(name="post_type", 
+  discriminatorType = DiscriminatorType.STRING)
+public class Post {
+    
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Long postId;
+    
+    @Column(name = "title")
+    private String title;
+
+    @Column(name = "content", columnDefinition="TEXT")
+    private String content;
+    
+    @ManyToOne
+    @JoinColumn(name = "custom_user_details_id")
+    private CustomUserDetails author;
+    
+    @Column(name = "time_posted")
+    private LocalDateTime timePosted;
+
+    @Column(name = "time_last_edited")
+    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)
+    private Post parent;
+    
+    @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL)
+    private List<Post> children = new ArrayList<>();
+
+    //getters and setters
+    public Long getPostId() {
+        return postId;
+    }
+
+    public void setPostId(Long postId) {
+        this.postId = postId;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+    
+    @JsonBackReference
+    public CustomUserDetails getAuthor() {
+        return author;
+    }
+
+    public void setAuthor(CustomUserDetails author) {
+        this.author = author;
+    }
+
+    public LocalDateTime getTimePosted() {
+        return timePosted;
+    }
+
+    public void setTimePosted(LocalDateTime timePosted) {
+        this.timePosted = timePosted;
+    }
+
+    public LocalDateTime getTimeLastEdited() {
+        return timeLastEdited;
+    }
+
+    public void setTimeLastEdited(LocalDateTime timeLastEdited) {
+        this.timeLastEdited = timeLastEdited;
+    }
+
+    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;
+    }
+
+    @JsonBackReference
+    public Post getParent() {
+        return parent;
+    }
+
+    public void setParent(Post parent) {
+        this.parent = parent;
+    }
+
+    @JsonManagedReference
+    public List<Post> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<Post> children) {
+        this.children = children;
+    }
+
+    public Post(Long postId, String title, String content, CustomUserDetails author, LocalDateTime timePosted,
+            LocalDateTime timeLastEdited, Integer upvoteCount, Integer downvoteCount, Post parent,
+            List<Post> children) {
+        this.postId = postId;
+        this.title = title;
+        this.content = content;
+        this.author = author;
+        this.timePosted = timePosted;
+        this.timeLastEdited = timeLastEdited;
+        this.upvoteCount = upvoteCount;
+        this.downvoteCount = downvoteCount;
+        this.parent = parent;
+        this.children = children;
+    }
+    
+}
Index: springapp/src/main/java/mk/profesori/springapp/Model/Professor.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Professor.java	(revision b7ec74e9eb06c0df7df42fee97077dfa366495fb)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Professor.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
@@ -1,7 +1,10 @@
 package mk.profesori.springapp.Model;
 
+import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -15,4 +18,5 @@
 
 import com.fasterxml.jackson.annotation.JsonBackReference;
+import com.fasterxml.jackson.annotation.JsonManagedReference;
 
 @Entity
@@ -32,4 +36,7 @@
     private Faculty faculty;
 
+    @OneToMany(mappedBy = "targetProfessor", cascade = CascadeType.ALL)
+    private List<Opinion> relatedOpinions = new ArrayList<Opinion>();
+
     //getters
     public Long getProfessorId() {
@@ -45,3 +52,8 @@
         return faculty;
     }
+
+    @JsonManagedReference
+    public List<Opinion> getRelatedOpinions() {
+        return relatedOpinions;
+    }
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/Section.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Section.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Section.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
@@ -0,0 +1,70 @@
+package mk.profesori.springapp.Model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+
+import com.fasterxml.jackson.annotation.JsonBackReference;
+import com.fasterxml.jackson.annotation.JsonManagedReference;
+
+@Entity
+public class Section {
+    
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Long sectionId;
+
+    @Column(name = "name")
+    private String name;
+
+    @OneToMany(mappedBy = "parentSection", cascade = CascadeType.ALL)
+    private List<_Thread> threads = new ArrayList<>();
+
+    @OneToOne
+    @JoinColumn(name = "study_programme_id", referencedColumnName = "id")
+    private StudyProgramme relatedStudyProgramme;
+
+    //getters and setters
+    public Long getSectionId() {
+        return sectionId;
+    }
+
+    public void setSectionId(Long sectionId) {
+        this.sectionId = sectionId;
+    }
+
+    @JsonManagedReference
+    public List<_Thread> getThreads() {
+        return threads;
+    }
+
+    public void setThreads(List<_Thread> threads) {
+        this.threads = threads;
+    }
+
+    @JsonBackReference
+    public StudyProgramme getRelatedStudyProgramme() {
+        return relatedStudyProgramme;
+    }
+
+    public void setRelatedStudyProgramme(StudyProgramme relatedStudyProgramme) {
+        this.relatedStudyProgramme = relatedStudyProgramme;
+    }
+
+    public Section(Long sectionId, List<_Thread> threads, StudyProgramme relatedStudyProgramme) {
+        this.sectionId = sectionId;
+        this.threads = threads;
+        this.relatedStudyProgramme = relatedStudyProgramme;
+    }
+    
+}
Index: springapp/src/main/java/mk/profesori/springapp/Model/StudyProgramme.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/StudyProgramme.java	(revision b7ec74e9eb06c0df7df42fee97077dfa366495fb)
+++ springapp/src/main/java/mk/profesori/springapp/Model/StudyProgramme.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
@@ -12,4 +12,5 @@
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
 import javax.persistence.Table;
 
@@ -39,4 +40,7 @@
     private Set<Subject> subjects = new HashSet<>();
 
+    @OneToOne(mappedBy = "relatedStudyProgramme")
+    private Section relatedSection;
+
     //getters
     public Long getStudyProgrammeId() {
@@ -61,3 +65,8 @@
         return subjects;
     }
+
+    @JsonManagedReference
+    public Section getRelatedSection() {
+        return relatedSection;
+    }
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/Subject.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Subject.java	(revision b7ec74e9eb06c0df7df42fee97077dfa366495fb)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Subject.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
@@ -1,7 +1,10 @@
 package mk.profesori.springapp.Model;
 
+import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -15,4 +18,5 @@
 
 import com.fasterxml.jackson.annotation.JsonBackReference;
+import com.fasterxml.jackson.annotation.JsonManagedReference;
 
 @Entity
@@ -32,4 +36,7 @@
     private StudyProgramme studyProgramme;
 
+    @OneToMany(mappedBy = "targetSubject", cascade = CascadeType.ALL)
+    private List<_Thread> threads = new ArrayList<>();
+
     //getters
     public Long getSubjectId() {
@@ -45,4 +52,9 @@
         return studyProgramme;
     }
+
+    @JsonManagedReference
+    public List<_Thread> getThreads() {
+        return threads;
+    }
     
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/_Thread.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/_Thread.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/_Thread.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
@@ -0,0 +1,56 @@
+package mk.profesori.springapp.Model;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.ElementCollection;
+import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+
+import com.fasterxml.jackson.annotation.JsonBackReference;
+
+@Entity
+@DiscriminatorValue("thread")
+public class _Thread extends Post {
+
+    @Column(name = "tags")
+    @ElementCollection
+    private List<String> tags = new ArrayList<>();
+
+    @ManyToOne
+    @JoinColumn(name = "section_id")
+    private Section parentSection;
+
+    @ManyToOne
+    @JoinColumn(name = "subject_id")
+    private Subject targetSubject;
+
+    public _Thread(Long postId, String title, String content, CustomUserDetails author, LocalDateTime timePosted,
+            LocalDateTime timeLastEdited, Integer upvoteCount, Integer downvoteCount, Post parent,
+            List<Post> children, List<String> tags, Section parentSection, Subject targetSubject) {
+        super(postId, title, content, author, timePosted, timeLastEdited, upvoteCount, downvoteCount, parent, children);
+        this.tags = tags;
+        this.parentSection = parentSection;
+        this.targetSubject = targetSubject;
+    }
+
+    //getters
+    public List<String> getTags() {
+        return tags;
+    }
+
+    @JsonBackReference
+    public Section getParentSection() {
+        return parentSection;
+    }
+
+    @JsonBackReference
+    public Subject getTargetSubject() {
+        return targetSubject;
+    }
+    
+}
