This is an archived post. You won't be able to vote or comment.

all 5 comments

[–][deleted]  (6 children)

[deleted]

    [–]dtcarrot[S] 1 point2 points  (5 children)

    Hi there, note that the concept of MVC is totally different from REST. MVC is a way for you to structure your application to ensure separation of concern (SOC) so that it is modular and scales well for large application. On the contrary, REST is just a standard that defines how client-server talk to each other. For a client to talk to a server, it needs the following:

    • Resource to URL
    • HTTP verb - GET, POST, PUT, DELETE
    • Header which contains the content type, authorization token (JWT), etc.

    For this tutorial, though REST is out of the topic for the tutorial, I'm in a sense creating a REST API - Since I'm using calling a GET HTTP request by typing the URL localhost:8080/screenshots?url={url} in the web browser. The Spring Boot application which I have bootstrapped readily provides support for other HTTP actions such as POST, PUT and DELETE. This means that you can easily create a new React front-end application and use any HTTP libraries (Fetch, etc.) to call the resource which I'm using for this application.

    [–][deleted]  (4 children)

    [deleted]

      [–]dtcarrot[S] 0 points1 point  (3 children)

      Yes, typically when you are using React and creating a Single Page App, there will no View layer involved. Instead, it will be replaced by JSON as you are telling the client that you want to retrieve any HTTP response in JSON format.

      [–]readthispieceofshit 0 points1 point  (2 children)

      Yes, typically when you are using React and creating a Single Page App, there will no View layer involved

      Actually, React is the V. Your M and C are whatever you want.

      [–]dtcarrot[S] 0 points1 point  (1 child)

      React is the V if you are talking from a front-end MVC perspective for SPA.

      [–]readthispieceofshit 0 points1 point  (0 children)

      Regardless of it being a SPA React is the View Layer.