Index: src/main/java/com/wediscussmovies/project/web/controller/DiscussionsController.java
===================================================================
--- src/main/java/com/wediscussmovies/project/web/controller/DiscussionsController.java	(revision 7a0bf79dedf74d33b1f9bb8ce17b562e420e1fc6)
+++ src/main/java/com/wediscussmovies/project/web/controller/DiscussionsController.java	(revision 2a5d6a3d7e82fe6a72290f16b30ecfbbd8df2c98)
@@ -1,7 +1,143 @@
 package com.wediscussmovies.project.web.controller;
 
+import com.wediscussmovies.project.model.*;
+import com.wediscussmovies.project.service.DiscussionService;
+import com.wediscussmovies.project.service.MovieService;
+import com.wediscussmovies.project.service.PersonService;
+import com.wediscussmovies.project.service.ReplyService;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.sql.Date;
+import java.time.LocalDate;
+import java.util.List;
+import java.util.Optional;
 
 @Controller
+@RequestMapping("/discussions")
 public class DiscussionsController {
+    private final DiscussionService discussionService;
+    private final ReplyService replyService;
+    private final MovieService movieService;
+    private final PersonService personService;
+    public DiscussionsController(DiscussionService discussionService, ReplyService replyService, MovieService movieService, PersonService personService) {
+        this.discussionService = discussionService;
+        this.replyService = replyService;
+        this.movieService = movieService;
+        this.personService = personService;
+    }
+
+    @GetMapping("/")
+    public String getDiscussions(@RequestParam(required = false) String titleSearch,
+                                    Model model){
+        List<Discussion> discussions = discussionService.listAll();
+        if(titleSearch != null && !titleSearch.isEmpty()){
+            discussions = discussionService.listAllByTitle(titleSearch);
+        }
+        model.addAttribute("discussions", discussions);
+        model.addAttribute("contentTemplate", "discussionsList");
+        return "template";
+    }
+
+    @GetMapping("/{id}")
+    public String getDiscussion(
+            @PathVariable Integer id,
+            Model model){
+        Optional<Discussion> discussion = discussionService.findById(id);
+        if(discussion.isEmpty())
+            return "redirect:/discussions";
+        model.addAttribute("discussion", discussion);
+        model.addAttribute("contentTemplate", "discussionsDiscussion");
+        return "template";
+    }
+
+    @GetMapping("/{id}/reply")
+    public String getReplyToDiscussion(
+            @PathVariable Integer id,
+            Model model){
+        Optional<Discussion> discussion = discussionService.findById(id);
+        if(discussion.isEmpty())
+            return "redirect:/discussions";
+        model.addAttribute("discussion", discussion);
+        model.addAttribute("contentTemplate", "discussionsReply");
+        return "template";
+    }
+    @PostMapping("/{id}/reply/confirm")
+    public String getReplyToDiscussionConfirm(
+            @PathVariable Integer id,
+            @RequestParam String text,
+            HttpServletRequest request){
+        Optional<Discussion> discussion = discussionService.findById(id);
+        User user = (User) request.getSession().getAttribute("user");
+        if(user == null){
+            return "redirect:/login";
+        }
+        Date date = Date.valueOf(LocalDate.now());
+        if(discussion.isEmpty())
+            return "redirect:/discussions";
+        Reply reply = new Reply(discussion.get(), user, date, text);
+        replyService.save(reply);
+        return "redirect:/discussions/"+id;
+    }
+
+    @GetMapping("/movies/add/{id}")
+    public String getAddDiscussionForMovie(Model model,
+                                           @PathVariable Integer id,
+                                           HttpServletRequest request){
+        model.addAttribute("contentTemplate", "discussionsAdd");
+        request.setAttribute("movieId", id);
+        return "template";
+    }
+
+    @PostMapping("/movies/add/confirm")
+    public String getAddDiscussionMovieConfirm(Model model,
+                                               HttpServletRequest request,
+                                               @RequestParam String title,
+                                               @RequestParam String text){
+        User user = (User) request.getSession().getAttribute("user");
+        if(user == null){
+            return "redirect:/login";
+        }
+        Integer movie_id = (Integer) request.getSession().getAttribute("movieId");
+        request.getSession().setAttribute("movieId", null);
+        Optional<Movie> movieOp = movieService.findById(movie_id);
+        if(movieOp.isEmpty())
+            return "redirect:/movies";
+        Discussion discussion = new Discussion(title, text, user, movieOp.get(), Date.valueOf(LocalDate.now()));
+        discussionService.save(discussion);
+        return "redirect:/discussions";
+    }
+
+
+    @GetMapping("/persons/add/{id}")
+    public String getAddDiscussionForPerson(Model model,
+                                           @PathVariable Integer id,
+                                           HttpServletRequest request){
+        model.addAttribute("contentTemplate", "discussionsAdd");
+        request.setAttribute("personId", id);
+        return "template";
+    }
+
+    @PostMapping("/persons/add/confirm")
+    public String getAddDiscussionForPersonConfirm(Model model,
+                                               HttpServletRequest request,
+                                               @RequestParam String title,
+                                               @RequestParam String text){
+        User user = (User) request.getSession().getAttribute("user");
+        if(user == null){
+            return "redirect:/login";
+        }
+        Integer person_id = (Integer) request.getSession().getAttribute("personId");
+        Optional<Person> personOp = personService.findById(person_id);
+        request.getSession().setAttribute("personId", null);
+        if(personOp.isEmpty())
+            return "redirect:/discussions";
+        Discussion discussion = new Discussion(title, text, user, personOp.get(), Date.valueOf(LocalDate.now()));
+        discussionService.save(discussion);
+        return "redirect:/discussions";
+    }
+
+
 }
