10

I am a part of a project that is using the MERN stack and need info on how to structure my system architecture diagram. I am unsure whether MERN is a MVC, layered, client-server, or other architecture pattern.

I currently have a diagram on our github wiki page, but my client said that this is not detailed enough. Can someone please chime in and help out.

I want to say MVC, but since React is the view, and all logic is within the Express controllers/models I am unsure whether this is truly a MVC pattern.

Justin Smith
  • 173
  • 2
  • 9
  • 1
    To use React Js in the frontend along with backend (Node, Express, and MongoDB) then, it is known as MVC architecture as mongoose model definition as Model, controller defining as Controller and View (ReactJs is added here). The combination of programming stacks such as MongoDB, Express, ReactJS, and NodeJs is known as the MERN stack design pattern. – Tanzeel U Rehman Mar 01 '21 at 05:14

1 Answers1

0

MERN doesn't truly follow the MVC architecture but it's components can be interpreted. MVC stands for Model View Controller, where Model represents the structure, format and the constraints of the stored data. It is the database part of the application. So in MERN, Mongoose serves the Model part of the architecture.

Controller generates the appropriate request and response when a user interacts with the view. The controller renders the appropriate view with the model data as a response. Express.js and Node.js serves the Controller part of the architecture.

View is the user interface part, which is seen by the user on a browser window. React.js is responsible for the user interface and View part of the architecture.

Acesif
  • 81
  • 1
  • 4