I'm starting a new project under M*EAN Stack (MySQL) and was wondering about how to structure it, i'll use John Papa's Style Guide for an Angular project, it's pretty cool though, specially for the LIFT principle.
What is making a bit of trouble is Express, it has it's own MVC structure, it can handle routes, models, views, etc... but i want to handle that with Angular, i want Express just as a RESTful API.
A folder structure that i've been thinking to use is:
├── node_modules
├── app
│ ├── client
│ │ ├── app.module.js
│ │ ├── app.config.js
│ │ ├── users
| │ │ ├── users.module.js
| │ │ ├── users.config.js
| | | ├── admins.view.html
| | | ├── admins.controller.js
| | | ├── registered.view.html
| | | ├── registered.controller.js
| | | ├── guests.view.html
| | | ├── guests.controller.js
| | | ├── profile.directive.html
| | | ├── profile.controller.js
| | │ └── users.routes.js
│ │ ├── questions
| │ │ ├── questions.module.js
| │ │ ├── questions.config.js
| | | ├── list.view.html
| | | ├── list.controller.js
| | | ├── ask.view.html
| | | ├── ask.controller.js
| | | ├── detail.view.html
| | | ├── detail.controller.js
| | │ └── questions.routes.js
│ │ └──
│ ├── server
│ | └── ?
│ └── libs
| ├── angular
| ├── bootstrap
│ └── jquery
|
|
└── server.js
But actually i'm pretty sure if work with it like that, i really need a scalable structure, the application is pretty laaarge!. Some of my questions are:
NOTE: I haven't include folders and files for bower, gulp, grunt, or things like that, i want to keep it as clean as possible, i know they simplify a lot of things, but i don't want to use them now, of course, if someone has a great argument to use them, please tell me.
I structure my express apps as described in Express Code Structure. I think the grouping you have under app/client
looks good and you could just mirror that for the express server side portions of your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With