Index: src/main/java/com/wediscussmovies/project/web/controller/PersonsController.java
===================================================================
--- src/main/java/com/wediscussmovies/project/web/controller/PersonsController.java	(revision 2a5d6a3d7e82fe6a72290f16b30ecfbbd8df2c98)
+++ src/main/java/com/wediscussmovies/project/web/controller/PersonsController.java	(revision 2a5d6a3d7e82fe6a72290f16b30ecfbbd8df2c98)
@@ -0,0 +1,119 @@
+package com.wediscussmovies.project.web.controller;
+
+import com.wediscussmovies.project.model.Person;
+import com.wediscussmovies.project.model.PersonType;
+import com.wediscussmovies.project.service.PersonService;
+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.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.sql.Date;
+import java.util.List;
+
+@Controller
+@RequestMapping(".")
+public class PersonsController {
+    private final PersonService personSerivce;
+
+    public PersonsController(PersonService personSerivce) {
+        this.personSerivce = personSerivce;
+    }
+
+    @GetMapping("/actors")
+    public String getActorsPage(Model model, @RequestParam(required = false) String nameAndSurname){
+        List<Person> actors = personSerivce.findAllActors();
+        if(nameAndSurname != null && !nameAndSurname.isEmpty()){
+            String [] parts = nameAndSurname.split(" ");
+            String name = parts[0];
+            String surname = "";
+            if(parts.length > 1)
+                surname = parts[1];
+            List<Person> actorsByName = personSerivce.findActorsByNameLike("%"+name+"%");
+            if(!surname.isEmpty()){
+                List<Person> actorsBySurname = personSerivce.findActorsBySurnameLike("%"+surname+"%");
+                for(Person p: actorsBySurname){
+                    boolean add = true;
+                    for(Person a: actorsByName){
+                        if(a.getPerson_id() == p.getPerson_id()){
+                            add=false;
+                            break;
+                        }
+                    }
+                    if(!add)
+                        continue;
+                    actorsByName.add(p);
+                }
+            }
+            actors = actorsByName;
+        }
+        actors.sort(Person.personComparatorByNameSurname);
+        model.addAttribute("actors", actors);
+        model.addAttribute("contentTemplate", "actorsList");
+        return "template";
+    }
+
+    @GetMapping("/directors")
+    public String getDirectorsPage(Model model, @RequestParam(required = false) String nameAndSurname){
+        List<Person> directors = personSerivce.findAllDirectors();
+        if(nameAndSurname != null && !nameAndSurname.isEmpty()){
+            String [] parts = nameAndSurname.split(" ");
+            String name = parts[0];
+            String surname = "";
+            if(parts.length > 1)
+                surname = parts[1];
+            List<Person> directorsByName = personSerivce.findDirectorsByNameLike("%"+name+"%");
+            if(!surname.isEmpty()){
+                List<Person> directorsBySurname = personSerivce.findDirectorsBySurnameLike("%"+surname+"%");
+                for(Person p: directorsBySurname){
+                    boolean add = true;
+                    for(Person a: directorsByName){
+                        if(a.getPerson_id() == p.getPerson_id()){
+                            add=false;
+                            break;
+                        }
+                    }
+                    if(!add)
+                        continue;
+                    directorsByName.add(p);
+                }
+            }
+            directors = directorsByName;
+        }
+        directors.sort(Person.personComparatorByNameSurname);
+        model.addAttribute("directors", directors);
+        model.addAttribute("contentTemplate", "directorsList");
+        return "template";
+    }
+
+    @GetMapping("/persons/add")
+    public String getPersonsAddPage(Model model){
+        PersonType [] types = PersonType.values();
+        model.addAttribute("types", types);
+        model.addAttribute("contentTemplate", "personsAdd");
+        return "template";
+    }
+
+    @PostMapping("/persons/add/confirm")
+    public String confirmPersonsAdd(
+            @RequestParam String name,
+            @RequestParam String surname,
+            @RequestParam PersonType type,
+            @RequestParam Date date_of_birth,
+            @RequestParam String image_url,
+            @RequestParam String description){
+        Person person = new Person(name, surname, type, date_of_birth, image_url, description);
+        if(personSerivce.save(person)){
+            String toWhere = "actors";
+            if(type == PersonType.D)
+                toWhere = "directors";
+            return "redirect:/"+toWhere;
+        }
+        else{
+            return "redirect:/persons/add";
+        }
+    }
+
+}
Index: src/main/java/com/wediscussmovies/project/web/controller/ReplyController.java
===================================================================
--- src/main/java/com/wediscussmovies/project/web/controller/ReplyController.java	(revision 2a5d6a3d7e82fe6a72290f16b30ecfbbd8df2c98)
+++ src/main/java/com/wediscussmovies/project/web/controller/ReplyController.java	(revision 2a5d6a3d7e82fe6a72290f16b30ecfbbd8df2c98)
@@ -0,0 +1,41 @@
+package com.wediscussmovies.project.web.controller;
+
+import com.wediscussmovies.project.model.Reply;
+import com.wediscussmovies.project.service.ReplyService;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.Optional;
+
+public class ReplyController {
+    private final ReplyService replyService;
+
+    public ReplyController(ReplyService replyService) {
+        this.replyService = replyService;
+    }
+
+    @GetMapping("/edit/{id}")
+    public String getReplyEdit(@PathVariable Integer id, Model model){
+        Optional<Reply> reply = replyService.findById(id);
+        if(reply.isEmpty())
+            return "redirect:/movies";
+        model.addAttribute("reply", reply.get());
+        model.addAttribute("templateContext", "replyEdit");
+        return "template";
+    }
+
+    @PostMapping("/edit/confirm/{id}")
+    public String getReplyEdit(@PathVariable Integer id, @RequestParam String text){
+        Optional<Reply> replyOp = replyService.findById(id);
+        if(replyOp.isEmpty())
+            return "redirect:/discussions";
+        Reply reply = replyOp.get();
+        replyService.delete(reply);
+        reply.setText(text);
+        replyService.save(reply);
+        return "redirect:/discussions/"+reply.getDiscussion().getDiscussion_id();
+    }
+}
Index: src/main/java/com/wediscussmovies/project/web/controller/UserController.java
===================================================================
--- src/main/java/com/wediscussmovies/project/web/controller/UserController.java	(revision 7a0bf79dedf74d33b1f9bb8ce17b562e420e1fc6)
+++ src/main/java/com/wediscussmovies/project/web/controller/UserController.java	(revision 2a5d6a3d7e82fe6a72290f16b30ecfbbd8df2c98)
@@ -1,7 +1,76 @@
 package com.wediscussmovies.project.web.controller;
 
