1

I want to create a folder structure for a MEAN stack with Angular 4.

I worked on MEAN stack with Angular 1.* version and Im good with that folder structure. but with Angular 4 - Angular Cli folder structure My model not working.

I'm planning for enterprise admin panel, so modules should be reusable and loosely coupled.

I tried one way : Keeping Client, Server and Test folder in Angular components. but which disturbing angular -cli component model.

halfer
  • 19,824
  • 17
  • 99
  • 186
user3538382
  • 11
  • 1
  • 3

3 Answers3

3

Use Angular CLI that ships with Angular 4. It itself generates a folder structure that helps manage your project in a modular manner with loosely coupled components.

Check https://cli.angular.io/

Use the angular folder structure for the front end and have a separate directory on top of angular project for back-end. For Node back end check for popular yeoman generators which would suit your application.

http://yeoman.io/generators/

  • Your-application
    • Node-api
    • Angular-app

I propose a folder structure like this. But there may be better ones. Some research would help find such.

It is better if you can maintain two separate repositories for Node-api and Angular-app since it would help you maintain and manage them in a better way.

pasancode
  • 125
  • 12
1

I think you should look into this answer: Hooking up express.js with Angular CLI in dev environment

Basically you will have to separate server and client side code, otherwise you will end up having challenges at each step.

You can have a look at my code: https://github.com/kubaszumiato/DotNetVideos, where app folder stands for server, src for client. I am not using Angular CLI there though.

Jakub Szumiato
  • 1,318
  • 1
  • 14
  • 19
0

You should use angular-cli for creating angualr 4 project. You can create Two folders Client,Server Client- You can create project under this directory with angular-cli Server - Use Node js server side code