Index: pom.xml
===================================================================
--- pom.xml	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ pom.xml	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -41,4 +41,18 @@
             <scope>test</scope>
         </dependency>
+        <!-- https://mvnrepository.com/artifact/com.jcraft/jsch -->
+        <dependency>
+            <groupId>com.jcraft</groupId>
+            <artifactId>jsch</artifactId>
+            <version>0.1.55</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/org.json/json -->
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <version>20231013</version>
+        </dependency>
+
     </dependencies>
 
Index: src/main/java/com/example/cookbook/controller/HomeController.java
===================================================================
--- src/main/java/com/example/cookbook/controller/HomeController.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/controller/HomeController.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,77 @@
-package com.example.cookbook.controller;public class HomeController {
+package com.example.cookbook.controller;
+
+
+import com.example.cookbook.model.Recept;
+import com.example.cookbook.model.Slika;
+import com.example.cookbook.model.Sostojka;
+import com.example.cookbook.model.exception.ReceptNeEPronajdenException;
+import com.example.cookbook.service.ReceptService;
+import com.example.cookbook.service.SlikiService;
+import com.example.cookbook.service.SostojkiService;
+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 java.sql.SQLException;
+import java.util.List;
+
+@Controller
+public class HomeController {
+
+    private final ReceptService receptService;
+    private final SlikiService slikiService;
+
+    private final SostojkiService sostojkiService;
+
+    public HomeController(ReceptService receptService, SlikiService slikiService, SostojkiService sostojkiService) {
+
+        this.receptService = receptService;
+        this.slikiService = slikiService;
+        this.sostojkiService = sostojkiService;
+    }
+
+    @GetMapping({"/", "/recepti"})
+    public String getHomePage(Model model){
+
+        List<Recept> recepti = null;
+        try {
+            recepti = receptService.listAll();
+        } catch (SQLException e) {
+            return "redirect:/error-page/SQL%20Exception";
+        }
+        model.addAttribute("recepti", recepti);
+        return "home";
+    }
+
+    @GetMapping("/recept/{id}")
+    public String getReceptPage(@PathVariable Long id, Model model){
+
+        Recept recept = null;
+        List<Slika> sliki;
+        List<Sostojka> sostojki;
+        try {
+            recept = receptService.findById(id);
+            sliki = slikiService.findAllPicById(id);
+            sostojki = sostojkiService.findAllById(id);
+        } catch (SQLException e) {
+            return "redirect:/error-page/SQL%20Exception";
+        }catch (ReceptNeEPronajdenException e){
+            return "redirect:/error-page/" + e.getMessage();
+        }
+        model.addAttribute("recept", recept);
+        model.addAttribute("sliki", sliki);
+        model.addAttribute("sostojki", sostojki);
+        return "recept";
+    }
+
+
+    @GetMapping("/error-page/{error}")
+    public String getErrorPage(@PathVariable(required = false) String error, Model model){
+
+        if (error != null){
+            model.addAttribute("error", error);
+        }
+        return "error-page";
+    }
 }
Index: src/main/java/com/example/cookbook/dbConfig/DB.java
===================================================================
--- src/main/java/com/example/cookbook/dbConfig/DB.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/dbConfig/DB.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,53 @@
-package com.example.cookbook.dbConfig;public class DB {
+package com.example.cookbook.dbConfig;
+
+
+import org.springframework.stereotype.Component;
+
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+@Component
+public class DB {
+//    private static final String SSH_HOST = "194.149.135.130";
+//    private static final String SSH_USER = "t_cbdb";
+//    private static final String SSH_PASSWORD = "b6cd27a3";
+
+    private static final String DB_URL = "jdbc:postgresql://localhost:9999/db_202324z_va_prj_cbdb";
+    private static final String DB_USERNAME = "db_202324z_va_prj_cbdb_owner";
+    private static final String DB_PASSWORD = "d922daf2bfec";
+
+
+    private static final String LDB_URL = "jdbc:postgresql://localhost:5432/cbdb";
+    private static final String LDB_USERNAME = "postgres";
+    private static final String LDB_PASSWORD = "04UF@bak";
+
+    private static Connection connection = null;
+
+
+
+
+
+
+    private static void setConnection() throws SQLException {
+
+        if (connection == null || connection.isClosed()){
+            connection = DriverManager.getConnection(LDB_URL, LDB_USERNAME, LDB_PASSWORD);
+            connection.createStatement().execute("set search_path to project");
+        }
+    }
+
+    public static Connection getConnection() throws SQLException {
+        setConnection();
+        return connection;
+    }
+
+
+    public static void closeConnection() throws SQLException {
+        if (connection != null){
+            connection.close();
+        }
+    }
 }
+
Index: src/main/java/com/example/cookbook/model/DostavaDTO.java
===================================================================
--- src/main/java/com/example/cookbook/model/DostavaDTO.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/model/DostavaDTO.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,13 @@
-package com.example.cookbook.model;public class Dostava {
+package com.example.cookbook.model;
+
+import java.time.LocalDateTime;
+
+public record DostavaDTO (String recIme, String adresa, String sostojka, LocalDateTime vreme, String telefon){
+    public DostavaDTO(String recIme, String adresa, String sostojka, LocalDateTime vreme, String telefon) {
+        this.recIme = recIme;
+        this.adresa = adresa;
+        this.sostojka = sostojka;
+        this.vreme = vreme;
+        this.telefon = telefon;
+    }
 }
Index: src/main/java/com/example/cookbook/model/Recept.java
===================================================================
--- src/main/java/com/example/cookbook/model/Recept.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/model/Recept.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,17 +1,9 @@
 package com.example.cookbook.model;
 
-public class ReceptForList {
+public class Recept {
 
     private Long recId;
 
     private String recIme;
-
-    public String getPostapka() {
-        return postapka;
-    }
-
-    public void setPostapka(String postapka) {
-        this.postapka = postapka;
-    }
 
     private String postapka;
@@ -27,5 +19,5 @@
     }
 
-    public ReceptForList(Long recId, String recIme, String postapka) {
+    public Recept(Long recId, String recIme, String postapka) {
         this.recId = recId;
         this.recIme = recIme;
@@ -34,5 +26,5 @@
     }
 
-    public ReceptForList() {
+    public Recept() {
     }
 
@@ -53,4 +45,10 @@
     }
 
+    public String getPostapka() {
+        return postapka;
+    }
 
+    public void setPostapka(String postapka) {
+        this.postapka = postapka;
+    }
 }
Index: src/main/java/com/example/cookbook/model/Slika.java
===================================================================
--- src/main/java/com/example/cookbook/model/Slika.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/model/Slika.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,43 @@
-package com.example.cookbook.model;public class Slika {
+package com.example.cookbook.model;
+
+public class Slika {
+
+    private Integer redenBroj;
+
+    private Long recId;
+
+    private String pic;
+
+    public Slika() {
+    }
+
+    public Slika(Integer redenBroj, Long recId, String pic) {
+        this.redenBroj = redenBroj;
+        this.recId = recId;
+        this.pic = pic;
+    }
+
+    public String getPic() {
+        return pic;
+    }
+
+    public void setPic(String pic) {
+        this.pic = pic;
+    }
+
+    public Integer getRedenBroj() {
+        return redenBroj;
+    }
+
+    public void setRedenBroj(Integer redenBroj) {
+        this.redenBroj = redenBroj;
+    }
+
+    public Long getRecId() {
+        return recId;
+    }
+
+    public void setRecId(Long recId) {
+        this.recId = recId;
+    }
 }
Index: src/main/java/com/example/cookbook/model/Sostojka.java
===================================================================
--- src/main/java/com/example/cookbook/model/Sostojka.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/model/Sostojka.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,32 @@
-package com.example.cookbook.model;public class Sostojki {
+package com.example.cookbook.model;
+
+public class Sostojka {
+
+    private Long sId;
+
+    private String sNaziv;
+
+    public Sostojka(Long sId, String sNaziv) {
+        this.sId = sId;
+        this.sNaziv = sNaziv;
+    }
+
+    public Sostojka() {
+    }
+
+    public Long getsId() {
+        return sId;
+    }
+
+    public void setsId(Long sId) {
+        this.sId = sId;
+    }
+
+    public String getsNaziv() {
+        return sNaziv;
+    }
+
+    public void setsNaziv(String sNaziv) {
+        this.sNaziv = sNaziv;
+    }
 }
Index: src/main/java/com/example/cookbook/model/exception/ReceptNeEPronajdenException.java
===================================================================
--- src/main/java/com/example/cookbook/model/exception/ReceptNeEPronajdenException.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/model/exception/ReceptNeEPronajdenException.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,7 @@
-package com.example.cookbook.model.exception;public class ReceptNeEPronajdenException {
+package com.example.cookbook.model.exception;
+
+public class ReceptNeEPronajdenException extends RuntimeException{
+    public ReceptNeEPronajdenException() {
+        super("Receptot ne e pronajden");
+    }
 }
Index: src/main/java/com/example/cookbook/repository/ReceptRepository.java
===================================================================
--- src/main/java/com/example/cookbook/repository/ReceptRepository.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/repository/ReceptRepository.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,67 @@
-package com.example.cookbook.repository;public class ReceptRepository {
+package com.example.cookbook.repository;
+
+
+import com.example.cookbook.dbConfig.DB;
+import com.example.cookbook.model.Recept;
+import org.springframework.stereotype.Repository;
+
+import java.sql.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+@Repository
+public class ReceptRepository {
+
+
+    public List<Recept> findAll() throws SQLException {
+        Connection connection = DB.getConnection();
+
+        Statement stm = connection.createStatement();
+        String query = "select r.rec_id, r.rec_ime , r.postapka,  avg(k.ocena) average\n" +
+                "from  recepti r\n" +
+                "    left join komentari k\n" +
+                "        on r.rec_id = k.rec_id\n" +
+                "group by r.rec_id, r.rec_ime";
+        ResultSet result = stm.executeQuery(query);
+
+        List<Recept> recepti = new ArrayList<>();
+        while (result.next()){
+            Recept recept = new Recept();
+
+            recept.setRecId(result.getLong("rec_id"));
+            recept.setRecIme(result.getString("rec_ime"));
+            recept.setPostapka(result.getString("postapka"));
+            recept.setSrednaOcena(result.getFloat("average"));
+
+            recepti.add(recept);
+
+        }
+        stm.close();
+        result.close();
+        DB.closeConnection();
+        return recepti;
+    }
+
+    public Optional<Recept> findById(Long recId) throws SQLException {
+        Connection connection = DB.getConnection();
+
+        String query = "select * from recepti r where r.rec_id = ?";
+        PreparedStatement prepStm = connection.prepareStatement(query);
+        prepStm.setLong(1, recId);
+
+        ResultSet result = prepStm.executeQuery();
+        Recept recept = null;
+        if(result.next()){
+            recept = new Recept();
+            recept.setRecId(result.getLong("rec_id"));
+            recept.setRecIme(result.getString("rec_ime"));
+            recept.setPostapka(result.getString("postapka"));
+        }
+        result.close();
+        prepStm.close();
+        DB.closeConnection();
+        return Optional.ofNullable(recept);
+        
+    }
 }
Index: src/main/java/com/example/cookbook/repository/SlikiZaReceptRepository.java
===================================================================
--- src/main/java/com/example/cookbook/repository/SlikiZaReceptRepository.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/repository/SlikiZaReceptRepository.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,43 @@
-package com.example.cookbook.repository;public class SlikiZaReceptRepository {
+package com.example.cookbook.repository;
+
+import com.example.cookbook.dbConfig.DB;
+import com.example.cookbook.model.Recept;
+import com.example.cookbook.model.Slika;
+import org.springframework.stereotype.Repository;
+
+import java.nio.charset.StandardCharsets;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+@Repository
+public class SlikiZaReceptRepository {
+
+    public List<Slika> findAllForRecipe(Long recId) throws SQLException {
+        Connection connection = DB.getConnection();
+
+        String query = "select * from sliki s where s.rec_id = ? order by s.reden_broj asc";
+        PreparedStatement prepStm = connection.prepareStatement(query);
+        prepStm.setLong(1, recId);
+
+        ResultSet result = prepStm.executeQuery();
+        List<Slika> sliki = new ArrayList<>();
+
+        while (result.next()){
+            Slika slika = new Slika();
+            slika.setRecId(result.getLong("rec_id"));
+            slika.setRedenBroj(result.getInt("reden_broj"));
+            slika.setPic(new String(result.getBytes("slika"), StandardCharsets.UTF_8));
+            sliki.add(slika);
+        }
+
+        result.close();
+        prepStm.close();
+        DB.closeConnection();
+
+        return sliki;
+    }
 }
Index: src/main/java/com/example/cookbook/repository/SostojkiRespository.java
===================================================================
--- src/main/java/com/example/cookbook/repository/SostojkiRespository.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/repository/SostojkiRespository.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,49 @@
-package com.example.cookbook.repository;public class SostojkiRespository {
+package com.example.cookbook.repository;
+
+
+import com.example.cookbook.dbConfig.DB;
+import com.example.cookbook.model.Slika;
+import com.example.cookbook.model.Sostojka;
+import org.springframework.stereotype.Repository;
+
+import java.nio.charset.StandardCharsets;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+@Repository
+public class SostojkiRespository {
+
+
+    public List<Sostojka> findAllByRId(Long rId) throws SQLException {
+        Connection connection = DB.getConnection();
+
+        String query = "select s.s_id, s_naziv\n" +
+                "from sodrzi\n" +
+                "    left join sostojki s on\n" +
+                "        sodrzi.s_id = s.s_id\n" +
+                "where rec_id = ?";
+
+        PreparedStatement prepStm = connection.prepareStatement(query);
+        prepStm.setLong(1, rId);
+
+        ResultSet result = prepStm.executeQuery();
+        List<Sostojka> sostojki = new ArrayList<>();
+
+        while (result.next()){
+            Sostojka sostojka = new Sostojka();
+            sostojka.setsId(result.getLong("s_id"));
+            sostojka.setsNaziv(result.getString("s_naziv"));
+            sostojki.add(sostojka);
+        }
+
+        result.close();
+        prepStm.close();
+        DB.closeConnection();
+
+        return sostojki;
+    }
 }
Index: src/main/java/com/example/cookbook/service/ReceptService.java
===================================================================
--- src/main/java/com/example/cookbook/service/ReceptService.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/service/ReceptService.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,13 @@
-package com.example.cookbook.service;public interface ReceptService {
+package com.example.cookbook.service;
+
+import com.example.cookbook.model.Recept;
+
+import java.sql.SQLException;
+import java.util.List;
+
+public interface ReceptService {
+
+    List<Recept> listAll() throws SQLException;
+
+    Recept findById(Long id) throws SQLException;
 }
Index: src/main/java/com/example/cookbook/service/SlikiService.java
===================================================================
--- src/main/java/com/example/cookbook/service/SlikiService.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/service/SlikiService.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,13 @@
-package com.example.cookbook.service;public class SlikiService {
+package com.example.cookbook.service;
+
+import com.example.cookbook.model.Slika;
+
+import java.sql.SQLException;
+import java.util.List;
+
+public interface SlikiService {
+
+    List<Slika> findAllPicById(Long recId) throws SQLException;
+
+
 }
Index: src/main/java/com/example/cookbook/service/SostojkiService.java
===================================================================
--- src/main/java/com/example/cookbook/service/SostojkiService.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/service/SostojkiService.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,11 @@
-package com.example.cookbook.service;public interface SostojkiService {
+package com.example.cookbook.service;
+
+import com.example.cookbook.model.Sostojka;
+
+import java.sql.SQLException;
+import java.util.List;
+
+public interface SostojkiService {
+
+    List<Sostojka> findAllById(Long rId) throws SQLException;
 }
Index: src/main/java/com/example/cookbook/service/impl/ReceptServiceImpl.java
===================================================================
--- src/main/java/com/example/cookbook/service/impl/ReceptServiceImpl.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/service/impl/ReceptServiceImpl.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,35 @@
-package com.example.cookbook.service.impl;public class ReceptServiceImpl {
+package com.example.cookbook.service.impl;
+
+import com.example.cookbook.model.Recept;
+import com.example.cookbook.model.exception.ReceptNeEPronajdenException;
+import com.example.cookbook.repository.ReceptRepository;
+import com.example.cookbook.service.ReceptService;
+import org.springframework.stereotype.Service;
+
+import java.sql.SQLException;
+import java.util.List;
+import java.util.Optional;
+
+@Service
+public class ReceptServiceImpl implements ReceptService {
+
+    private final ReceptRepository receptRepository;
+
+    public ReceptServiceImpl(ReceptRepository receptRepository) {
+        this.receptRepository = receptRepository;
+    }
+
+    @Override
+    public List<Recept> listAll() throws SQLException {
+        return receptRepository.findAll();
+    }
+
+    @Override
+    public Recept findById(Long id) throws SQLException {
+        Recept recept;
+
+        recept = receptRepository.findById(id).orElseThrow(ReceptNeEPronajdenException::new);
+
+        return recept;
+    }
 }
Index: src/main/java/com/example/cookbook/service/impl/SlikiServiceImpl.java
===================================================================
--- src/main/java/com/example/cookbook/service/impl/SlikiServiceImpl.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/service/impl/SlikiServiceImpl.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,25 @@
-package com.example.cookbook.service.impl;public class SlikiService {
+package com.example.cookbook.service.impl;
+
+
+import com.example.cookbook.model.Slika;
+import com.example.cookbook.repository.SlikiZaReceptRepository;
+import com.example.cookbook.service.SlikiService;
+import org.springframework.stereotype.Service;
+
+import java.sql.SQLException;
+import java.util.List;
+
+@Service
+public class SlikiServiceImpl implements SlikiService {
+
+    private final SlikiZaReceptRepository slikiZaReceptRepository;
+
+    public SlikiServiceImpl(SlikiZaReceptRepository slikiZaReceptRepository) {
+        this.slikiZaReceptRepository = slikiZaReceptRepository;
+    }
+
+    @Override
+    public List<Slika> findAllPicById(Long recId) throws SQLException {
+        return slikiZaReceptRepository.findAllForRecipe(recId);
+    }
 }
Index: src/main/java/com/example/cookbook/service/impl/SostojkiServiceImpl.java
===================================================================
--- src/main/java/com/example/cookbook/service/impl/SostojkiServiceImpl.java	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/java/com/example/cookbook/service/impl/SostojkiServiceImpl.java	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,2 +1,25 @@
-package com.example.cookbook.service.impl;public class SostojkiServiceImpl {
+package com.example.cookbook.service.impl;
+
+
+import com.example.cookbook.model.Sostojka;
+import com.example.cookbook.repository.SostojkiRespository;
+import com.example.cookbook.service.SostojkiService;
+import org.springframework.stereotype.Service;
+
+import java.sql.SQLException;
+import java.util.List;
+
+@Service
+public class SostojkiServiceImpl implements SostojkiService {
+
+    private final SostojkiRespository sostojkiRepository;
+
+    public SostojkiServiceImpl(SostojkiRespository sostojkiRepository) {
+        this.sostojkiRepository = sostojkiRepository;
+    }
+
+    @Override
+    public List<Sostojka> findAllById(Long rId) throws SQLException {
+        return sostojkiRepository.findAllByRId(rId);
+    }
 }
Index: src/main/resources/application.properties
===================================================================
--- src/main/resources/application.properties	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/resources/application.properties	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,1 +1,6 @@
 
+spring.datasource.url=jdbc:postgresql://localhost:9999/db_202324z_va_prj_cbdb
+spring.datasource.username=db_202324z_va_prj_cbdb_owner
+spring.datasource.password=d922daf2bfec
+
+
Index: src/main/resources/templates/error-page.html
===================================================================
--- src/main/resources/templates/error-page.html	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/resources/templates/error-page.html	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,10 +1,50 @@
 <!DOCTYPE html>
-<html lang="en">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org">
 <head>
-  <meta charset="UTF-8">
-  <title>$Title$</title>
+    <meta charset="UTF-8">
+    <title>Home page</title>
+    <!-- Add Bootstrap CSS link -->
+    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
 </head>
 <body>
-$END$
+<!-- Bootstrap Navbar -->
+<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
+    <a class="navbar-brand" href="#">
+        CookBook
+    </a>
+    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
+        <span class="navbar-toggler-icon"></span>
+    </button>
+    <div class="collapse navbar-collapse" id="navbarNav">
+        <ul class="navbar-nav ml-auto">
+            <li class="nav-item active">
+                <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
+            </li>
+            <li class="nav-item">
+                <a class="nav-link" href="#">About</a>
+            </li>
+            <li class="nav-item">
+                <a class="nav-link" href="#">Contact</a>
+            </li>
+        </ul>
+    </div>
+</nav>
+
+<div class="container mt-5">
+    <h1>This is an error page</h1>
+    <div th:if="${error != null}">
+        <h5 th:text="${error}"></h5>
+    </div>
+
+    <h3>Something went wrong!</h3>
+
+
+</div>
+
+<!-- Add Bootstrap JS and Popper.js scripts (required for Bootstrap components) -->
+<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
+<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
 </body>
 </html>
Index: src/main/resources/templates/home.html
===================================================================
--- src/main/resources/templates/home.html	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/resources/templates/home.html	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -1,10 +1,63 @@
 <!DOCTYPE html>
-<html lang="en">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org">
 <head>
-  <meta charset="UTF-8">
-  <title>$Title$</title>
+    <meta charset="UTF-8">
+    <title>Home page</title>
+    <!-- Add Bootstrap CSS link -->
+    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
 </head>
 <body>
-$END$
+<!-- Bootstrap Navbar -->
+<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
+    <a class="navbar-brand" href="#">
+        CookBook
+    </a>
+    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
+        <span class="navbar-toggler-icon"></span>
+    </button>
+    <div class="collapse navbar-collapse" id="navbarNav">
+        <ul class="navbar-nav ml-auto">
+            <li class="nav-item active">
+                <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
+            </li>
+            <li class="nav-item">
+                <a class="nav-link" href="#">About</a>
+            </li>
+            <li class="nav-item">
+                <a class="nav-link" href="#">Contact</a>
+            </li>
+        </ul>
+    </div>
+</nav>
+
+<div class="container mt-5">
+    <h1>This is home page</h1>
+
+    <table class="table">
+        <thead>
+        <tr>
+            <th>Ime</th>
+            <th>Ocena</th>
+            <th>Action</th>
+        </tr>
+        </thead>
+        <tbody>
+        <tr th:each="recept : ${recepti}">
+            <td><a th:href="@{'/recept/{id}' (id=${recept.recId})}" th:text="${recept.recIme}"></a></td>
+            <td th:text="${recept.srednaOcena}"></td>
+            <td>
+                <button class="btn btn-primary">Edit</button>
+                <button class="btn btn-danger">Delete</button>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>
+
+<!-- Add Bootstrap JS and Popper.js scripts (required for Bootstrap components) -->
+<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
+<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
 </body>
 </html>
Index: src/main/resources/templates/recept.html
===================================================================
--- src/main/resources/templates/recept.html	(revision 3e572eb5078b74bc9c8fc83edc749c611308dd26)
+++ src/main/resources/templates/recept.html	(revision 501396eb0bc93eea13801d6b1a3904aa9457af83)
@@ -7,8 +7,14 @@
     <!-- Add Bootstrap CSS link -->
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
+    <style>
+        img{
+            margin: 16px;
+            border-style: groove;
+        }
+    </style>
 </head>
 <body>
     <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
-    <a class="navbar-brand" href="#">
+    <a class="navbar-brand" th:href="@{/}">
         CookBook
     </a>
@@ -19,5 +25,5 @@
         <ul class="navbar-nav ml-auto">
             <li class="nav-item active">
-                <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
+                <a class="nav-link" th:href="@{/}">Home <span class="sr-only">(current)</span></a>
             </li>
             <li class="nav-item">
@@ -31,12 +37,37 @@
 </nav>
 
-    <h1 th:text="${recept.recIme}"></h1>
-
-    <h4 th:text="${recept.srednaOcena}"></h4>
-
-    <div th:text="${recept.postapka}"></div>
 
 
-    <div>KOMENTARI TO DO</div>
+    <div class="container mt-4">
+        <h1 th:text="${recept.recIme}"></h1>
+
+        <h4 th:text="${recept.srednaOcena}"></h4>
+
+        <div class="row">
+            <div class="col-12">
+                <h6>Pictures</h6>
+            </div>
+            <div class="col-12">
+                <img th:each="slika : ${sliki}" th:src="${slika.pic}" class="img-fluid" alt="Recipe Image" width="200px" height="200px">
+            </div>
+        </div>
+
+        <div>
+            <h5>Состојки</h5>
+            <div th:if="${sostojki.size() == 0}">Состојките не се додадени!</div>
+            <ul>
+                <li th:each="sostojka : ${sostojki}" th:text="${sostojka.sNaziv}"></li>
+            </ul>
+        </div>
+
+
+        <div>
+            <h5>Постапка</h5>
+            <p class="mt-4" th:text="${recept.postapka}"></p>
+        </div>
+
+
+        <div class="mt-4">KOMENTARI TO DO</div>
+    </div>
 
 <!-- Add Bootstrap JS and Popper.js scripts (required for Bootstrap components) -->
