3

I've been experimenting with the MEAN stack and toying with application structure. According to Mean.io and Mean.js the suggested folder structure for the server backend code (written in Express) looks MVC-like to me:

-server
--- config                      # Configuration Files (see below)
--- controllers                 # Server side logic goes here
--- models                      # schema models goes here
--- routes                      # rest api endpoints routing - here
--- views                       # swig based html rendering - here

My question is this: Is there any reason not to adopt a module-based folder structure for the backend server code? On the frontend, they recommend a module-based folder structure for the AngularJS code.

In particular, I thought this stackoverflow response was convincing regarding a module-based folder structure for server code.

Overall, MEAN stack looks pretty darn cool and I want to better understand how to best leverage it.

Community
  • 1
  • 1

1 Answers1

3

The 0.4.0 version of mean.io is coming out next week with the folder structure adapted to be in line with the modular approach both on the server and on the client.

The code will be broken up into 'packages' and each package internally is structured in an mvc style.

I suggest having a look at the mean.io packages to get a sense of how the new structure will work. link to the documentation pages

Yonatan Ellman
  • 286
  • 1
  • 4