Index: Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/PersonalProfile.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/PersonalProfile.java	(revision eef07ff68b99f548ba2d2261e5cb11770db606c2)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/PersonalProfile.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -32,5 +32,5 @@
     private GroomingNeed groomingNeed;
 
-    public PersonalProfile(int id, FriendlyToKids friendlyToKids, FriendlyToPets friendlyToPets, AttentionNeed attentionNeed, PhysicalActivity physicalActivity, GroomingNeed groomingNeed) {
+    public PersonalProfile(Integer id, FriendlyToKids friendlyToKids, FriendlyToPets friendlyToPets, AttentionNeed attentionNeed, PhysicalActivity physicalActivity, GroomingNeed groomingNeed) {
         this.id = id;
         this.friendlyToKids = friendlyToKids;
Index: Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Pet.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Pet.java	(revision eef07ff68b99f548ba2d2261e5cb11770db606c2)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Pet.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -43,10 +43,10 @@
 
     @Column(name = "id_adoption")
-    private int adoptionId;
+    private Integer adoptionId;
 
     @Column(name = "id_shelter")
-    private int shelterId;
+    private Integer shelterId;
 
-    public Pet(String imageUrl, AgeGroup ageGroup, Size size, String breed, String name, Species species, Gender gender, boolean canBeFostered, int adoptionId, int shelterId) {
+    public Pet(String imageUrl, AgeGroup ageGroup, Size size, String breed, String name, Species species, Gender gender, boolean canBeFostered, Integer adoptionId, Integer shelterId) {
         this.imageUrl = imageUrl;
         this.ageGroup = ageGroup;
Index: Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Post.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Post.java	(revision eef07ff68b99f548ba2d2261e5cb11770db606c2)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Post.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -5,5 +5,4 @@
 
 import java.time.LocalDate;
-import java.util.Date;
 
 @Data
@@ -24,13 +23,13 @@
 
     @Column(name="id_pet", nullable = false)
-    private int petId;
+    private Integer petId;
 
     @Column(name="id_surendee")
-    private int surendeeId;
+    private Integer surendeeId;
 
     @Column(name="id_employee")
-    private int employeeId;
+    private Integer employeeId;
 
-    public Post(LocalDate dateCreated, String thumbnailUrl, int petId, int surendeeId, int employeeId) {
+    public Post(LocalDate dateCreated, String thumbnailUrl, Integer petId, Integer surendeeId, Integer employeeId) {
         this.dateCreated = dateCreated;
         this.thumbnailUrl = thumbnailUrl;
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/PersonalProfileService.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/PersonalProfileService.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/PersonalProfileService.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -0,0 +1,10 @@
+package finki.paw5.service;
+
+import finki.paw5.model.entities.PersonalProfile;
+import finki.paw5.web.controllers.PostController;
+
+import java.util.Optional;
+
+public interface PersonalProfileService {
+    Optional<PersonalProfile> findById(Integer petId);
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/PetService.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/PetService.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/PetService.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -0,0 +1,16 @@
+package finki.paw5.service;
+
+import finki.paw5.model.entities.Pet;
+import finki.paw5.web.controllers.PostController;
+
+import java.util.List;
+import java.util.Optional;
+
+public interface PetService {
+
+    void save (Pet pet);
+
+    List<Pet> findAll();
+
+    Optional<Pet> findById(Integer petId);
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/PostService.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/PostService.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/PostService.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -0,0 +1,15 @@
+package finki.paw5.service;
+
+import finki.paw5.model.entities.Post;
+
+import java.util.List;
+import java.util.Optional;
+
+public interface PostService {
+
+    void save (Post post);
+
+    List<Post> findAll();
+
+    Optional<Post> findById(Integer id);
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/ShelterService.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/ShelterService.java	(revision eef07ff68b99f548ba2d2261e5cb11770db606c2)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/ShelterService.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -4,6 +4,8 @@
 
 import java.util.List;
+import java.util.Optional;
 
 public interface ShelterService {
+    Optional<Shelter> findById(Integer id);
     List<Shelter> listShelters();
 }
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PersonalProfileServiceImplementation.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PersonalProfileServiceImplementation.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PersonalProfileServiceImplementation.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -0,0 +1,23 @@
+package finki.paw5.service.implementation;
+
+import finki.paw5.model.entities.PersonalProfile;
+import finki.paw5.repository.PersonalProfileRepository;
+import finki.paw5.service.PersonalProfileService;
+import org.springframework.stereotype.Service;
+
+import java.util.Optional;
+
+@Service
+public class PersonalProfileServiceImplementation implements PersonalProfileService {
+
+    private final PersonalProfileRepository personalProfileRepository;
+
+    public PersonalProfileServiceImplementation(PersonalProfileRepository personalProfileRepository) {
+        this.personalProfileRepository = personalProfileRepository;
+    }
+
+    @Override
+    public Optional<PersonalProfile> findById(Integer petId) {
+        return this.personalProfileRepository.findById(petId);
+    }
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PetServiceImplementation.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PetServiceImplementation.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PetServiceImplementation.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -0,0 +1,34 @@
+package finki.paw5.service.implementation;
+
+import finki.paw5.model.entities.Pet;
+import finki.paw5.repository.PetRepository;
+import finki.paw5.service.PetService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Optional;
+
+@Service
+public class PetServiceImplementation implements PetService {
+
+    private final PetRepository petRepository;
+
+    public PetServiceImplementation(PetRepository petRepository) {
+        this.petRepository = petRepository;
+    }
+
+    @Override
+    public void save(Pet pet) {
+        this.petRepository.save(pet);
+    }
+
+    @Override
+    public List<Pet> findAll() {
+        return this.petRepository.findAll();
+    }
+
+    @Override
+    public Optional<Pet> findById(Integer petId) {
+        return this.petRepository.findById(petId);
+    }
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PostServiceImplementation.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PostServiceImplementation.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PostServiceImplementation.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -0,0 +1,34 @@
+package finki.paw5.service.implementation;
+
+import finki.paw5.model.entities.Post;
+import finki.paw5.repository.PostRepository;
+import finki.paw5.service.PostService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Optional;
+
+@Service
+public class PostServiceImplementation implements PostService {
+
+    private final PostRepository postRepository;
+
+    public PostServiceImplementation(PostRepository PostRepository){
+        this.postRepository = PostRepository;
+    }
+
+    @Override
+    public void save(Post post) {
+        this.postRepository.save(post);
+    }
+
+    @Override
+    public List<Post> findAll() {
+        return this.postRepository.findAll();
+    }
+
+    @Override
+    public Optional<Post> findById(Integer id) {
+        return this.postRepository.findById(id);
+    }
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/ShelterServiceImplementation.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/ShelterServiceImplementation.java	(revision eef07ff68b99f548ba2d2261e5cb11770db606c2)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/ShelterServiceImplementation.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -7,7 +7,9 @@
 
 import java.util.List;
+import java.util.Optional;
 
 @Service
 public class ShelterServiceImplementation implements ShelterService {
+
     private final ShelterRepository shelterRepository;
 
@@ -16,4 +18,8 @@
     }
 
+    @Override
+    public Optional<Shelter> findById(Integer id) {
+        return this.shelterRepository.findById(id);
+    }
 
     @Override
@@ -21,3 +27,5 @@
         return shelterRepository.findAll();
     }
+
+
 }
Index: Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PetController.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PetController.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PetController.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -0,0 +1,15 @@
+package finki.paw5.web.controllers;
+
+import finki.paw5.service.PetService;
+import org.springframework.stereotype.Controller;
+
+@Controller
+public class PetController {
+
+    private final PetService petService;
+
+    public PetController(PetService petService) {
+        this.petService = petService;
+    }
+
+}
Index: Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PostController.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PostController.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PostController.java	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -0,0 +1,92 @@
+package finki.paw5.web.controllers;
+
+import finki.paw5.model.entities.PersonalProfile;
+import finki.paw5.model.entities.Pet;
+import finki.paw5.model.entities.Post;
+import finki.paw5.model.entities.Shelter;
+import finki.paw5.model.enumerations.AgeGroup;
+import finki.paw5.model.enumerations.Gender;
+import finki.paw5.model.enumerations.Size;
+import finki.paw5.model.enumerations.Species;
+import finki.paw5.service.PersonalProfileService;
+import finki.paw5.service.PetService;
+import finki.paw5.service.PostService;
+import finki.paw5.service.ShelterService;
+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.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.time.LocalDate;
+import java.util.List;
+
+@Controller
+public class PostController {
+
+    private final PostService postService;
+    private final PetService petService;
+    private final PersonalProfileService personalProfileService;
+
+    public PostController(PostService postService, PetService petService, PersonalProfileService personalProfileService, ShelterService shelterService) {
+        this.postService = postService;
+        this.petService = petService;
+        this.personalProfileService = personalProfileService;
+    }
+
+    @GetMapping("create-post")
+    public String get(Model model) {
+        //TODO: vakvo ama za lista so pets
+        //        List<Manufacturer> manufacturers = this.manufacturerService.findAll();
+        //        model.addAttribute("manufacturers", manufacturers);
+        return "create-post";
+    }
+
+    @PostMapping("submit-post")
+    public String savePost(@RequestParam(required = false) String name,
+                           @RequestParam String gender,
+                           @RequestParam String ageGroup,
+                           @RequestParam String size,
+                           @RequestParam String species,
+                           @RequestParam(required = false) String breed,
+                           @RequestParam(required = false) String imageUrl,
+                           @RequestParam(required = false) boolean canBeFostered) {
+
+        Pet pet = new Pet(imageUrl, AgeGroup.valueOf(ageGroup), Size.valueOf(size), breed, name, Species.valueOf(species), Gender.valueOf(gender), canBeFostered, null, 1);
+        this.petService.save(pet);
+
+        Post post = new Post(LocalDate.now(), imageUrl, pet.getId(), null, 10);//TODO: employee id da se zeme preku session user getid
+        this.postService.save(post);
+
+        return "redirect:/home";
+    }
+
+    @GetMapping("/adoption-posts")
+    public String getAdoptionPosts(Model model, HttpServletRequest request){
+
+        List<Post> posts = this.postService.findAll();
+        List<Pet> pets = this.petService.findAll();
+        //model.addAttribute("posts", posts);
+        //model.addAttribute("pets",pets);
+        request.getSession().setAttribute("posts",posts);//temp
+        request.getSession().setAttribute("pets",pets);//temp
+
+        return "list-posts-adoption";
+    }
+
+    @GetMapping("/pet-details-{id}")
+    public String getPostDetails(@PathVariable Integer id, Model model, HttpServletRequest request){
+
+        Post post = this.postService.findById(id).get();
+        Pet pet = this.petService.findById(post.getPetId()).get();
+
+        //model.addAttribute("pet", pet);
+        //model.addAttribute("post", post);
+        request.getSession().setAttribute("post", post);//temp
+        request.getSession().setAttribute("pet", pet);//temp
+
+        return "pet-details";
+    }
+}
Index: Prototype Application/Paw5/src/main/resources/templates/create-post.html
===================================================================
--- Prototype Application/Paw5/src/main/resources/templates/create-post.html	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/resources/templates/create-post.html	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -0,0 +1,113 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org"
+      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
+      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
+<head>
+    <meta charset="UTF-8">
+    <title>Create a post</title>
+</head>
+<body>
+    <h1>Create post</h1>
+<form th:action="@{/submit-post}" method="post">
+
+    <div>
+        <label for="pet">Selet pet:</label>
+        <select id="pet">
+        </select>
+    </div>
+
+    <div>
+        <label for="newpet">Add new pet:</label>
+            <input id="newpet" name="newpet" placeholder="newpet" type="checkbox">
+    </div>
+
+    <div>
+        <label for="name">Name:</label>
+        <input type="text"
+               id="name"
+               name="name"
+               class="form-control"
+               placeholder="Enter name">
+    </div>
+
+    <div>
+        <label for="gender">Gender:</label>
+        <select id="gender"
+                name="gender"
+                class="form-control">
+            <option value = "MALE">male</option>
+            <option value = "FEMALE">female</option>
+        </select>
+    </div>
+
+    <div>
+        <label for="ageGroup">Age Group:</label>
+        <select id="ageGroup"
+                name="ageGroup"
+                class="form-control">
+            <option value = "YOUNG">young</option>
+            <option value = "ADULT">adult</option>
+            <option value = "ELDER">elder</option>
+        </select>
+    </div>
+
+    <div>
+        <label for="size">Size:</label>
+        <select id="size"
+                name="size"
+                class="form-control">
+            <option value = "XSMALL">extra small</option>
+            <option value = "SMALL">small</option>
+            <option value = "MEDIUM">medium</option>
+            <option value = "LARGE">large</option>
+            <option value = "XLARGE">extra large</option>
+        </select>
+    </div>
+
+    <div>
+        <label for="species">Species:</label>
+        <select id="species"
+                name="species"
+                class="form-control">
+            <option value = "CAT">cat</option>
+            <option value = "DOG">dog</option>
+            <option value = "BIRD">bird</option>
+        </select>
+    </div>
+
+    <div>
+        <label for="breed">Breed:</label>
+        <input type="text"
+               id="breed"
+               name="breed"
+               class="form-control"
+               placeholder="Enter breed" >
+    </div>
+
+    <div>
+        <label for="imageUrl">Image URL:</label>
+        <input type="text"
+               id="imageUrl"
+               name="imageUrl"
+               class="form-control"
+               placeholder="Enter image URL">
+        <!-- <label for="upload">Image:</label>
+        <input id="upload" type="file" accept="image/*">
+        <input type="submit">-->
+    </div>
+
+    <div>
+        <label for="canBeFostered">Can be fostered:</label>
+        <input type="checkbox"
+               id="canBeFostered"
+               name="canBeFostered"
+               class="form-control"
+               value=false>
+    </div>
+
+    <button id="submit" type="submit">Submit</button>
+
+</form>
+</body>
+</html>
Index: Prototype Application/Paw5/src/main/resources/templates/list-posts-adoption.html
===================================================================
--- Prototype Application/Paw5/src/main/resources/templates/list-posts-adoption.html	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/resources/templates/list-posts-adoption.html	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org"
+      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
+      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
+<head>
+    <meta charset="UTF-8">
+    <title>Adoption Posts</title>
+</head>
+<body>
+<table>
+    <tr>
+        <th>Post ID</th>
+        <th>Pet Name</th>
+        <th>Species</th>
+    </tr>
+    <tr th:each = "post : ${session.posts}">
+        <td th:text = "${post.getId()}"></td>
+        <td th:each = "pet : ${session.pets}" th:if="${post.getPetId()==pet.getId()}" th:text = "${pet.getName()}"></td>
+        <td th:each = "pet : ${session.pets}" th:if="${post.getPetId()==pet.getId()}" th:text = "${pet.getSpecies()}"></td>
+        <td>
+            <form th:action="@{'/pet-details-{id}' (id=${post.getId()})}"
+                  th:method="GET">
+                <button type="submit"
+                        class="btn">
+                        View Details
+                </button>
+            </form>
+
+        </td>
+    </tr>
+</table>
+</body>
+</html>
Index: Prototype Application/Paw5/src/main/resources/templates/pet-details.html
===================================================================
--- Prototype Application/Paw5/src/main/resources/templates/pet-details.html	(revision 50f2c2a18d81327837ff765564b91beac304e421)
+++ Prototype Application/Paw5/src/main/resources/templates/pet-details.html	(revision 50f2c2a18d81327837ff765564b91beac304e421)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org"
+      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
+      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+</head>
+<body>
+<table>
+    <tr>
+        <th>Post ID</th>
+        <td th:text = "${session.post.getId()}"></td>
+    <tr>
+        <th>Pet Name</th>
+        <td th:text = "${session.pet.getName()}"></td>
+    </tr>
+    <tr>
+        <th>Species</th>
+        <td th:text = "${session.pet.getSpecies()}"></td>
+    </tr>
+    <tr>
+        <th>Breed</th>
+        <td th:text = "${session.pet.getBreed()}"></td>
+    </tr>
+    <tr>
+        <th>Gender</th>
+        <td th:text = "${session.pet.getGender()}"></td>
+    </tr>
+    <tr>
+        <th>Age Group</th>
+        <td th:text = "${session.pet.getAgeGroup}"></td>
+    </tr>
+    <tr>
+        <th>Size</th>
+        <td th:text = "${session.pet.getSize()}"></td>
+    </tr>
+
+</table>
+
+</body>
+</html>
