Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/Edge.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/Edge.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/Edge.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -4,10 +4,8 @@
 import lombok.Getter;
 import lombok.Setter;
-import lombok.ToString;
 
 import java.util.Map;
 
 @Setter @Getter
-@ToString
 public class Edge{
   private MapNode node;
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/MapNode.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/MapNode.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/MapNode.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -14,13 +14,9 @@
     private Coordinates<Double,Double> coordinates;
     private List<String> connectionNames = new ArrayList<>();
-    private String className;
-    private int floorNumber;
 
-    public MapNode(String name, String description, Coordinates<Double, Double> coordinates,String className,int floorNumber) {
+    public MapNode(String name, String description, Coordinates<Double, Double> coordinates) {
         this.name = name;
         this.description = description;
         this.coordinates = coordinates;
-        this.className = className;
-        this.floorNumber = floorNumber;
     }
 
@@ -31,4 +27,10 @@
     }
 
+    public MapNode(String name, String description, Coordinates<Double, Double> coordinates, String connectedRoom) {
+        this.name = name;
+        this.description = description;
+        this.coordinates = coordinates;
+        this.connectedRoom = connectedRoom;
+    }
 
     public MapNode() {
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/MapNodeParser.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/MapNodeParser.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/MapNodeParser.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -2,4 +2,5 @@
 
 
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -9,50 +10,72 @@
 
 public class MapNodeParser {
-
-
-    public List<MapNode> parseAndCreate(String mapJson) throws Exception {
+    public List<MapNode> parseAndCreateNodes(String mapJson) throws Exception {
         final List<MapNode> mapNodes = new ArrayList<>();
 
-        if (mapJson == null || mapJson.isEmpty() || mapJson.equals("[]")) {
-            throw new MapParseException("Cannot parse empty map");
-        }
+        System.out.println("======= MAP JSON ====== " + mapJson);
+
+//        if(mapJson == null || mapJson.isEmpty() || mapJson.equals("[]")) {
+//            throw new MapParseException("Cannot parse empty map");
+//        }
 
         ObjectMapper objectMapper = new ObjectMapper();
-        List<Shape> shapes = objectMapper.readValue(mapJson, objectMapper.getTypeFactory().constructCollectionType(List.class, Shape.class));
+            String[] shapes = objectMapper.readValue(mapJson, String[].class);
 
-        shapes.forEach(shape -> {
-            try {
-                String type = shape.getClassName();
-                if (Objects.equals(type, "Wall") || Objects.equals(type, "Room")) return;
-                MapNode mapNode = createMapNode(shape);
-                @SuppressWarnings("unchecked")
-                List<String> connectedPins = (List<String>) shape.getAttrs().get("connected_pins");
-                if (connectedPins != null) {
-                    for (String pin : connectedPins) {
-                        System.out.println("Connected node (markup) : " + pin + " to: " + shape.getAttrs().get("obj_name"));
-                        mapNode.addConnectionName(pin);
+            Arrays.stream(shapes).forEach(shape -> {
+                try {
+                    JsonNode parsedNode = objectMapper.readTree(shape);
+                    String type = parsedNode.get("className").asText();
+
+                    // Wall i room ne se bitni za navigacija
+                    if(Objects.equals(type,"Wall") || Objects.equals(type,"Room")) return;
+
+                    JsonNode attrs = parsedNode.get("attrs");
+                    MapNode mapNode = createMapNode(attrs);
+
+                    if(attrs.has("connected_pins")){
+                        JsonNode connectedPins = attrs.get("connected_pins");
+                        if (connectedPins.isArray()) {
+                            for (JsonNode pin : connectedPins) {
+                                System.out.println("Connected node (markup) : " + pin.asText() + " to: " + attrs.get("obj_name"));
+                                mapNode.addConnectionName(pin.asText());
+                            }
+                        }
                     }
+
+                    mapNodes.add(mapNode);
+
+                } catch (JsonProcessingException e) {
+                    throw new RuntimeException(e);
                 }
-                mapNodes.add(mapNode);
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        });
-        mapNodes.forEach(node -> System.out.println("Added node: ----> " + node.toString()));
-        return mapNodes;
+            });
+
+           mapNodes.forEach(node -> System.out.println("Added node: ----> " + node.toString()));
+
+           return mapNodes;
+
     }
 
 
-    private static MapNode createMapNode(Shape shape) {
-        String name = (String) shape.getAttrs().get("obj_name");
-        String description = (String) shape.getAttrs().get("description");
-        String connectedRoom = (String) shape.getAttrs().get("connected_room");
-        double x = Double.parseDouble(Objects.requireNonNull(shape.getAttrs().get("x")).toString());
-        double y = Double.parseDouble(Objects.requireNonNull(shape.getAttrs().get("y")).toString());
-        Coordinates<Double, Double> coordinates = new Coordinates<>(x, y);
-        int floorNumber = (int) shape.getAttrs().get("floor_num");
+    private static String findAttr(String key,JsonNode attrs){
+        if(attrs.has(key)){
+            return attrs.get(key).asText();
+        } else {
+            System.out.println("No attribute found for key:" + key);
+            return null;
+        }
 
-        MapNode mapNode = new MapNode(name, description, coordinates, shape.getClassName(), floorNumber);
-        if (connectedRoom != null) {
+    }
+
+
+    private static MapNode createMapNode(JsonNode attrs) {
+        String name = findAttr("obj_name",attrs);
+        String description = findAttr("description",attrs);
+        String connectedRoom = findAttr("connected_room",attrs);
+        double x = Double.parseDouble(Objects.requireNonNull(findAttr("x", attrs)));
+        double y = Double.parseDouble(Objects.requireNonNull(findAttr("y", attrs)));
+        Coordinates<Double,Double> coordinates = new Coordinates<>(x,y);
+
+        MapNode mapNode = new MapNode(name, description, coordinates);
+        if(connectedRoom != null){
             mapNode.setConnectedRoom(connectedRoom);
         }
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/RouteGraph.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/RouteGraph.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/RouteGraph.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -7,24 +7,16 @@
     private final Map<String, MapNode> nameToNodeMap = new HashMap<>();
 
+    public RouteGraph(List<MapNode> nodes) {
 
-    public void loadNodeNames(List<MapNode> nodes){
+
         for (MapNode node : nodes) {
             nameToNodeMap.put(node.getName(), node);
         }
 
-        for(Map.Entry<String,MapNode> entries : nameToNodeMap.entrySet()) {
-            System.out.println(entries.getKey() + " " + entries.getValue());
-        }
-    }
-
-    public void loadEdges(){
-        for (MapNode mapNode : nameToNodeMap.values()) {
+        for (MapNode mapNode : nodes) {
             for (String connectionName : mapNode.getConnectionNames()) {
-                System.out.println("CONN: " + mapNode.getName() + " " + connectionName);
                 MapNode connectedNode = nameToNodeMap.get(connectionName);
                 if (connectedNode != null) {
                     addEdge(mapNode, connectedNode);
-                }else {
-                    System.out.println("CANT ADD EDGE ========== " + "FROM: " + mapNode.getName() + " TO: " + connectionName);
                 }
             }
@@ -36,5 +28,4 @@
         double x1 = a.getCoordinates().x;
         double y1 = a.getCoordinates().y;
-
         double x2 = b.getCoordinates().x;
         double y2 = b.getCoordinates().y;
@@ -51,6 +42,4 @@
         if (sourceNode == null || targetNode == null) {
             System.out.println(this.toString());
-            System.out.println("SOURCE NODE FROM MAP " + sourceNode);
-            System.out.println("TARGET NODE FROM MAP " + targetNode);
             throw new IllegalArgumentException("Source or target node not found. SOURCE: " + source + " TARGET: " + target);
         }
@@ -106,8 +95,7 @@
         }
 
-        Collections.reverse(path);// deka se staveni vo obraten redosled, pa reverse ni dava pateka od pocetok do kraj.
+        Collections.reverse(path); // deka se staveni vo obraten redosled, pa reverse ni dava pateka od pocetok do kraj.
 
         if (!path.isEmpty() && path.get(0).equals(sourceNode)) {
-            System.out.println("FOUND PATH: " + path);
             return path;
         } else {
@@ -141,6 +129,10 @@
         }
         return null;
-        //throw new IllegalArgumentException("Cant find room connected to entrance: " + roomName);
     }
+
+    public String getNodeNameByName(String name){
+        return nameToNodeMap.get(name).getName();
+    }
+
 
 
@@ -153,6 +145,4 @@
             MapNode node = entry.getKey();
             Set<Edge> connectedNodes = entry.getValue();
-
-            System.out.println("CONN NODES PRINT: " + connectedNodes);
 
             sb.append(node.getName()).append(" -> ");
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/Shape.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/Shape.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,14 +1,0 @@
-package internettehnologii.imaps.backendRender.graph;
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
-import java.util.Map;
-
-@Getter @Setter
-@ToString
-public class Shape {
-    private Map<String,Object> attrs;
-    private String className;
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/exceptions/InvalidMapDataException.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/graph/exceptions/InvalidMapDataException.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package internettehnologii.imaps.backendRender.graph.exceptions;
-
-public class InvalidMapDataException extends RuntimeException {
-    public InvalidMapDataException(String message) {
-        super(message);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/config/MapConfig.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/config/MapConfig.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/config/MapConfig.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,46 @@
+//package internettehnologii.imaps.backendRender.web.config;
+//
+//import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
+//import internettehnologii.imaps.backendRender.web.repo.MapRepository;
+//import internettehnologii.imaps.backendRender.web.security.json.DataJson;
+//import org.springframework.boot.CommandLineRunner;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//
+//import java.util.List;
+//
+//@Configuration
+//public class MapConfig {
+//    String jsonTest1 = "{\n" +
+//            "  \"id\": 1,\n" +
+//            "  \"name\": \"Sample Map\",\n" +
+//            "  \"mapData\": {\n" +
+//            "    \"type\": \"2D\",\n" +
+//            "    \"features\": [\n" +
+//            "      {\"name\": \"River\", \"location\": {\"x\": 10, \"y\": 20}},\n" +
+//            "      {\"name\": \"Mountain\", \"location\": {\"x\": 30, \"y\": 40}}\n" +
+//            "    ]\n" +
+//            "  },\n" +
+//            "  \"graphData\": {\n" +
+//            "    \"nodes\": [\n" +
+//            "      {\"id\": \"A\", \"label\": \"Start\"},\n" +
+//            "      {\"id\": \"B\", \"label\": \"Finish\"}\n" +
+//            "    ],\n" +
+//            "    \"edges\": [\n" +
+//            "      {\"source\": \"A\", \"target\": \"B\", \"weight\": 5}\n" +
+//            "    ]\n" +
+//            "  },\n" +
+//            "  \"isPublic\": true,\n" +
+//            "  \"url\": \"http://example.com/map\"\n" +
+//            "}\n";
+//    @Bean
+//    CommandLineRunner mapCmdLineRunner(MapRepository repository){
+//        return args -> {
+//            IndoorMap martin = new IndoorMap("MARTINCE",new DataJson(jsonTest1),true, "url");
+//            IndoorMap stefan = new IndoorMap("STEFCE", new DataJson(jsonTest1), true, "url");
+//            repository.saveAll(
+//                    List.of(martin, stefan)
+//            );
+//        };
+//    };
+//}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/config/RoleConfig.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/config/RoleConfig.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,22 +1,0 @@
-package internettehnologii.imaps.backendRender.web.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.access.hierarchicalroles.RoleHierarchy;
-import org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl;
-import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler;
-
-@Configuration
-public class RoleConfig {
-    @Bean
-    public RoleHierarchy roleHierarchy() {
-        return RoleHierarchyImpl.fromHierarchy("ROLE_ADMIN > ROLE USER");
-    }
-    @Bean
-    public DefaultWebSecurityExpressionHandler customWebSecurityExpressionHandler() {
-        DefaultWebSecurityExpressionHandler expressionHandler = new DefaultWebSecurityExpressionHandler();
-        expressionHandler.setRoleHierarchy(roleHierarchy());
-        return expressionHandler;
-    }
-
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/config/UserConfig.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/config/UserConfig.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/config/UserConfig.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,27 @@
+//package internettehnologii.imaps.backendRender.web.config;
+//
+//import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
+//import internettehnologii.imaps.backendRender.web.repo.UserRepository;
+//import org.springframework.boot.CommandLineRunner;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+//
+//import java.util.List;
+//
+//@Configuration
+//public class UserConfig {
+//
+//    BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder(12);
+//    @Bean
+//    CommandLineRunner commandLineRunner(UserRepository repository){
+//        return args -> {
+//            IMapsUser martin = new IMapsUser("martin", "martindjakov03@gmail.com", bCryptPasswordEncoder.encode("dzako"));
+//            IMapsUser stefan = new IMapsUser( "stefan", "stefantoskovski03@gmail.com", bCryptPasswordEncoder.encode("toska"));
+//            repository.saveAll(
+//                    List.of(martin, stefan)
+//            );
+//        };
+//
+//    };
+//}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/AdminController.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/AdminController.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,81 +1,0 @@
-package internettehnologii.imaps.backendRender.web.controllers;
-
-import internettehnologii.imaps.backendRender.web.entities.MAP_STATUS;
-import internettehnologii.imaps.backendRender.web.service.interfaces.MapService;
-import internettehnologii.imaps.backendRender.web.service.interfaces.PublishRequestService;
-import internettehnologii.imaps.backendRender.web.util.DTO.MapDTO;
-import internettehnologii.imaps.backendRender.web.util.DTO.PublishMapDTO;
-import internettehnologii.imaps.backendRender.web.util.Util;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Controller;
-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.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@Controller
-@RequestMapping("/api/admin")
-public class AdminController {
-    private final MapService mapService;
-    private final PublishRequestService publishRequestService;
-
-    public AdminController(MapService mapService, PublishRequestService publishRequestService) {
-        this.mapService = mapService;
-        this.publishRequestService = publishRequestService;
-    }
-
-    @GetMapping
-    public ResponseEntity<List<MapDTO>> getPendingMapRequests() {
-        try {
-            List<MapDTO> maps = Util.convertToMapDTO(mapService.findByStatus(MAP_STATUS.INVALID));
-            return ResponseEntity.ok(maps);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return ResponseEntity.badRequest().build();
-        }
-    }
-
-    @GetMapping("/load-pr")
-    public ResponseEntity<List<PublishMapDTO>> getPublishedMapRequests() {
-        try {
-            List<PublishMapDTO> pmdto = publishRequestService.getAllPublishRequests()
-                    .stream()
-                    .map(pr -> new PublishMapDTO(
-                            pr.getId(),
-                            pr.getName(),
-                            pr.getLastName(),
-                            pr.getMap().getName(),
-                            pr.getMapType(),
-                            pr.getGMapsUrl()
-                            ))
-                    .toList();
-            return ResponseEntity.ok(pmdto);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return ResponseEntity.badRequest().build();
-        }
-    }
-
-    @PostMapping("/pr/approve")
-    public ResponseEntity<Map<String,Object>> approvePR(@RequestParam("id") Integer id) {
-        try{
-            publishRequestService.approvePublishRequest(id);
-        } catch (Exception e){
-            e.printStackTrace();
-        }
-        return ResponseEntity.ok(new HashMap<>());
-    }
-    @PostMapping("/pr/deny")
-    public ResponseEntity<Map<String,Object>> denyPR(@RequestParam("id") Integer id) {
-        try{
-            publishRequestService.denyPublishRequest(id);
-        } catch (Exception e){
-            e.printStackTrace();
-        }
-        return ResponseEntity.ok(new HashMap<>());
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/AuthController.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/AuthController.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/AuthController.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -2,21 +2,15 @@
 
 import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.service.impl.JWTService;
-import internettehnologii.imaps.backendRender.web.service.impl.MapUserDetailsService;
-import internettehnologii.imaps.backendRender.web.service.impl.UserServiceImpl;
-import internettehnologii.imaps.backendRender.web.service.interfaces.MapService;
-import internettehnologii.imaps.backendRender.web.util.DTO.UserAuthSuccessDTO;
-import internettehnologii.imaps.backendRender.web.util.DTO.UserLoginDTO;
+import internettehnologii.imaps.backendRender.web.service.JWTService;
+import internettehnologii.imaps.backendRender.web.service.MapUserDetailsService;
+import internettehnologii.imaps.backendRender.web.service.UserService;
 import jakarta.servlet.http.HttpServletRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
-import org.springframework.http.ResponseEntity;
 import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.security.core.userdetails.UserDetailsService;
 import org.springframework.web.bind.annotation.*;
 
-import javax.management.relation.RoleNotFoundException;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
@@ -27,5 +21,5 @@
 
     @Autowired
-    private UserServiceImpl userService;
+    private UserService userService;
     @Autowired
     private JWTService jwtService;
@@ -35,30 +29,27 @@
 
     @PostMapping("/register")
-    public IMapsUser register(@RequestBody IMapsUser user) throws RoleNotFoundException {
+    public IMapsUser register(@RequestBody IMapsUser user) {
         return userService.register(user);
     }
 
     @PostMapping("/login")
-    public Map<String, Object> login(@RequestBody UserLoginDTO user) {
+    public Map<String, Object> login(@RequestBody IMapsUser user, HttpServletRequest request) {
         System.out.println(user);
         Map<String, Object> response = new HashMap<>();
-
-        try{
-            UserAuthSuccessDTO userAuthSuccessDTO = userService.login(user);
-            response.put("token", userAuthSuccessDTO.getToken());
-            response.put("username", userAuthSuccessDTO.getUsername());
-            response.put("roles", userAuthSuccessDTO.getRoles());
-        } catch (Exception e){
-            System.out.println(e.getMessage());
-            response.put("error", e.getMessage());
-        }
-
+        String token = userService.verify(user);
+        response.put("token", token);
+        response.put("username", user.getUsername());
         return response;
     }
 
 
+    //ZA TESTIRANJE
+    @GetMapping("/list")
+    public List<IMapsUser> showUsers() {
+        return userService.getUsers();
+    }
+
     @GetMapping("/verify")
-    public ResponseEntity<Map<String,Object>> authenticateUser(@RequestParam String token) {
-        System.out.println("VERIFY");
+    public Map<String,Object> authenticateUser(@RequestParam String token) {
         Map<String, Object> response = new HashMap<>();
         try{
@@ -66,27 +57,15 @@
             UserDetails userDetails = context.getBean(MapUserDetailsService.class).loadUserByUsername(username);
             boolean auth = jwtService.validateToken(token, userDetails);
-
-            if(!auth){
-                response.put("error", "Token could not be validated");
-                return ResponseEntity.status(403).body(response);
+            if(auth){
+                response.put("username", username);
             }
 
-            response.put("username", username);
-            System.out.println("Authenticated user: " + username);
+            System.out.println(auth + " auth");
         } catch (Exception e){
-            response.put("auth",false);
             System.out.println("ERROR: NOT AUTHENTICATED: " + e.getMessage());
         }
 
-        return ResponseEntity.ok(response);
+        return response;
 
     }
-
-    @GetMapping("/test_auth")
-    public ResponseEntity<Map<String,Object>> testAuth(){
-        Map<String, Object> response = new HashMap<>();
-        response.put("auth",true);
-        return ResponseEntity.ok(response);
-    }
-
 }
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/MapController.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/MapController.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/MapController.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,83 @@
+package internettehnologii.imaps.backendRender.web.controllers;
+
+import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
+import internettehnologii.imaps.backendRender.web.service.MapService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+@RestController
+@RequestMapping(path = "/api")
+public class MapController {
+    private final MapService mapService;
+
+    @Autowired
+    public MapController(MapService mapService){
+        this.mapService = mapService;
+    }
+
+    @GetMapping("/protected/maps")
+    public List<IndoorMap> getMaps(){
+        return mapService.getMaps();
+    }
+
+    @PutMapping("/protected/maps/save")
+    public ResponseEntity<Map<String,Object>> saveMap(@RequestBody String mapData, @RequestParam String mapName) {
+        HashMap<String,Object> response = new HashMap<>();
+        try {
+            mapService.saveMap(mapName, mapData);
+            response.put("status","ok");
+            Optional<IndoorMap> map = mapService.getMapByName(mapName);
+            if(map.isPresent()){
+                response.put("map",map.get());
+            } else {
+                response.put("map","rip");
+            }
+
+            return ResponseEntity.ok(response);
+        } catch (Exception e) {
+            System.out.println(e.getMessage());
+            e.printStackTrace();
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(response);
+        }
+    }
+
+    @GetMapping("/protected/maps/load")
+    public ResponseEntity<Map<String,Object>> loadMap(@RequestParam String mapName) {
+        HashMap<String,Object> response = new HashMap<>();
+        Optional<IndoorMap> map = mapService.getMapByName(mapName);
+        if (map.isPresent()) {
+            response.put("status","ok");
+            response.put("map",map.get());
+            return ResponseEntity.ok(response);
+        } else {
+            response.put("status","error: map " + mapName + " not found");
+        }
+        return ResponseEntity.ok(response);
+    }
+
+//    @PostMapping
+//    public void registerNewMap(@RequestBody IndoorMap map){
+//        mapService.addNewMap(map);
+//    }
+//
+//    @DeleteMapping(path = "{mapId}")
+//    public void deleteMap(@PathVariable("mapId") Long mapId){
+//        mapService.deleteMap(mapId);
+//    }
+//
+//    @PutMapping(path = "{mapId}")
+//    public void updateMap(
+//            @PathVariable("mapId") Long mapId,
+//            @RequestParam(required = false) String name){
+//
+//        //mapService.updateMap(name);
+//    }
+}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/MapDrawController.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/MapDrawController.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,230 +1,0 @@
-package internettehnologii.imaps.backendRender.web.controllers;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import internettehnologii.imaps.backendRender.web.entities.Floor;
-import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.entities.PublishRequest;
-import internettehnologii.imaps.backendRender.web.service.interfaces.*;
-import internettehnologii.imaps.backendRender.web.util.DTO.*;
-import internettehnologii.imaps.backendRender.web.util.Util;
-import internettehnologii.imaps.backendRender.web.util.json.JsonMapData;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
-
-import java.time.LocalDateTime;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@RestController
-@RequestMapping(path = "/api/protected")
-public class MapDrawController {
-    private final MapService mapService;
-    private final FloorService floorService;
-    private final RoomTypeService roomTypeService;
-    private final UserService userService;
-    private final PublishRequestService publishRequestService;
-
-
-    @Autowired
-    public MapDrawController(MapService mapService, FloorService floorService, RoomTypeService roomTypeService, UserService userService, PublishRequestService publishRequestService) {
-        this.mapService = mapService;
-        this.floorService = floorService;
-        this.roomTypeService = roomTypeService;
-        this.userService = userService;
-        this.publishRequestService = publishRequestService;
-    }
-
-    @GetMapping("/my-maps")
-    public ResponseEntity<List<MapDTO>> getMapsForUser(@RequestParam String username) {
-        try {
-            List<IndoorMap> maps = mapService.getAllMapsForUser(username);
-            List<MapDTO> mapDTOS = Util.convertToMapDTO(maps);
-            return ResponseEntity.ok().body(mapDTOS);
-        } catch (Exception e) {
-            System.out.println(e.getMessage());
-            return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
-        }
-    }
-
-    @PostMapping("/publish/add")
-    public ResponseEntity<Map<String,Object>> sendPublishRequest(@RequestBody PublishMapDTO formData, @RequestParam String username) {
-
-        System.out.println("FORM DATA: -------------------------------------------- " + formData);
-        try{
-            IMapsUser user = userService.getUser(username);
-
-            publishRequestService.addPublishRequest(formData,user);
-
-            return ResponseEntity.ok(new HashMap<>());
-
-        } catch (Exception e){
-            return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
-        }
-    }
-    @GetMapping("/publish/get")
-    public ResponseEntity<PublishMapDTO> getPublishRequestForMap(@RequestParam String mapName) {
-        PublishRequest pr = publishRequestService.getPublishRequestByMapName(mapName);
-        PublishMapDTO dto = new PublishMapDTO(pr.getId(),pr.getName(), pr.getLastName(), pr.getMap().getName(), pr.getMapType(), pr.getGMapsUrl());
-        return ResponseEntity.ok(dto);
-    }
-
-    @GetMapping("/favourites")
-    public ResponseEntity<List<MapDTO>> getFavouriteMapsForUser(@RequestParam String username) {
-
-        try{
-            IMapsUser user = userService.getUser(username);
-            List<MapDTO> mapDTOS = Util.convertToMapDTO(user.getFavoriteMaps());
-            return ResponseEntity.ok().body(mapDTOS);
-
-        } catch (Exception e){
-            System.out.println(e.getMessage());
-            return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
-        }
-    }
-
-    @PutMapping("/my-maps/save")
-    public ResponseEntity<FloorDTO> updateMapData
-            (@RequestBody SaveMapDTO saveMapDTO, @RequestParam String username) {
-
-        System.out.println("MAP DTO: " + saveMapDTO);
-
-        try {
-
-            System.out.println("=================================");
-            System.out.println("MAPDTO: " + saveMapDTO);
-            System.out.println("USERNAME:" + username);
-            IndoorMap map = mapService.getMapForUser(username, saveMapDTO.getMapName());
-            Floor f = floorService.getFloorByNum(saveMapDTO.getFloorNum(), map);
-
-
-            ObjectMapper objectMapper = new ObjectMapper();
-            String roomTypesJson = objectMapper.writeValueAsString(saveMapDTO.getRoomTypes());
-            JsonMapData jsonMapData = new JsonMapData(saveMapDTO.getShapes().toString(), roomTypesJson);
-
-            System.out.println("ROOM TYPES JSON : " + roomTypesJson);
-            f.setMapData(jsonMapData);
-            floorService.updateFloor(f);
-
-            map.setModifiedAt(LocalDateTime.now());
-
-            System.out.println("UPDATED FLOOR " + f.getFloorNumber());
-
-            FloorDTO floorDTO = new FloorDTO(f.getFloorNumber(), saveMapDTO.getMapName(),f.getMapData().getShapeData());
-
-            return ResponseEntity.ok(floorDTO);
-        } catch (Exception e) {
-            System.out.println(e.getMessage());
-            e.printStackTrace();
-            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
-        }
-    }
-
-    @PutMapping("/my-maps/create")
-    public ResponseEntity<MapDTO> createMap(@RequestBody CreateMapDTO mapData, @RequestParam String username) {
-        try{
-            mapService.createMap(mapData.getName(), mapData.getMapType() , username);
-            IndoorMap map = mapService.getMapForUser(username,mapData.getName());
-            MapDTO mapDTO = new MapDTO(map.getName(),
-                    map.getMapType()
-                    ,map.getCreatedAt(),
-                    map.getModifiedAt(),
-                    map.getStatus().name(),
-                    map.getFavouriteCount(),
-                    map.getGmapsUrl());
-            return ResponseEntity.ok(mapDTO);
-        } catch (Exception e) {
-            System.out.println(e.getMessage());
-            e.printStackTrace();
-            return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
-        }
-
-    }
-
-    @GetMapping("/my-maps/load")
-    public ResponseEntity<List<FloorDTO>> loadPersonalMap(@RequestParam String mapName, @RequestParam String username) {
-        try{
-            IndoorMap map = mapService.getMapForUser(username,mapName);
-            List<Floor> floors = map.getFloors();
-            return ResponseEntity.ok().body(Util.convertToFloorDTO(floors));
-        } catch (Exception e) {
-            System.out.println(e.getMessage());
-            return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
-        }
-    }
-
-    @PostMapping("/room-types/add")
-    public ResponseEntity<Map<String,Object>> addRoomType(@RequestParam String roomTypeName,
-                                                          @RequestParam String username,
-                                                          @RequestParam String mapName) {
-        try {
-            IndoorMap map = mapService.getMapForUser(username,mapName);
-            roomTypeService.addRoomType(roomTypeName,map);
-            return ResponseEntity.ok(new HashMap<>());
-
-        } catch (Exception e){
-            System.out.println(e.getMessage());
-            return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
-        }
-    }
-
-    @GetMapping("/room-types")
-    public ResponseEntity<List<RoomTypeDTO>> getRoomTypesForMap(@RequestParam String mapName, @RequestParam String username) {
-
-        IndoorMap map = mapService.getMapForUser(username,mapName);
-
-        List<RoomTypeDTO> roomTypeDTOS = map.getRoomTypes().stream().map(r -> new RoomTypeDTO(r.getName())).toList();
-        return ResponseEntity.ok(roomTypeDTOS);
-    }
-
-    @DeleteMapping("/floors/delete")
-    public ResponseEntity<Map<String,Object>> deleteFloor(@RequestParam String mapName,
-                                                          @RequestParam int floorNum) {
-        try{
-            floorService.deleteFloor(floorNum,mapName);
-            return ResponseEntity.ok(new HashMap<>());
-        } catch (Exception e){
-            System.out.println(e.getMessage());
-            return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
-        }
-    }
-
-    @PutMapping("/floors/add")
-    public ResponseEntity<Map<String,Object>> addFloor(@RequestBody FloorDTO floorDTO) {
-        Map<String,Object> response = new HashMap<>();
-        try{
-            floorService.addFloor(floorDTO.getNum(),floorDTO.getMapName());
-            return ResponseEntity.ok(response);
-        } catch (Exception e) {
-            System.out.println(e.getMessage());
-            return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(response);
-        }
-    }
-
-
-    @DeleteMapping("/my-maps/delete")
-    public ResponseEntity<Map<String, Object>> deleteMap(
-            @RequestParam String mapName,
-            @RequestParam String username) {
-        Map<String, Object> response = new HashMap<>();
-        try {
-            IndoorMap map = mapService.getMapForUser(username, mapName);
-            mapService.deleteMap(map);
-            response.put("deleted", true);
-            response.put("mapName", mapName);
-            return ResponseEntity.ok(response);
-        } catch (Exception e) {
-            System.out.println("Error during map deletion: " + e.getMessage());
-            e.printStackTrace();
-            response.put("error", "Map not found or does not belong to the user.");
-            return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(response);
-        }
-    }
-
-
-
-
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/MapRenderApi.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/MapRenderApi.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/MapRenderApi.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,82 @@
+package internettehnologii.imaps.backendRender.web.controllers;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import internettehnologii.imaps.backendRender.graph.MapNode;
+import internettehnologii.imaps.backendRender.graph.MapNodeParser;
+import internettehnologii.imaps.backendRender.graph.RouteGraph;
+import internettehnologii.imaps.backendRender.graph.exceptions.MapParseException;
+import internettehnologii.imaps.backendRender.graph.exceptions.NodeNotFoundException;
+import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
+import internettehnologii.imaps.backendRender.web.service.MapService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+
+import java.util.*;
+
+@RestController
+@RequestMapping("/api")
+@CrossOrigin(origins = "http://localhost:5173/", allowedHeaders = {"Authorization"})
+public class MapRenderApi {
+
+    private String jsonData;
+    private RouteGraph graph;
+
+    private final MapService mapService;
+
+    @Autowired
+    public MapRenderApi(MapService mapService) {
+        this.mapService = mapService;
+    }
+
+    @PostMapping("/protected/render")
+    public ResponseEntity<Map<String, Object>> render(@RequestBody String requestBody) throws Exception {
+        Map<String, Object> response = new HashMap<>();
+        response.put("status", "ok");
+        jsonData = requestBody;
+        try {
+            MapNodeParser parser = new MapNodeParser();
+            List<MapNode> nodes = parser.parseAndCreateNodes(requestBody);
+            graph = new RouteGraph(nodes);
+            System.out.println("=======================\n" + graph);
+        } catch (MapParseException e) {
+            response.put("status", "error: " + e.getMessage());
+        }
+
+        return ResponseEntity.ok(response);
+    }
+
+
+    @GetMapping("/public/navigate")
+    public ResponseEntity<List<MapNode>> navigate(@RequestParam String from, @RequestParam String to) {
+
+        String startNode = from;
+        String endNode = to;
+
+        String roomConnectedToEntranceFrom = graph.findNodeConnectedToEntrance(from);
+        String roomConnectedToEntranceTo = graph.findNodeConnectedToEntrance(to);
+        if (roomConnectedToEntranceFrom != null) {
+            startNode = roomConnectedToEntranceFrom;
+        }
+        if (roomConnectedToEntranceTo != null) {
+            endNode = roomConnectedToEntranceTo;
+        }
+
+        List<MapNode> path = graph.findRoute(startNode, endNode);
+        return ResponseEntity.ok(path);
+    }
+
+    @GetMapping("/public/mapData")
+    public ResponseEntity<String> getMapData() {
+        //tuka povik do baza
+        System.out.println(jsonData);
+        if (jsonData != null && !jsonData.isEmpty()) {
+            return ResponseEntity.ok(jsonData);
+        } else {
+            return ResponseEntity.notFound().build();
+        }
+    }
+
+}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/MapViewController.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/MapViewController.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,143 +1,0 @@
-package internettehnologii.imaps.backendRender.web.controllers;
-
-import internettehnologii.imaps.backendRender.graph.MapNode;
-import internettehnologii.imaps.backendRender.graph.RouteGraph;
-import internettehnologii.imaps.backendRender.web.entities.Floor;
-import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.exceptions.EmptyMapException;
-import internettehnologii.imaps.backendRender.web.exceptions.FloorNotFoundException;
-import internettehnologii.imaps.backendRender.web.service.interfaces.GraphService;
-import internettehnologii.imaps.backendRender.web.service.interfaces.FloorService;
-import internettehnologii.imaps.backendRender.web.service.interfaces.MapService;
-import internettehnologii.imaps.backendRender.web.service.interfaces.UserService;
-import internettehnologii.imaps.backendRender.web.util.DTO.FloorDTO;
-import internettehnologii.imaps.backendRender.web.util.DTO.MapDTO;
-import internettehnologii.imaps.backendRender.web.util.DTO.RoomTypeDTO;
-import internettehnologii.imaps.backendRender.web.util.Util;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.*;
-
-@RestController
-@RequestMapping("/api")
-//@CrossOrigin(origins = "http://localhost:5173/", allowedHeaders = {"Authorization"})
-public class MapViewController {
-
-    private RouteGraph graph;
-
-    private final MapService mapService;
-    private final FloorService floorService;
-    private final GraphService graphService;
-    private final UserService userService;
-
-    @Autowired
-    public MapViewController(MapService mapService, FloorService floorService, GraphService graphService, UserService userService) {
-        this.mapService = mapService;
-        this.floorService = floorService;
-        this.graphService = graphService;
-        this.userService = userService;
-    }
-
-
-    @GetMapping("/public/maps")
-    public ResponseEntity<List<MapDTO>> loadPublicMaps() {
-        try {
-            List<IndoorMap> maps = mapService.getPublicMaps();
-            List<MapDTO> mapDTOS = Util.convertToMapDTO(maps);
-            return ResponseEntity.ok(mapDTOS);
-        } catch (Exception e) {
-            System.out.println(e.getMessage());
-            return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
-        }
-    }
-
-    @GetMapping("/public/room-types")
-    public ResponseEntity<List<RoomTypeDTO>> loadRoomTypesPublic(@RequestParam String mapName) {
-        IndoorMap map = mapService.getPublicMapByName(mapName);
-
-        List<RoomTypeDTO> roomTypeDTOS = map.getRoomTypes().stream().map(r -> new RoomTypeDTO(r.getName())).toList();
-        return ResponseEntity.ok(roomTypeDTOS);
-    }
-
-
-    @GetMapping("/public/navigate")
-    public ResponseEntity<List<MapNode>> navigate(@RequestParam String from, @RequestParam String to) {
-
-        String startNode = from;
-        String endNode = to;
-
-        String roomConnectedToEntranceFrom = graph.findNodeConnectedToEntrance(from);
-        String roomConnectedToEntranceTo = graph.findNodeConnectedToEntrance(to);
-
-        if (roomConnectedToEntranceFrom != null) {
-            startNode = roomConnectedToEntranceFrom;
-        }
-        if (roomConnectedToEntranceTo != null) {
-            endNode = roomConnectedToEntranceTo;
-        }
-
-        List<MapNode> path = graph.findRoute(startNode, endNode);
-        return ResponseEntity.ok(path);
-    }
-
-
-    @GetMapping("/public/load-map")
-    public ResponseEntity<List<FloorDTO>> getMapData(@RequestParam String mapName) {
-        try {
-            IndoorMap map = mapService.getPublicMapByName(mapName);
-            List<Floor> floors  = floorService.getAllFloorsForMap(mapName);
-            this.graph = graphService.construct(floors);
-            return ResponseEntity.ok(Util.convertToFloorDTO(map.getFloors())); // tuka re
-        } catch (EmptyMapException e) {
-            e.printStackTrace();
-            System.out.println(e.getMessage());
-            return ResponseEntity.status(HttpStatus.NOT_FOUND).build();
-        }
-    }
-
-    @GetMapping("/protected/load-map")
-    public ResponseEntity<List<FloorDTO>> getMapDataProtected(@RequestParam String mapName, @RequestParam String username) {
-        try {
-            IndoorMap map = mapService.getMapForUser(username, mapName);// namesto ova samo proverka dali postoet dadena mapa za user, za da ne morat za dzabe mapa promenliva da se cuvat
-            List<Floor> floors  = floorService.getAllFloorsForMap(mapName);
-            this.graph = graphService.construct(floors);
-
-            return ResponseEntity.ok(Util.convertToFloorDTO(map.getFloors())); // tuka return site floors trebit
-        } catch (Exception e) {
-            e.printStackTrace();
-            System.out.println(e.getMessage());
-            return ResponseEntity.status(HttpStatus.NOT_FOUND).build();
-        }
-    }
-
-    @PostMapping("/protected/favourites/add")
-    public ResponseEntity<Map<String,Object>> addFavourites(@RequestParam String username, @RequestParam String mapName) {
-        try{
-            IndoorMap map = mapService.getMapByName(mapName);
-            IMapsUser user = userService.getUser(username);
-            userService.addToFavorites(user, map);
-            return ResponseEntity.ok(new HashMap<>());
-        } catch (Exception e){
-            e.printStackTrace();
-            return ResponseEntity.status(404).body(new HashMap<>());
-        }
-    }
-    @DeleteMapping("/protected/favourites/delete")
-    public ResponseEntity<Map<String,Object>> removeFavourites(@RequestParam String username, @RequestParam String mapName) {
-        try{
-            IndoorMap map = mapService.getMapByName(mapName);
-            IMapsUser user = userService.getUser(username);
-            userService.removeFromFavorites(user, map);
-            return ResponseEntity.ok(new HashMap<>());
-        } catch (Exception e){
-            e.printStackTrace();
-            return ResponseEntity.status(404).body(new HashMap<>());
-        }
-    }
-
-
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/UserController.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/UserController.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/controllers/UserController.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,40 @@
+package internettehnologii.imaps.backendRender.web.controllers;
+
+import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
+import internettehnologii.imaps.backendRender.web.service.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+//test klasa
+@RestController
+@RequestMapping(path = "api/v1/user")
+public class UserController {
+    private final UserService userService;
+
+    @Autowired
+    public UserController(UserService userService){
+        this.userService = userService;
+    }
+
+    @GetMapping
+    public List<IMapsUser> getUsers(){
+        return userService.getUsers();
+    }
+
+
+    @DeleteMapping(path = "{userId}")
+    public void deleteUser(@PathVariable("userId") Long userId){
+        userService.deleteUser(userId);
+    }
+
+    @PutMapping(path = "{userId}")
+    public void updateUser(
+            @PathVariable("userId") Long userId,
+            @RequestParam(required = false) String name,
+            @RequestParam(required = false) String email){
+        userService.updateUser(userId, name, email);
+    }
+}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/Floor.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/Floor.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,38 +1,0 @@
-package internettehnologii.imaps.backendRender.web.entities;
-
-import internettehnologii.imaps.backendRender.web.util.json.JsonMapData;
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import org.hibernate.annotations.JdbcTypeCode;
-import org.hibernate.type.SqlTypes;
-
-import java.time.LocalDateTime;
-
-@Entity
-@Table(name = "floors")
-@Getter @Setter
-@IdClass(FloorId.class)
-@ToString
-public class Floor {
-
-    @JdbcTypeCode(SqlTypes.JSON)
-    @Column(name = "map_data")
-    private JsonMapData mapData;
-
-    @Id
-    @Column(name = "num")
-    private int floorNumber;
-
-    @Id
-    @ManyToOne
-    @JoinColumn(name = "map_id",referencedColumnName = "id", nullable = false)
-    private IndoorMap indoorMap;
-
-    @PreUpdate
-    public void preUpdate() {
-        indoorMap.setModifiedAt(LocalDateTime.now());
-    }
-
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/FloorId.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/FloorId.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,27 +1,0 @@
-package internettehnologii.imaps.backendRender.web.entities;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.io.Serializable;
-import java.util.Objects;
-
-@Getter
-@Setter
-public class FloorId implements Serializable {
-    private int indoorMap;
-    private int floorNumber;
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        FloorId floorId = (FloorId) o;
-        return indoorMap == floorId.indoorMap && floorNumber == floorId.floorNumber;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(indoorMap, floorNumber);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/IMapsUser.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/IMapsUser.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/IMapsUser.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -1,44 +1,30 @@
 package internettehnologii.imaps.backendRender.web.entities;
-import internettehnologii.imaps.backendRender.web.entities.RBA.Role;
 import jakarta.persistence.*;
 import lombok.Getter;
 import lombok.Setter;
 
-import java.time.LocalDateTime;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
-
+@Getter
 @Entity
 @Table(name = "users")
-@Getter @Setter
 public class IMapsUser {
     @Id
-    @SequenceGenerator(name = "users_id_seq", sequenceName = "users_id_seq", allocationSize = 1)
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "users_id_seq")
+    @SequenceGenerator(
+            name = "users_id_seq",
+            sequenceName = "users_id_seq",
+            allocationSize = 1
+    )
+    @GeneratedValue(
+            strategy = GenerationType.SEQUENCE,
+            generator = "users_id_seq"
+    )
     private int id;
+    @Setter
+    @Column(name = "name")
     private String username;
+    @Setter
     private String email;
+    @Getter @Setter
     private String password;
 
-    @Column(name = "created_at")
-    private LocalDateTime createdAt;
-
-    @Column(name = "last_login_at")
-    private LocalDateTime lastLoginAt;
-
-    @Column(name = "profile_image_url")
-    private String profileImageUrl;
-
-    @ManyToMany
-    @JoinTable(
-            name = "favourites",
-            joinColumns = @JoinColumn(name = "user_id"),
-            inverseJoinColumns = @JoinColumn(name = "map_id")
-    )
-    private Set<IndoorMap> favoriteMaps;
-
-    @ManyToMany(mappedBy = "users",cascade = CascadeType.PERSIST)
-    private Set<Role> roles = new HashSet<>();
 
     public IMapsUser() {}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/IndoorMap.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/IndoorMap.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/IndoorMap.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -1,72 +1,129 @@
 package internettehnologii.imaps.backendRender.web.entities;
+import internettehnologii.imaps.backendRender.web.security.json.DataJson;
 import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import org.hibernate.annotations.JdbcTypeCode;
+import org.hibernate.type.SqlTypes;
 
 @Entity
-@Getter @Setter
 @Table(name = "maps")
 public class IndoorMap {
     @Id
-    @SequenceGenerator(name = "maps_id_seq", sequenceName = "maps_id_seq", allocationSize = 1)
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "maps_id_seq")
+    @SequenceGenerator(
+            name = "map_id_seq",
+            sequenceName = "map_id_seq",
+            allocationSize = 1
+    )
+    @GeneratedValue(
+            strategy = GenerationType.SEQUENCE,
+            generator = "map_id_seq"
+    )
     private Integer id;
+    private String name;
 
-    private String name = "";
+    @JdbcTypeCode(SqlTypes.JSON)
+    private DataJson mapData; //json
 
-    @Column(name = "gmaps_url")
-    private String gmapsUrl = "";
+    @JdbcTypeCode(SqlTypes.JSON)
+    private DataJson graphData; //json
 
-    @Enumerated(EnumType.STRING)
-    private MAP_STATUS status;
+    private boolean isPublic;
+    private String url;
 
-    @Column(name = "published_at")
-    private LocalDateTime publishedAt;
 
-    @Column(name = "created_at")
-    private LocalDateTime createdAt;
-
-    @Column(name = "modified_at")
-    private LocalDateTime modifiedAt;
-
-    @Column(name = "map_type")
-    private String mapType;
-
-    @Column(name = "image_url")
-    private String imageUrl;
-    @Column(name = "is_published")
-    private Boolean isPublished;
-
-    @ManyToOne
-    @JoinColumn(name = "usr_id",referencedColumnName = "id", nullable = false)
-    private IMapsUser user;
-
-    @OneToMany(mappedBy = "indoorMap")
-    private List<RoomType> roomTypes = new ArrayList<>();
-    @OneToMany(mappedBy = "indoorMap")
-    private List<Floor> floors = new ArrayList<>();
-    @ManyToMany(mappedBy = "favoriteMaps")
-    private Set<IMapsUser> favoritedBy = new HashSet<>();
-
-    @PrePersist
-    protected void onCreate(){
-        this.createdAt = LocalDateTime.now();
-        this.status = MAP_STATUS.PRIVATE;
+    public IndoorMap(String name, DataJson mapData, boolean isPublic, String url) {
+        this.name = name;
+        this.mapData = mapData;
+        this.isPublic = isPublic;
+        this.url = url;
     }
 
-    public int getFavouriteCount(){
-        return this.favoritedBy.size();
+    public IndoorMap() {
+
     }
 
-    @PreUpdate
-    protected void onUpdate(){
-        this.modifiedAt = LocalDateTime.now();
+    public IndoorMap(Integer id, String name, DataJson mapData, boolean isPublic, String url) {
+        this.id = id;
+        this.name = name;
+        this.mapData = mapData;
+        this.isPublic = isPublic;
+        this.url = url;
     }
 
+    public IndoorMap(Integer id, String name, DataJson mapData, DataJson graphData, boolean isPublic, String url) {
+        this.id = id;
+        this.name = name;
+        this.mapData = mapData;
+        this.graphData = graphData;
+        this.isPublic = isPublic;
+        this.url = url;
+    }
+
+    public IndoorMap(String name, DataJson mapData, DataJson graphData, boolean isPublic, String url) {
+        this.name = name;
+        this.mapData = mapData;
+        this.graphData = graphData;
+        this.isPublic = isPublic;
+        this.url = url;
+    }
+
+    public IndoorMap(String name, DataJson dataJson) {
+        this.name = name;
+        this.mapData = dataJson;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public DataJson getMapData() {
+        return mapData;
+    }
+
+    public DataJson getGraphData() {
+        return graphData;
+    }
+
+    public boolean isPublic() {
+        return isPublic;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setMapData(DataJson mapData) {
+        this.mapData = mapData;
+    }
+
+    public void setGraphData(DataJson graphData) {
+        this.graphData = graphData;
+    }
+
+    public void setPublic(boolean aPublic) {
+        isPublic = aPublic;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    @Override
+    public String toString() {
+        return "Map{" +
+                "id=" + id +
+                ", name='" + name + '\'' +
+                ", mapData='" + mapData + '\'' +
+                ", graphData='" + graphData + '\'' +
+                ", isPublic=" + isPublic +
+                ", url='" + url + '\'' +
+                '}';
+    }
 }
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/MAP_STATUS.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/MAP_STATUS.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package internettehnologii.imaps.backendRender.web.entities;
-
-public enum MAP_STATUS {
-    PUBLIC,
-    PRIVATE,
-    INVALID,
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/PublishRequest.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/PublishRequest.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,67 +1,0 @@
-package internettehnologii.imaps.backendRender.web.entities;
-
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.Setter;
-
-@Entity
-@Table(name = "publish_form")
-@Getter @Setter
-public class PublishRequest {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    private Integer id;
-    private String name;
-    @Column(name = "last_name")
-    private String lastName;
-    @Column(name = "gmaps_url")
-    private String gMapsUrl;
-    @Column(name = "map_type")
-    private String mapType;
-    private boolean resolved;
-
-    @ManyToOne
-    @JoinColumn(name = "user_id",referencedColumnName = "id")
-    private IMapsUser user;
-
-    @ManyToOne
-    @JoinColumn(name = "map_id",referencedColumnName = "id")
-    private IndoorMap map;
-
-    public PublishRequest(String name, String lastName, String googleMapsUrl, String mapType) {
-        this.name = name;
-        this.lastName = lastName;
-        this.gMapsUrl = googleMapsUrl;
-        this.mapType = mapType;
-
-    }
-    public PublishRequest() {
-        this.id = -1;
-        this.name = "";
-        this.lastName = "";
-        this.gMapsUrl = "";
-        this.mapType = "";
-        this.resolved = false;
-        this.map = new IndoorMap();
-    }
-
-    public PublishRequest(int id, String name, String lastName, String googleMapsUrl, String mapType) {
-        this.id = id;
-        this.name = name;
-        this.lastName = lastName;
-        this.gMapsUrl = googleMapsUrl;
-        this.mapType = mapType;
-    }
-
-    @Override
-    public String toString() {
-        return "PublishRequest{" +
-                "id=" + id +
-                ", name='" + name + '\'' +
-                ", lastName='" + lastName + '\'' +
-                ", gMapsUrl='" + gMapsUrl + '\'' +
-                ", mapType='" + mapType + '\'' +
-                ", resolved=" + resolved +
-                '}';
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/RBA/Permission.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/RBA/Permission.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,26 +1,0 @@
-package internettehnologii.imaps.backendRender.web.entities.RBA;
-
-import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
-import jakarta.persistence.*;
-
-import java.util.HashSet;
-import java.util.Set;
-
-@Entity
-@Table(name = "permissions")
-public class Permission {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    private int id;
-
-    @Column(nullable = false,unique = true)
-    private String name;
-
-    @ManyToMany
-    @JoinTable(
-            name = "roles_permissions",
-            joinColumns = @JoinColumn(name = "permission_id"),
-            inverseJoinColumns = @JoinColumn(name = "role_id")
-    )
-    private Set<Role> roles = new HashSet<>();
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/RBA/Role.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/RBA/Role.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,33 +1,0 @@
-package internettehnologii.imaps.backendRender.web.entities.RBA;
-
-import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
-import java.util.HashSet;
-import java.util.Set;
-
-@Entity
-@Table(name = "roles")
-@Getter @Setter
-public class Role {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    private int id;
-
-    @Column(nullable = false,unique = true)
-    private String name;
-
-    @ManyToMany
-    @JoinTable(
-            name = "users_roles",
-            joinColumns = @JoinColumn(name = "role_id"),
-            inverseJoinColumns = @JoinColumn(name = "user_id")
-    )
-    private Set<IMapsUser> users = new HashSet<>();
-
-    @ManyToMany(mappedBy = "roles")
-    private Set<Permission> permissions = new HashSet<>();
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/RoomType.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/entities/RoomType.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,29 +1,0 @@
-package internettehnologii.imaps.backendRender.web.entities;
-
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.Setter;
-
-@Entity
-@Table(name = "room_types")
-@Getter
-@Setter
-public class RoomType {
-    @Id
-    @SequenceGenerator(name = "room_types_id_seq", sequenceName = "room_types_id_seq", allocationSize = 1)
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "room_types_id_seq")
-    private int id;
-    private String name;
-    @ManyToOne
-    @JoinColumn(name = "map_id")
-    private IndoorMap indoorMap;
-
-    public RoomType(String name, IndoorMap map) {
-        this.name = name;
-        this.indoorMap = map;
-    }
-
-    public RoomType() {
-
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/EmailTakenException.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/EmailTakenException.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package internettehnologii.imaps.backendRender.web.exceptions;
-
-public class EmailTakenException extends RuntimeException {
-    public EmailTakenException(String message) {
-        super(message);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/EmptyMapException.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/EmptyMapException.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package internettehnologii.imaps.backendRender.web.exceptions;
-
-public class EmptyMapException extends RuntimeException {
-    public EmptyMapException(String message) {
-        super(message);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/FloorAlreadyExistsException.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/FloorAlreadyExistsException.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package internettehnologii.imaps.backendRender.web.exceptions;
-
-public class FloorAlreadyExistsException extends RuntimeException {
-    public FloorAlreadyExistsException(String message) {
-        super(message);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/FloorNotFoundException.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/FloorNotFoundException.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package internettehnologii.imaps.backendRender.web.exceptions;
-
-public class FloorNotFoundException extends RuntimeException {
-    public FloorNotFoundException(String message) {
-        super(message);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/InvalidParametersException.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/InvalidParametersException.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package internettehnologii.imaps.backendRender.web.exceptions;
-
-public class InvalidParametersException extends RuntimeException {
-    public InvalidParametersException(String message) {
-        super(message);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/MapNameTakenException.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/MapNameTakenException.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package internettehnologii.imaps.backendRender.web.exceptions;
-
-public class MapNameTakenException extends RuntimeException {
-    public MapNameTakenException(String message) {
-        super(message);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/MapNotFoundException.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/MapNotFoundException.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package internettehnologii.imaps.backendRender.web.exceptions;
-
-public class MapNotFoundException extends RuntimeException {
-    public MapNotFoundException(String message) {
-        super(message);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/UserNotFoundException.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/UserNotFoundException.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package internettehnologii.imaps.backendRender.web.exceptions;
-
-public class UserNotFoundException extends RuntimeException {
-    public UserNotFoundException(String message) {
-        super(message);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/UsernameTakenException.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/exceptions/UsernameTakenException.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package internettehnologii.imaps.backendRender.web.exceptions;
-
-public class UsernameTakenException extends RuntimeException {
-    public UsernameTakenException(String message) {
-        super(message);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/FloorRepository.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/FloorRepository.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,27 +1,0 @@
-package internettehnologii.imaps.backendRender.web.repo;
-
-import internettehnologii.imaps.backendRender.web.entities.Floor;
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.util.json.JsonMapData;
-import jakarta.transaction.Transactional;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Modifying;
-import org.springframework.data.jpa.repository.Query;
-
-import java.util.List;
-import java.util.Optional;
-
-public interface FloorRepository extends JpaRepository<Floor, Integer> {
-
-    @Query("FROM Floor f WHERE f.indoorMap.id = ?1")
-    Optional<List<Floor>> getAllFloorsForMapById(Integer indoorMapId);
-
-    @Query("FROM Floor f WHERE f.floorNumber = ?1 AND f.indoorMap = ?2")
-    Optional<Floor> findFloorByFloorNumber(Integer floorNumber, IndoorMap indoorMap);
-
-    @Query("SELECT COUNT(f) > 0 FROM Floor f WHERE f.floorNumber = ?1 AND f.indoorMap = ?2")
-    boolean existsFloorForMap(Integer floorNumber, IndoorMap indoorMap);
-
-    void deleteFloorByFloorNumberAndIndoorMap(Integer floorNumber,IndoorMap indoorMap);
-    Optional<Floor> findFloorByFloorNumberAndIndoorMap(Integer floorNumber,IndoorMap indoorMap);
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/MapRepository.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/MapRepository.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/MapRepository.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -1,14 +1,11 @@
 package internettehnologii.imaps.backendRender.web.repo;
 
-import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
 import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.entities.MAP_STATUS;
-import internettehnologii.imaps.backendRender.web.util.json.JsonMapData;
+import internettehnologii.imaps.backendRender.web.security.json.DataJson;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
-import java.util.List;
 import java.util.Optional;
 
@@ -16,4 +13,13 @@
 public interface MapRepository extends JpaRepository<IndoorMap, Long> {
 
+//    @Modifying
+//    @Query(nativeQuery = true,
+//            value = "UPDATE maps SET map_data = ?2 WHERE name = ?1")
+//    void updateMapData(IndoorMap map);
+//
+//    @Modifying
+//    @Query(nativeQuery = true,
+//            value = "INSERT INTO maps(name,map_data) VALUES (?1, ?2)")
+//    void insertMapData(String name, DataJson data);
 
     @Query(nativeQuery = true,
@@ -21,21 +27,8 @@
     Optional<IndoorMap> findMapByName(String name);
 
-    @Query("FROM IndoorMap m WHERE m.status = ?1")
-    Optional<List<IndoorMap>> findAllByStatus(MAP_STATUS status);
-
-    @Query("FROM IndoorMap m WHERE m.user.id = ?1")
-    Optional<List<IndoorMap>> findAllMapsForUser(long userId);
-
-    @Query("FROM IndoorMap m WHERE m.status = 'PUBLIC'")
-    Optional<List<IndoorMap>> findAllPublicMaps();
-
-    @Query("FROM IndoorMap m WHERE m.user = ?1 AND m.id = ?2")
-    Optional<IndoorMap> getMapForUser(IMapsUser user, int mapId);
-
-    boolean existsByName(String name);
+    @Query(nativeQuery = true,
+            value = "SELECT maps.map_data FROM map WHERE name = ?1")
+    Optional<DataJson> findMapDataByName(String name);
 
 
-    Optional<IndoorMap> getIndoorMapByName(String name);
-    @Query(value = "FROM IndoorMap m where m.name = ?1 and m.status = ?2")
-    Optional<IndoorMap> getIndoorMapByNameAndStatus(String name, MAP_STATUS status);
 }
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/PublishRequestRepository.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/PublishRequestRepository.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,21 +1,0 @@
-package internettehnologii.imaps.backendRender.web.repo;
-
-import internettehnologii.imaps.backendRender.web.entities.PublishRequest;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-import java.util.Optional;
-
-@Repository
-public interface PublishRequestRepository extends JpaRepository<PublishRequest, Integer> {
-    @Query(value = "FROM PublishRequest p WHERE p.resolved = false")
-    Optional<List<PublishRequest>> findAllNotResolved();
-
-    @Query(value = "FROM PublishRequest pr WHERE pr.map.name = ?1")
-    Optional<PublishRequest> findByMapName(String mapName);
-
-    boolean existsByMapName(String mapName);
-
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/RoleRepository.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/RoleRepository.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,12 +1,0 @@
-package internettehnologii.imaps.backendRender.web.repo;
-
-import internettehnologii.imaps.backendRender.web.entities.RBA.Role;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-import java.util.Optional;
-
-@Repository
-public interface RoleRepository extends JpaRepository<Role, Integer> {
-    Optional<Role> findByName(String name);
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/RoomTypeRepository.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/RoomTypeRepository.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,10 +1,0 @@
-package internettehnologii.imaps.backendRender.web.repo;
-
-import internettehnologii.imaps.backendRender.web.entities.RoomType;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface RoomTypeRepository extends JpaRepository<RoomType, Integer> {
-
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/UserRepository.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/UserRepository.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/repo/UserRepository.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -11,4 +11,6 @@
 public interface UserRepository extends JpaRepository<IMapsUser, Long> {
 
+    // za da testiras queries, kaj so imat specijalen karakter primer @, moras vo navodnici da klajs.
+
     @Query(nativeQuery = true,
             value = "SELECT * FROM users u WHERE email= :usremail LIMIT 1")
@@ -16,12 +18,10 @@
 
     @Query(nativeQuery = true,
-    value = "SELECT * FROM users u WHERE u.username = ?1 LIMIT 1")
-    Optional<IMapsUser> findUserByName(String usrname);
-
-    @Query(value = "FROM IMapsUser u WHERE u.username = ?1 OR u.email = ?1")
-    Optional<IMapsUser> getIMapsUserByUsernameOrEmail(String usernameOrEmail);
+    value = "SELECT * FROM users u WHERE u.name = ?1 LIMIT 1")
+    IMapsUser findUserByName(String usrname);
 
     @Query(nativeQuery = true,
     value = "SELECT * FROM users u WHERE u.id= ?1")
-    Optional<IMapsUser> getUserById(Long usrid);
+    IMapsUser getUserById(Long usrid);
+
 }
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/JwtFilter.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/JwtFilter.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/JwtFilter.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -1,6 +1,6 @@
 package internettehnologii.imaps.backendRender.web.security;
 
-import internettehnologii.imaps.backendRender.web.service.impl.JWTService;
-import internettehnologii.imaps.backendRender.web.service.impl.MapUserDetailsService;
+import internettehnologii.imaps.backendRender.web.service.JWTService;
+import internettehnologii.imaps.backendRender.web.service.MapUserDetailsService;
 import jakarta.servlet.FilterChain;
 import jakarta.servlet.ServletException;
@@ -52,6 +52,5 @@
                     UserDetails userDetails = context.getBean(MapUserDetailsService.class).loadUserByUsername(username);
                     if(jwtService.validateToken(token,userDetails)){
-                        UsernamePasswordAuthenticationToken upAuthToken = new UsernamePasswordAuthenticationToken(userDetails, null, jwtService.getAuthorities(token));
-                        System.out.println("TOKEN CLAIMS: " + jwtService.getAuthorities(token));
+                        UsernamePasswordAuthenticationToken upAuthToken = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
                         upAuthToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
                         SecurityContextHolder.getContext().setAuthentication(upAuthToken);
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/WebSecurityConfig.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/WebSecurityConfig.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/WebSecurityConfig.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -1,5 +1,5 @@
 package internettehnologii.imaps.backendRender.web.security;
 
-import internettehnologii.imaps.backendRender.web.service.impl.MapUserDetailsService;
+import internettehnologii.imaps.backendRender.web.service.MapUserDetailsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
@@ -36,11 +36,8 @@
                  .csrf(AbstractHttpConfigurer::disable)
                  .cors(Customizer.withDefaults())
-                 .authorizeHttpRequests(request ->
-                         request.requestMatchers("/protected/**")
-                         .hasRole("USER")
-                         .requestMatchers("/api/admin/**")
-                         .hasRole("ADMIN")
+                 .authorizeHttpRequests(request -> request.requestMatchers("/api/auth/**","api/public/**")
+                         .permitAll()
                          .anyRequest()
-                         .permitAll())
+                         .authenticated())
                  .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
                  .addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter.class);
@@ -67,4 +64,6 @@
 
 
+    //TODO password encoding
+
     @Bean
     public AuthenticationProvider authenticationProvider() {
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/json/DataJson.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/json/DataJson.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/json/DataJson.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,23 @@
+package internettehnologii.imaps.backendRender.web.security.json;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+@Setter
+@Getter
+public class DataJson implements Serializable {
+    private String textData;
+    private byte binaryData;
+
+    public DataJson(String textData) {
+        this.textData = textData;
+    }
+
+    public DataJson(byte binaryData) {
+        this.binaryData = binaryData;
+    }
+
+    public DataJson() {}
+}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/json/JsonNodeConverter.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/json/JsonNodeConverter.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/security/json/JsonNodeConverter.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,38 @@
+package internettehnologii.imaps.backendRender.web.security.json;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
+
+import java.io.IOException;
+
+@Converter(autoApply = true)
+public class JsonNodeConverter implements AttributeConverter<JsonNode, String> {
+
+    private static final ObjectMapper objectMapper = new ObjectMapper();
+
+    @Override
+    public String convertToDatabaseColumn(JsonNode jsonNode) {
+        if (jsonNode == null) {
+            return null;
+        }
+        try {
+            return objectMapper.writeValueAsString(jsonNode);
+        } catch (IOException e) {
+            throw new RuntimeException("Failed to convert JsonNode to String", e);
+        }
+    }
+
+    @Override
+    public JsonNode convertToEntityAttribute(String json) {
+        if (json == null) {
+            return null;
+        }
+        try {
+            return objectMapper.readTree(json);
+        } catch (IOException e) {
+            throw new RuntimeException("Failed to convert String to JsonNode", e);
+        }
+    }
+}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/JWTService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/JWTService.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/JWTService.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,89 @@
+package internettehnologii.imaps.backendRender.web.service;
+
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.security.Keys;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.stereotype.Service;
+
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+import java.security.Key;
+import java.security.NoSuchAlgorithmException;
+import java.security.SignatureException;
+import java.util.Base64;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.prefs.BackingStoreException;
+
+
+@Service
+public class JWTService {
+
+    private final String secretKey;
+
+    public JWTService(){
+        try {
+            KeyGenerator keyGen = KeyGenerator.getInstance("HmacSHA256");
+            SecretKey sk = keyGen.generateKey();
+            secretKey = Base64.getEncoder().encodeToString(sk.getEncoded());
+        } catch (NoSuchAlgorithmException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+    public String generateToken(String username){
+        Map<String,Object> claims = new HashMap<>();
+        return Jwts
+                .builder()
+                .claims()
+                .add(claims)
+                .subject(username)
+                .issuedAt(new Date(System.currentTimeMillis()))
+                .expiration(new Date(System.currentTimeMillis() + 60 * 60 * 1000))
+                .and()
+                .signWith(getKey())
+                .compact();
+    }
+
+    private SecretKey getKey(){
+        byte[] keyBytes = secretKey.getBytes();
+        return Keys.hmacShaKeyFor(keyBytes);
+    }
+
+    public String extractUsername(String token) {
+        return extractClaim(token, Claims::getSubject);
+    }
+
+    private Claims extractAllClaims(String token){
+        return Jwts
+                .parser()
+                .verifyWith(getKey())
+                .build()
+                .parseSignedClaims(token)
+                .getPayload();
+
+    }
+
+    private <T> T extractClaim(String token, Function<Claims,T> claimResolver){
+        final Claims claims = extractAllClaims(token);
+        return claimResolver.apply(claims);
+    }
+
+    public boolean validateToken(String token, UserDetails details) {
+        final String username = extractUsername(token);
+        return username.equals(details.getUsername()) && !isTokenExpired(token);
+    }
+
+    private boolean isTokenExpired(String token) {
+        return extractExpiration(token).before(new Date());
+    }
+
+    private Date extractExpiration(String token) {
+        return extractClaim(token, Claims::getExpiration);
+    }
+}
+
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/MapService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/MapService.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/MapService.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,73 @@
+package internettehnologii.imaps.backendRender.web.service;
+
+import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
+import internettehnologii.imaps.backendRender.web.repo.MapRepository;
+import internettehnologii.imaps.backendRender.web.security.json.DataJson;
+import jakarta.transaction.Transactional;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+@Service
+public class MapService {
+    private final MapRepository mapRepository;
+
+    @Autowired
+    public MapService(MapRepository mapRepository) {
+        this.mapRepository = mapRepository;
+    }
+
+    public List<IndoorMap> getMaps() {
+        return mapRepository.findAll();
+    }
+
+    public void addNewMap(IndoorMap map) {
+        mapRepository.save(map);
+    }
+
+
+    public void deleteMap(Long mapId) {
+        boolean exists = mapRepository.existsById(mapId);
+        if (!exists) {
+            throw new IllegalStateException("Map with id: " + mapId + " does not exist");
+        }
+        mapRepository.deleteById(mapId);
+
+    }
+
+    public Optional<IndoorMap> getMapById(Long id) {
+        return mapRepository.findById(id);
+    }
+
+
+    // repository.save zavisit od state na object sho sakas da zacuvas. Ako napres direktno new obj, pa save, pret INSERT, a ako napres get na object od baza pa mu setnis attrib so setter pa save, pret UPDATE.
+    @Transactional
+    public void saveMap(String name, String mapData) {
+        Optional<IndoorMap> indoorMap = mapRepository.findMapByName(name);
+        indoorMap.ifPresentOrElse(map -> {
+            map.setName(name);
+            map.setMapData(new DataJson(mapData));
+            mapRepository.save(map);
+        },() -> {
+            IndoorMap map = new IndoorMap(name,new DataJson(mapData));
+            mapRepository.save(map);
+        });
+
+    }
+
+    public Optional<IndoorMap> getMapByName(String name) {
+        return mapRepository.findMapByName(name);
+    }
+
+
+    @Transactional
+    public void updateMap(String mapName, DataJson mapData) {
+        IndoorMap map = mapRepository.findMapByName(mapName).orElseThrow(() -> new IllegalStateException("map with name " + mapName + " does not exist"));
+        if (mapName != null && !mapName.isEmpty() && !Objects.equals(map.getName(), mapName)) {
+            map.setMapData(mapData);
+        }
+    }
+}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/MapUserDetailsService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/MapUserDetailsService.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/MapUserDetailsService.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,26 @@
+package internettehnologii.imaps.backendRender.web.service;
+
+
+import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
+import internettehnologii.imaps.backendRender.web.repo.UserRepository;
+import internettehnologii.imaps.backendRender.web.util.UserPrincipal;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.core.userdetails.UsernameNotFoundException;
+import org.springframework.stereotype.Service;
+
+@Service
+public class MapUserDetailsService implements UserDetailsService {
+    @Autowired
+    private UserRepository userRepository;
+    @Override
+    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
+       IMapsUser user = userRepository.findUserByName(username);
+       if(user == null) {
+           throw new UsernameNotFoundException(username);
+       }
+
+       return new UserPrincipal(user);
+    }
+}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/UserService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/UserService.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/UserService.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,86 @@
+package internettehnologii.imaps.backendRender.web.service;
+
+import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
+import internettehnologii.imaps.backendRender.web.repo.UserRepository;
+import jakarta.transaction.Transactional;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.AuthenticationManager;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+@Service
+public class UserService {
+
+    @Autowired
+    private final UserRepository userRepository;
+
+    private final BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder(12);
+    @Autowired
+    private JWTService jwtService;
+
+    @Autowired
+    private AuthenticationManager authenticationManager;
+
+    @Autowired
+    public UserService(UserRepository userRepository){
+        this.userRepository = userRepository;
+    }
+
+    public List<IMapsUser> getUsers(){
+        return userRepository.findAll();
+    }
+
+    public IMapsUser register(IMapsUser user) {
+        Optional<IMapsUser> usrOptional = userRepository.findUserByEmail(user.getEmail());
+        if(usrOptional.isPresent()){
+            throw new IllegalStateException("email taken");
+        }
+
+        user.setPassword(bCryptPasswordEncoder.encode(user.getPassword()));
+        return userRepository.save(user);
+    }
+
+    public void deleteUser(Long userId) {
+        boolean exists = userRepository.existsById(userId);
+        if(!exists){
+            throw new IllegalStateException("User with id: " + userId + " does not exist");
+        }
+        userRepository.deleteById(userId);
+    }
+
+    @Transactional
+    public void updateUser(Long userId, String name, String email) {
+        IMapsUser user = userRepository.findById(userId).orElseThrow(() -> new IllegalStateException("user with id " + userId + " does not exist"));
+        if(name != null && !name.isEmpty() && !Objects.equals(user.getUsername(), name)){
+            user.setUsername(name);
+        }
+
+        if(email != null && !email.isEmpty() && !Objects.equals(user.getEmail(), email)){
+            Optional<IMapsUser> userOptional = userRepository.findUserByEmail(email);
+            if(userOptional.isPresent()){
+                throw new IllegalStateException("email taken");
+            }
+
+            user.setEmail(email);
+        }
+    }
+
+    public String verify(IMapsUser user) {
+        Authentication authentication =
+                authenticationManager.authenticate(
+                        new UsernamePasswordAuthenticationToken(user.getUsername(), user.getPassword()));
+
+        if(authentication.isAuthenticated()){
+            return jwtService.generateToken(user.getUsername());
+        }
+
+        return "Auth failed";
+    }
+
+}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/FloorServiceImpl.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/FloorServiceImpl.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,76 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.impl;
-
-import internettehnologii.imaps.backendRender.web.exceptions.*;
-import internettehnologii.imaps.backendRender.web.entities.Floor;
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.repo.FloorRepository;
-import internettehnologii.imaps.backendRender.web.repo.MapRepository;
-import internettehnologii.imaps.backendRender.web.service.interfaces.FloorService;
-import jakarta.transaction.Transactional;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-
-@Service
-public class FloorServiceImpl implements FloorService {
-
-    private final FloorRepository floorRepository;
-    private final MapRepository mapRepository;
-
-    @Autowired
-    public FloorServiceImpl(FloorRepository floorRepository, MapRepository mapRepository) {
-        this.floorRepository = floorRepository;
-        this.mapRepository = mapRepository;
-    }
-
-    @Override
-    public void addFloor(int num, String mapName) {
-        IndoorMap indoorMap = mapRepository.findMapByName(mapName).orElseThrow(() -> new MapNotFoundException(mapName));
-
-        if(floorRepository.existsFloorForMap(num,indoorMap)){
-            throw new FloorAlreadyExistsException("Floor: " + num + " already exists for map: " + indoorMap.getName());
-        }
-
-        Floor floor = new Floor();
-        floor.setFloorNumber(num);
-        floor.setIndoorMap(indoorMap);
-        floorRepository.save(floor);
-    }
-
-    @Override
-    public void updateFloor(Floor floor) {
-        floorRepository.save(floor);
-    }
-
-    @Transactional
-    @Override
-    public void deleteFloor(int floorNum,String mapName) {
-        IndoorMap map = mapRepository.findMapByName(mapName).orElseThrow(() -> new MapNotFoundException(mapName));
-        if(!floorRepository.existsFloorForMap(floorNum,map)) throw new FloorNotFoundException("Floor: " + floorNum + " does not exist for map: " + map.getName());
-
-        floorRepository.deleteFloorByFloorNumberAndIndoorMap(floorNum,map);
-    }
-
-    @Override
-    public List<Floor> getAllFloorsForMap(String mapName) {
-        IndoorMap map = mapRepository.findMapByName(mapName).orElseThrow(() -> new MapNotFoundException(mapName));
-
-        return floorRepository.getAllFloorsForMapById(map.getId()).orElseGet(ArrayList::new);
-    }
-
-    @Override
-    public Floor getFloorByNum(Integer floorNum, IndoorMap indoorMap) throws InvalidParametersException {
-
-        return indoorMap
-                .getFloors()
-                .stream()
-                .filter(floor -> floor.getFloorNumber() == floorNum)
-                .findFirst()
-                .orElseThrow(() -> new InvalidParametersException("Could not find floor.\n floorNum: " + floorNum + "\n indoorMap: " + indoorMap));
-    }
-
-
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/GraphServiceImpl.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/GraphServiceImpl.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,33 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.impl;
-
-import internettehnologii.imaps.backendRender.graph.MapNode;
-import internettehnologii.imaps.backendRender.graph.MapNodeParser;
-import internettehnologii.imaps.backendRender.graph.RouteGraph;
-import internettehnologii.imaps.backendRender.web.entities.Floor;
-import internettehnologii.imaps.backendRender.web.service.interfaces.GraphService;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class GraphServiceImpl implements GraphService {
-    @Override
-    public RouteGraph construct(List<Floor> floors) {
-        RouteGraph graph = new RouteGraph();
-        MapNodeParser parser = new MapNodeParser();
-
-        floors.forEach(floor -> {
-            try {
-                List<MapNode> nodes = parser.parseAndCreate(floor.getMapData().getShapeData());
-                graph.loadNodeNames(nodes);
-            } catch (Exception e) {
-                System.out.println("Nodes for floor " + floor.getFloorNumber() + " could not be parsed. " + e.getMessage());
-                e.printStackTrace();
-            }
-        });
-
-        graph.loadEdges();
-
-        return graph;
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/JWTService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/JWTService.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,100 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.impl;
-
-import io.jsonwebtoken.Claims;
-import io.jsonwebtoken.Jwts;
-import io.jsonwebtoken.security.Keys;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
-import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.stereotype.Service;
-
-import javax.crypto.KeyGenerator;
-import javax.crypto.SecretKey;
-import java.security.NoSuchAlgorithmException;
-import java.util.*;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-
-@Service
-public class JWTService {
-
-    private final String secretKey;
-
-    public JWTService(){
-        try {
-            KeyGenerator keyGen = KeyGenerator.getInstance("HmacSHA256");
-            SecretKey sk = keyGen.generateKey();
-            secretKey = Base64.getEncoder().encodeToString(sk.getEncoded());
-        } catch (NoSuchAlgorithmException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-
-    public String generateToken(UserDetails userDetails){
-        Map<String,Object> claims = new HashMap<>();
-        String authorities = userDetails.getAuthorities().stream()
-                .map(GrantedAuthority::getAuthority)
-                .collect(Collectors.joining(","));
-        claims.put("roles", authorities);
-        
-        return Jwts
-                .builder()
-                .claims()
-                .add(claims)
-                .subject(userDetails.getUsername())
-                .issuedAt(new Date(System.currentTimeMillis()))
-                .expiration(new Date(System.currentTimeMillis() + 60 * 60 * 1000)) // 1 sat traet token
-                .and()
-                .signWith(getKey())
-                .compact();
-    }
-
-    public Collection<GrantedAuthority> getAuthorities(String token){
-        Claims claims = extractAllClaims(token);
-        String roles = claims.get("roles", String.class);
-
-        return Arrays.stream(roles.split(","))
-                .map(SimpleGrantedAuthority::new)
-                .collect(Collectors.toList());
-    }
-
-    private SecretKey getKey(){
-        byte[] keyBytes = secretKey.getBytes();
-        return Keys.hmacShaKeyFor(keyBytes);
-    }
-
-    public String extractUsername(String token) {
-        return extractClaim(token, Claims::getSubject);
-    }
-
-    private Claims extractAllClaims(String token){
-        return Jwts
-                .parser()
-                .verifyWith(getKey())
-                .build()
-                .parseSignedClaims(token)
-                .getPayload();
-
-    }
-
-    private <T> T extractClaim(String token, Function<Claims,T> claimResolver){
-        final Claims claims = extractAllClaims(token);
-        return claimResolver.apply(claims);
-    }
-
-    public boolean validateToken(String token, UserDetails details) {
-        final String username = extractUsername(token);
-        return username.equals(details.getUsername()) && !isTokenExpired(token);
-    }
-
-    private boolean isTokenExpired(String token) {
-        return extractExpiration(token).before(new Date());
-    }
-
-    private Date extractExpiration(String token) {
-        return extractClaim(token, Claims::getExpiration);
-    }
-}
-
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/MapServiceImpl.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/MapServiceImpl.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,194 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.impl;
-
-import internettehnologii.imaps.backendRender.web.entities.*;
-import internettehnologii.imaps.backendRender.web.exceptions.MapNameTakenException;
-import internettehnologii.imaps.backendRender.web.exceptions.MapNotFoundException;
-import internettehnologii.imaps.backendRender.web.repo.FloorRepository;
-import internettehnologii.imaps.backendRender.web.repo.MapRepository;
-import internettehnologii.imaps.backendRender.web.repo.UserRepository;
-import internettehnologii.imaps.backendRender.web.service.interfaces.MapService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.core.userdetails.UsernameNotFoundException;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-
-@Service
-public class MapServiceImpl implements MapService {
-    private final MapRepository mapRepository;
-    private final UserRepository userRepository;
-    private final FloorRepository floorRepository;
-
-    @Autowired
-    public MapServiceImpl(MapRepository mapRepository, UserRepository userRepository, FloorRepository floorRepository) {
-        this.mapRepository = mapRepository;
-        this.userRepository = userRepository;
-        this.floorRepository = floorRepository;
-    }
-
-    @Override
-    public void createMap(String mapName,String mapType, String username) {
-
-        Optional<IMapsUser> user = userRepository.findUserByName(username);
-
-        if (mapRepository.existsByName(mapName))
-            throw new MapNameTakenException("Map with name " + mapName + " already exists");
-
-        if(user.isEmpty()){
-            throw new UsernameNotFoundException("User " + username + " not found");
-        }
-
-        IndoorMap indoorMap = new IndoorMap();
-        indoorMap.setName(mapName);
-        indoorMap.setUser(user.get());
-
-        Floor floor = new Floor();
-        floor.setFloorNumber(0);
-        floor.setIndoorMap(indoorMap);
-
-        mapRepository.save(indoorMap);
-        floorRepository.save(floor);
-
-    }
-
-    @Override
-    public void updateMap(IndoorMap indoorMap) {
-        mapRepository.save(indoorMap);
-    }
-
-    @Override
-    public void deleteMap(IndoorMap indoorMap) {
-        mapRepository.delete(indoorMap);
-    }
-
-    @Override
-    public List<IndoorMap> getAllMapsForUser(String username) {
-        IMapsUser user = userRepository.findUserByName(username).orElseThrow(() -> new UsernameNotFoundException(username));
-        Optional<List<IndoorMap>> indoorMaps = mapRepository.findAllMapsForUser(user.getId());
-        return indoorMaps.orElseGet(ArrayList::new);
-    }
-
-    @Override
-    public List<IndoorMap> getPublicMaps() {
-        Optional<List<IndoorMap>> maps = mapRepository.findAllByStatus(MAP_STATUS.PUBLIC);
-        return maps.orElseGet(ArrayList::new);
-    }
-
-    @Override
-    public IndoorMap getMapForUser(String username, String mapName) {
-        IMapsUser user = userRepository.findUserByName(username).orElseThrow(() -> new UsernameNotFoundException(username));
-        IndoorMap map = mapRepository.findMapByName(mapName).orElseThrow(() -> new MapNotFoundException(mapName));
-
-        boolean isAdmin = user.getRoles().stream().anyMatch(role -> Objects.equals(role.getName(), "ADMIN"));
-
-        if(isAdmin){
-            return map;
-        }
-
-        return mapRepository.getMapForUser(user, map.getId()).orElseThrow(() -> new MapNotFoundException("No map found for user: " + username));
-    }
-
-    @Override
-    public IndoorMap getPublicMapByName(String mapName) {
-        return mapRepository.getIndoorMapByNameAndStatus(mapName, MAP_STATUS.PUBLIC).orElseThrow(() -> new MapNotFoundException(mapName));
-    }
-
-    @Override
-    public IndoorMap getMapByName(String mapName) {
-       return mapRepository.getIndoorMapByName(mapName).orElseThrow(() -> new MapNotFoundException(mapName));
-    }
-
-    @Override
-    public List<IndoorMap> findByStatus(MAP_STATUS status) {
-        return mapRepository.findAllByStatus(status).orElseGet(ArrayList::new);
-    }
-
-
-//    public List<IndoorMap> getMaps() {
-//        return mapRepository.findAll();
-//    }
-//
-//    public void addNewMap(IndoorMap map) {
-//        getMapByName(map.getName())
-//                .ifPresentOrElse(lMap -> {
-//                    System.out.println("Map with name " + map.getName() + " already exists");
-//                }, () -> mapRepository.save(map));
-//    }
-//
-//
-//    public void deleteMap(Long mapId) {
-//        boolean exists = mapRepository.existsById(mapId);
-//        if (!exists) {
-//            throw new IllegalStateException("Map with id: " + mapId + " does not exist");
-//        }
-//        mapRepository.deleteById(mapId);
-//
-//    }
-//
-//    public Optional<IndoorMap> getMapById(Long id) {
-//        return mapRepository.findById(id);
-//    }
-
-//    public Optional<List<IndoorMap>> findAllPublicMaps(){
-//       return mapRepository.findAllByStatus(true);
-//    }
-//    public Optional<List<IndoorMap>> findAllPersonalMaps(){
-//        return mapRepository.findAllByStatus(false);
-//    }
-
-//    public Optional<List<IndoorMap>> findAllMapsByPublicStatus(boolean publicStatus) {
-//        return mapRepository.findAllByStatus(publicStatus);
-//    }
-//
-//    // repository.save zavisit od state na object sho sakas da zacuvas. Ako napres direktno new obj, pa save, pret INSERT, a ako napres get na object od baza pa mu setnis attrib so setter pa save, pret UPDATE.
-//    @Transactional
-//    public void saveFloor(String mapName, String mapData,int floorNum) {
-//        Optional<IndoorMap> indoorMap = mapRepository.findMapByName(mapName);
-//
-//        if(indoorMap.isPresent()) {
-//            Optional<Floor> floor = mapRepository.getFloorForMap(indoorMap.get().getId(), floorNum);
-//            if(floor.isPresent()) {
-//
-//            }
-//        }
-//
-//        indoorMap.ifPresentOrElse(map -> {
-//            map.setName(mapName);
-//            map.setMapData(new DataJson(mapData));
-//            mapRepository.save(map);
-//        }, () -> {
-//            System.out.println("Map with name: " + mapName + " does not exist");
-//        });
-//    }
-//
-//    public Optional<IndoorMap> getMapByName(String name) {
-//        return mapRepository.findMapByName(name);
-//    }
-//
-//    public Floor getFloorForMap(String mapName, int floorNum) {
-//        Optional<IndoorMap> map = mapRepository.findMapByName(mapName);
-//
-//        if(map.isPresent()) {
-//            Optional<Floor> floor = mapRepository.getFloorForMap(map.get().getId(), floorNum);
-//            if(floor.isPresent()) {
-//                return floor.get();
-//            } else {
-//                throw new FloorNotFoundException("Floor num: " + floorNum + "for map with name " + mapName + " does not exist")
-//            }
-//        } else {
-//            throw new MapNotFoundException("Map with name: " + mapName + " does not exist");
-//        }
-//    }
-//
-//
-//    @Transactional
-//    public void updateMap(String mapName, DataJson mapData) {
-//        IndoorMap map = mapRepository.findMapByName(mapName).orElseThrow(() -> new IllegalStateException("map with name " + mapName + " does not exist"));
-//        if (mapName != null && !mapName.isEmpty() && !Objects.equals(map.getName(), mapName)) {
-//            map.setMapData(mapData);
-//        }
-//    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/MapUserDetailsService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/MapUserDetailsService.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,31 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.impl;
-
-
-import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
-import internettehnologii.imaps.backendRender.web.repo.UserRepository;
-import internettehnologii.imaps.backendRender.web.util.UserPrincipal;
-import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.security.core.userdetails.UserDetailsService;
-import org.springframework.security.core.userdetails.UsernameNotFoundException;
-import org.springframework.stereotype.Service;
-
-import java.util.Optional;
-
-@Service
-public class MapUserDetailsService implements UserDetailsService {
-    private final UserRepository userRepository;
-
-    public MapUserDetailsService(UserRepository userRepository) {
-        this.userRepository = userRepository;
-    }
-
-    @Override
-    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
-       Optional<IMapsUser> user = userRepository.findUserByName(username);
-       if(user.isEmpty()) {
-           throw new UsernameNotFoundException(username);
-       }
-
-       return new UserPrincipal(user.get());
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/PublishRequestServiceImpl.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/PublishRequestServiceImpl.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,115 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.impl;
-
-import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.entities.MAP_STATUS;
-import internettehnologii.imaps.backendRender.web.entities.PublishRequest;
-import internettehnologii.imaps.backendRender.web.repo.MapRepository;
-import internettehnologii.imaps.backendRender.web.repo.PublishRequestRepository;
-import internettehnologii.imaps.backendRender.web.service.interfaces.MapService;
-import internettehnologii.imaps.backendRender.web.service.interfaces.PublishRequestService;
-import internettehnologii.imaps.backendRender.web.service.interfaces.UserService;
-import internettehnologii.imaps.backendRender.web.util.DTO.PublishMapDTO;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-import java.util.Optional;
-
-@Service
-public class PublishRequestServiceImpl implements PublishRequestService {
-    private final PublishRequestRepository publishRequestRepository;
-    private final MapRepository mapRepository;
-    private final MapService mapService;
-    private final UserService userService;
-
-    public PublishRequestServiceImpl(PublishRequestRepository publishRequestRepository, MapRepository mapRepository, MapService mapService, UserService userService) {
-        this.publishRequestRepository = publishRequestRepository;
-        this.mapRepository = mapRepository;
-        this.mapService = mapService;
-        this.userService = userService;
-    }
-
-    @Override
-    public void addPublishRequest(PublishMapDTO formData, IMapsUser user) {
-        Optional<PublishRequest> prOptional = publishRequestRepository.findById(formData.getId());
-        PublishRequest pr;
-        IndoorMap map = mapService.getMapByName(formData.getMapName());
-        if (prOptional.isPresent()) {
-            pr = prOptional.get();
-            pr.setName(formData.getName());
-            pr.setLastName(formData.getLastName());
-            pr.setGMapsUrl(formData.getGoogleMapsUrl());
-            pr.setMapType(formData.getMapType());
-            map.setStatus(MAP_STATUS.INVALID);
-        } else {
-            pr = new PublishRequest(formData.getName(), formData.getLastName(), formData.getGoogleMapsUrl(), formData.getMapType());
-
-            pr.setMap(map);
-            pr.setUser(user);
-            map.setStatus(MAP_STATUS.INVALID);
-
-        }
-        this.mapRepository.save(map);
-        this.publishRequestRepository.save(pr);
-
-    }
-
-    @Override
-    public void denyPublishRequest(int id) throws Exception {
-        PublishRequest pr = this.publishRequestRepository.findById(id).orElseThrow(Exception::new);
-
-        pr.setResolved(true);
-        IndoorMap map = pr.getMap();
-        map.setStatus(MAP_STATUS.PRIVATE);
-        map.setIsPublished(false);
-
-        this.publishRequestRepository.save(pr);
-        this.mapRepository.save(map);
-    }
-
-    @Override
-    public List<PublishRequest> getAllPublishRequests() {
-        return this.publishRequestRepository.findAll();
-    }
-
-    @Override
-    public void save(PublishRequest publishRequest) {
-
-    }
-
-    // todo mail pustanje
-
-    @Override
-    public void approvePublishRequest(int id) throws Exception {
-        PublishRequest pr = this.publishRequestRepository.findById(id).orElseThrow(Exception::new);
-
-        pr.setResolved(true);
-        IndoorMap map = pr.getMap();
-        map.setStatus(MAP_STATUS.PUBLIC);
-        map.setIsPublished(true);
-        map.setGmapsUrl(pr.getGMapsUrl());
-        map.setMapType(pr.getMapType());
-
-        this.publishRequestRepository.save(pr);
-        this.mapRepository.save(map);
-    }
-
-    @Override
-    public void rejectPublishRequest(PublishRequest publishRequest) {
-        publishRequest.setResolved(false);
-        IndoorMap map = publishRequest.getMap();
-        map.setStatus(MAP_STATUS.PRIVATE);
-    }
-
-    @Override
-    public PublishRequest getPublishRequestByMapName(String mapName) {
-        return this.publishRequestRepository.findByMapName(mapName).orElse(new PublishRequest());
-    }
-
-    @Override
-    public void editPublishRequest(PublishRequest publishRequest) {
-        if (!publishRequestRepository.existsById(publishRequest.getId())) return;
-
-        publishRequestRepository.save(publishRequest);
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/RoomTypeServiceImpl.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/RoomTypeServiceImpl.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,27 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.impl;
-
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.entities.RoomType;
-import internettehnologii.imaps.backendRender.web.repo.RoomTypeRepository;
-import internettehnologii.imaps.backendRender.web.service.interfaces.RoomTypeService;
-import org.springframework.stereotype.Service;
-
-@Service
-public class RoomTypeServiceImpl implements RoomTypeService {
-
-    private final RoomTypeRepository roomTypeRepository;
-
-    public RoomTypeServiceImpl(RoomTypeRepository roomTypeRepository) {
-        this.roomTypeRepository = roomTypeRepository;
-    }
-
-    @Override
-    public void addRoomType(String name, IndoorMap map) {
-        roomTypeRepository.save(new RoomType(name, map));
-    }
-
-    @Override
-    public void deleteRoomType(String name, IndoorMap indoorMap) {
-        roomTypeRepository.delete(new RoomType(name, indoorMap));
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/UserServiceImpl.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/impl/UserServiceImpl.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,107 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.impl;
-
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.entities.RBA.Role;
-import internettehnologii.imaps.backendRender.web.exceptions.EmailTakenException;
-import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
-import internettehnologii.imaps.backendRender.web.exceptions.MapNotFoundException;
-import internettehnologii.imaps.backendRender.web.exceptions.UserNotFoundException;
-import internettehnologii.imaps.backendRender.web.exceptions.UsernameTakenException;
-import internettehnologii.imaps.backendRender.web.repo.RoleRepository;
-import internettehnologii.imaps.backendRender.web.repo.UserRepository;
-import internettehnologii.imaps.backendRender.web.service.interfaces.UserService;
-import internettehnologii.imaps.backendRender.web.util.DTO.UserAuthSuccessDTO;
-import internettehnologii.imaps.backendRender.web.util.DTO.UserLoginDTO;
-import jakarta.transaction.Transactional;
-import jdk.jfr.TransitionTo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.stereotype.Service;
-
-import javax.management.relation.RoleNotFoundException;
-
-@Service
-public class UserServiceImpl implements UserService {
-
-    @Autowired
-    private final UserRepository userRepository;
-
-    private final BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder(12);
-    @Autowired
-    private JWTService jwtService;
-
-    private final RoleRepository roleRepository;
-
-    @Autowired
-    private AuthenticationManager authenticationManager;
-
-    @Autowired
-    public UserServiceImpl(UserRepository userRepository, RoleRepository repository) {
-        this.userRepository = userRepository;
-        this.roleRepository = repository;
-    }
-
-
-    @Transactional
-    public IMapsUser register(IMapsUser user) throws RoleNotFoundException {
-        userRepository.findUserByEmail(user.getEmail()).ifPresent((u) -> {
-            throw new EmailTakenException("User with email: " + u.getEmail() + " already exists");
-        });
-        userRepository.findUserByName(user.getUsername()).ifPresent((u) -> {
-            throw new UsernameTakenException("User with name: " + u.getUsername() + " already exists");
-        });
-
-        user.setPassword(bCryptPasswordEncoder.encode(user.getPassword()));
-
-        Role userRole = roleRepository.findByName("USER").orElseThrow(RoleNotFoundException::new);
-
-        userRole.getUsers().add(user);
-        user.getRoles().add(userRole);
-
-        return userRepository.save(user);
-    }
-
-
-
-    public UserAuthSuccessDTO login(UserLoginDTO user) throws Exception {
-
-        Authentication authentication =
-                authenticationManager.authenticate(
-                        new UsernamePasswordAuthenticationToken(user.getUsername(), user.getPassword()));
-
-
-        if (authentication.isAuthenticated()) {
-            String token =  jwtService.generateToken((UserDetails) authentication.getPrincipal());
-            return new UserAuthSuccessDTO(token, user.getUsername(),jwtService.getAuthorities(token).toString());
-        }
-
-        throw new Exception("CANT LOGIN ERR");
-    }
-
-    @Override
-    public void addToFavorites(IMapsUser user, IndoorMap map) {
-        user.getFavoriteMaps().add(map);
-        userRepository.save(user);
-    }
-
-    @Override
-    public void removeFromFavorites(IMapsUser user, IndoorMap map) {
-        boolean removed = user.getFavoriteMaps().remove(map);
-        if(!removed) throw new MapNotFoundException("Map not found. " + map.getName());
-
-        userRepository.save(user);
-
-    }
-
-    @Override
-    public IMapsUser getUser(String usrnameOrEmail) {
-        return userRepository.getIMapsUserByUsernameOrEmail(usrnameOrEmail).orElseThrow(() -> new UserNotFoundException("User " + usrnameOrEmail + " not found"));
-    }
-
-
-
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/FloorService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/FloorService.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,14 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.interfaces;
-
-import internettehnologii.imaps.backendRender.web.entities.Floor;
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-
-import java.util.List;
-
-public interface FloorService {
-    void addFloor(int num, String mapName);
-    void updateFloor(Floor floor);
-    void deleteFloor(int floorNum, String mapName);
-    List<Floor> getAllFloorsForMap(String mapName);
-    Floor getFloorByNum(Integer floorNum, IndoorMap indoorMap);
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/GraphService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/GraphService.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,11 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.interfaces;
-
-import internettehnologii.imaps.backendRender.graph.RouteGraph;
-import internettehnologii.imaps.backendRender.web.entities.Floor;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-public interface GraphService {
-    RouteGraph construct(List<Floor> floors);
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/MapService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/MapService.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,19 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.interfaces;
-
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.entities.MAP_STATUS;
-import internettehnologii.imaps.backendRender.web.entities.RoomType;
-
-import java.util.List;
-
-public interface MapService {
-    void createMap(String mapName, String mapType, String username);
-    void updateMap(IndoorMap indoorMap);
-    void deleteMap(IndoorMap indoorMap);
-    List<IndoorMap> getAllMapsForUser(String username);
-    List<IndoorMap> getPublicMaps();
-    IndoorMap getMapForUser(String username, String mapName);
-    IndoorMap getPublicMapByName(String mapName);
-    IndoorMap getMapByName(String mapName);
-    List<IndoorMap> findByStatus(MAP_STATUS status);
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/PublishRequestService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/PublishRequestService.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,18 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.interfaces;
-
-import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
-import internettehnologii.imaps.backendRender.web.entities.PublishRequest;
-import internettehnologii.imaps.backendRender.web.util.DTO.PublishMapDTO;
-
-import java.util.List;
-
-public interface PublishRequestService {
-    void addPublishRequest(PublishMapDTO publishRequestDTO, IMapsUser user);
-    void denyPublishRequest(int id) throws Exception;
-    List<PublishRequest> getAllPublishRequests();
-    void save(PublishRequest publishRequest);
-    void approvePublishRequest(int id) throws Exception;
-    void rejectPublishRequest(PublishRequest publishRequest);
-    PublishRequest getPublishRequestByMapName(String mapName);
-    void editPublishRequest(PublishRequest publishRequest);
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/RoomTypeService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/RoomTypeService.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,8 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.interfaces;
-
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-
-public interface RoomTypeService {
-    void addRoomType(String name, IndoorMap indoorMap);
-    void deleteRoomType(String name,IndoorMap indoorMap);
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/UserService.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/service/interfaces/UserService.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,17 +1,0 @@
-package internettehnologii.imaps.backendRender.web.service.interfaces;
-
-import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.util.DTO.UserAuthSuccessDTO;
-import internettehnologii.imaps.backendRender.web.util.DTO.UserLoginDTO;
-
-import javax.management.relation.RoleNotFoundException;
-import javax.naming.AuthenticationException;
-
-public interface UserService {
-    IMapsUser register(IMapsUser user) throws RoleNotFoundException;
-    UserAuthSuccessDTO login(UserLoginDTO user) throws Exception;
-    void addToFavorites(IMapsUser user, IndoorMap map);
-    void removeFromFavorites(IMapsUser user, IndoorMap map);
-    IMapsUser getUser(String username);
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/AddRoomTypeDTO.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/AddRoomTypeDTO.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,15 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.DTO;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.stereotype.Service;
-
-@Getter
-@Setter
-@AllArgsConstructor
-public class AddRoomTypeDTO {
-    String roomTypeName;
-    String username;
-    String mapName;
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/CreateMapDTO.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/CreateMapDTO.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,13 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.DTO;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@AllArgsConstructor
-public class CreateMapDTO {
-    private String name;
-    private String mapType;
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/FloorDTO.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/FloorDTO.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,16 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.DTO;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
-@Getter
-@Setter
-@AllArgsConstructor
-@ToString
-public class FloorDTO {
-    int num;
-    String mapName;
-    String mapData; //json
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/MapDTO.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/MapDTO.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,24 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.DTO;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.time.LocalDateTime;
-
-@Getter
-@Setter
-@AllArgsConstructor
-public class MapDTO {
-    private String mapName;
-    private String mapType;
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime createdAt;
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime modifiedAt;
-    private String mapStatus;
-    private int numFavourites;
-    private String gMapsUrl;
-
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/PublishMapDTO.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/PublishMapDTO.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,17 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.DTO;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
-@Getter @Setter @AllArgsConstructor
-@ToString
-public class PublishMapDTO {
-    private int id;
-    private String name;
-    private String lastName;
-    private String mapName;
-    private String mapType;
-    private String googleMapsUrl;
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/RoomTypeDTO.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/RoomTypeDTO.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,12 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.DTO;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@AllArgsConstructor
-public class RoomTypeDTO {
-    String name;
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/SaveMapDTO.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/SaveMapDTO.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,18 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.DTO;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
-@AllArgsConstructor
-@Getter
-@Setter
-@ToString
-public class SaveMapDTO {
-
-    Object shapes;
-    Object roomTypes;
-    String mapName;
-    int floorNum;
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/UserAuthSuccessDTO.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/UserAuthSuccessDTO.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,12 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.DTO;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter @Setter @AllArgsConstructor
-public class UserAuthSuccessDTO {
-    private String token;
-    private String username;
-    private String roles;
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/UserLoginDTO.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/UserLoginDTO.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,13 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.DTO;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
-@Getter @Setter @ToString
-@AllArgsConstructor
-public class UserLoginDTO {
-    private String username;
-    private String password;
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/UserMapDTO.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/DTO/UserMapDTO.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,12 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.DTO;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter @Setter
-@AllArgsConstructor
-public class UserMapDTO {
-    private String username;
-    private String mapName;
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/StringListConverter.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/StringListConverter.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/StringListConverter.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -0,0 +1,34 @@
+package internettehnologii.imaps.backendRender.web.util;
+
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.util.List;
+
+@Converter
+public class StringListConverter implements AttributeConverter<List<String>, String> {
+
+    private final ObjectMapper objectMapper = new ObjectMapper();
+
+
+    @Override
+    public String convertToDatabaseColumn(List<String> attribute) { //LIST<STRING> TO JSON(STRING)
+        try {
+            return objectMapper.writeValueAsString(attribute);
+        } catch (JsonProcessingException e) {
+            throw new RuntimeException("Could not convert list to JSON", e);
+        }
+    }
+
+    @Override
+    public List<String> convertToEntityAttribute(String dbData) { //JSON(STRING) TO LIST<STRING>
+        try {
+            return objectMapper.readValue(dbData, List.class);
+        } catch (IOException e) {
+            throw new RuntimeException("Could not convert JSON to list", e);
+        }
+    }
+}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/UserPrincipal.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/UserPrincipal.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/UserPrincipal.java	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -3,5 +3,4 @@
 import internettehnologii.imaps.backendRender.web.entities.IMapsUser;
 import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
 import org.springframework.security.core.userdetails.UserDetails;
 
@@ -17,5 +16,5 @@
     @Override
     public Collection<? extends GrantedAuthority> getAuthorities() {
-        return user.getRoles().stream().map(r -> new SimpleGrantedAuthority("ROLE_" + r.getName())).toList();
+        return List.of();
     }
 
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/Util.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/Util.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,33 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util;
-
-import internettehnologii.imaps.backendRender.web.entities.Floor;
-import internettehnologii.imaps.backendRender.web.entities.IndoorMap;
-import internettehnologii.imaps.backendRender.web.util.DTO.FloorDTO;
-import internettehnologii.imaps.backendRender.web.util.DTO.MapDTO;
-
-import java.util.Collection;
-import java.util.List;
-
-public class Util {
-
-    public static List<FloorDTO> convertToFloorDTO(List<Floor> floors){
-        return floors.stream()
-                .map(f -> new FloorDTO(
-                        f.getFloorNumber(),
-                        f.getIndoorMap().getName(),
-                        f.getMapData() != null ? f.getMapData().getShapeData() : "")).toList();
-    }
-
-    public static List<MapDTO> convertToMapDTO(Collection<IndoorMap> maps){
-
-        return maps.stream()
-                .map(imap -> new MapDTO(imap.getName(),
-                        imap.getMapType(),
-                        imap.getCreatedAt(),
-                        imap.getModifiedAt(),
-                        imap.getStatus().name(),
-                        imap.getFavouriteCount(),
-                        imap.getGmapsUrl()))
-                .toList();
-    }
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/json/JsonMapData.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/json/JsonMapData.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,23 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.json;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.io.Serializable;
-import java.util.List;
-
-@Setter
-@Getter
-public class JsonMapData implements Serializable {
-    private String shapeData;
-    private String  roomTypes;
-    public JsonMapData(String shapeData, String roomTypes) {
-        this.shapeData = shapeData;
-        this.roomTypes = roomTypes;
-    }
-    public JsonMapData() {
-        shapeData = "";
-        roomTypes = "";
-    }
-
-}
Index: imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/json/JsonNodeConverter.java
===================================================================
--- imaps-backend/backendRender/src/main/java/internettehnologii/imaps/backendRender/web/util/json/JsonNodeConverter.java	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ 	(revision )
@@ -1,38 +1,0 @@
-package internettehnologii.imaps.backendRender.web.util.json;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import jakarta.persistence.AttributeConverter;
-import jakarta.persistence.Converter;
-
-import java.io.IOException;
-
-@Converter(autoApply = true)
-public class JsonNodeConverter implements AttributeConverter<JsonNode, String> {
-
-    private static final ObjectMapper objectMapper = new ObjectMapper();
-
-    @Override
-    public String convertToDatabaseColumn(JsonNode jsonNode) {
-        if (jsonNode == null) {
-            return null;
-        }
-        try {
-            return objectMapper.writeValueAsString(jsonNode);
-        } catch (IOException e) {
-            throw new RuntimeException("Failed to convert JsonNode to String", e);
-        }
-    }
-
-    @Override
-    public JsonNode convertToEntityAttribute(String json) {
-        if (json == null) {
-            return null;
-        }
-        try {
-            return objectMapper.readTree(json);
-        } catch (IOException e) {
-            throw new RuntimeException("Failed to convert String to JsonNode", e);
-        }
-    }
-}
Index: imaps-backend/backendRender/src/main/resources/application.properties
===================================================================
--- imaps-backend/backendRender/src/main/resources/application.properties	(revision 0c6b92add4cfaedcb91bcd37b45849f142f7d152)
+++ imaps-backend/backendRender/src/main/resources/application.properties	(revision d56544918790c0c3bc50f2f0a98c99f3d2988ccf)
@@ -1,11 +1,10 @@
 spring.application.name=backendRender
-spring.datasource.url=jdbc:postgresql://localhost:5432/imaps_prod
-spring.datasource.username=${DB_USER}
-spring.datasource.password=${DB_PASS}
+spring.datasource.url=jdbc:postgresql://localhost:6432/imaps
+spring.datasource.username=imaps_admin
+spring.datasource.password=iMapsResen2024
 spring.jpa.hibernate.ddl-auto=validate
 spring.jpa.show-sql=true
 spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
 spring.jpa.properties.hibernate.format_sql=true
+logging.level.org.springframework.security=DEBUG
 
-logging.level.org.springframework.web=DEBUG
-
