What is the proper folder structure for a MERN app with a MVC architecture?

Hello,

I’m trying to learn the MVC architecture for MERN applications. However, I’m not sure what the folder structure should be in the app

I tried searching it up, but sometimes the folder structure varies between sites

I was wondering if there is a standard/correct way to organize files in an app

When I asked ChatGPT, this is what it outputted, and I wanted to check if this is considered okay or if something needs to be changed

/project-root
|-- client
|   |-- public
|   |   |-- index.html
|   |
|   |-- src
|       |-- components
|       |   |-- SomeComponent.js
|       |
|       |-- pages
|       |   |-- HomePage.js
|       |   |-- AboutPage.js
|       |
|       |-- App.js
|       |-- index.js
|       |
|       |-- styles
|           |-- main.css
|
|-- server
|   |-- controllers
|   |   |-- SomeController.js
|   |
|   |-- models
|   |   |-- SomeModel.js
|   |
|   |-- routes
|   |   |-- apiRoutes.js
|   |   |-- index.js
|   |
|   |-- config
|   |   |-- database.js
|   |
|   |-- server.js
|
|-- node_modules
|-- package.json
|-- package-lock.json
|-- .gitignore

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.