folder structure for MEAN stack

后端 未结 3 1330
Happy的楠姐
Happy的楠姐 2021-02-10 00:20

I\'m following a tutorial on the MEAN stack and I\'d like to have a clean folder structure to work with. I\'ve read plenty of articles that say to have a folder for each (let\'s

3条回答
  •  误落风尘
    2021-02-10 00:57

    I came up with my own structure. This helped me during a project. Each * marks a folder.

    app folder is for the Backend and public for the Frontend.

    • root*
      • app*
        • controllers*
          • main.controller.js
        • models*
          • user.model.js
        • routes*
          • user.route.js
        • tests*
          • user.test.js
        • views*
          • 404.html
      • asset*
        • plugins*
        • external_libraries*
      • bower_components*
      • config*
        • db.js
      • node_modules*
      • public*
        • controllers*
          • main.controller.js
        • modules*
          • main.module.js
        • services
          • main.service.js
        • views
          • user.html
          • home.html
          • index.html
      • bower.json
      • package.json
      • server.js

提交回复
热议问题