+import com.wediscussmovies.project.model.User;
+import com.wediscussmovies.project.model.exception.InvalidUserCredentialsException;
+import com.wediscussmovies.project.service.UserService;
 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.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Optional;
 
 @Controller
+@RequestMapping("/")
 public class UserController {
+    private final UserService userService;
+
+    public UserController(UserService userService) {
+        this.userService = userService;
+    }
+
+    @GetMapping("/login")
+    public String getLoginPage(){
+       return "login";
+    }
+
+    @PostMapping("/login/confirm")
+    public String confirmLogin(HttpServletRequest request, Model model){
+        Optional<User> user;
+        try{
+            user = this.userService.login(request.getParameter("username"), request.getParameter("password"));
+            request.getSession().setAttribute("user", user);
+            request.getSession().setAttribute("loggedIn",true);
+            return "redirect:/movies";
+        }
+        catch (InvalidUserCredentialsException ex){
+            model.addAttribute("hasError", true);
+            model.addAttribute("error", ex.getMessage());
+            return "login";
+        }
+    }
+
+    @GetMapping("/register")
+    public String getRegisterPage(){
+        return "register";
+    }
+
+    @PostMapping("/login/confirm")
+    public String confirmRegister(HttpServletRequest request,
+                                  @RequestParam String username,
+                                  @RequestParam String email,
+                                  @RequestParam String password,
+                                  @RequestParam String confirmPassword,
+                                  @RequestParam String name,
+                                  @RequestParam String surname){
+        Optional<User> user;
+        user = this.userService.register(request, email, password, confirmPassword, username, name, surname);
+        if(user.isEmpty()){
+            request.setAttribute("hasError", "true");
+        }else{
+            request.setAttribute("hasError", "false");
+        }
+        request.getSession().setAttribute("user", user.get());
+        request.getSession().setAttribute("loggedIn",true);
+        return "redirect:/movies";
+    }
+
+    @GetMapping
+    public String logout(HttpServletRequest request){
+        request.getSession().invalidate();
+        return "redirect:/login";
+    }
 }
