Here is an example :
├─┬ modules
│ └─┬ <module>
│ ├── controller.js
│ ├── view.js
│ └── model.js
or
├─┬ controllers
│ └─┬ <module>.js
│
├─┬ models
│ └─┬ <module>.js
│
├─┬ views
│ └─┬ <module>.js
TJ
Building Sparkle ✨ for Laravel | Echo Labs | Curology
Going from scratch, I prefer 2 different organizational styles.
Frontend (React.js)
{import ../utils/MyLeftPad.js}{import ./HNav.js}{import ../components/FButton.js)}Backend (Node.js)
Otherwise, I keep the existing structure given by scaffolds and starter projects like mern.io/
I was using an MVC style structure for one of my sites, but have recently changed to a module style structure.
For me, the change was for pushing to production reasons. In an MVC style, you could push individual files from different folders to production, but with a module style - I know what ever is in that folder, belongs to that module - so I just need to push that folder and be done. No concern about pushing an incorrect file or overwriting something that shouldn't be.
Neither is right or wrong I don't think - whatever works best for the project at hand.
Prashant Abhishek
Co-founder at AltCampus
I like to keep it like this-
<model.js>
<controller.js>
<routes.js>
<configurationFiles.js>
<FunctionalComponent.js>
<FunctionalComponent.css>
<ContainerComponent.js>
<ContainerComponent.css>