xinra-oss / review-community

Other
2 stars 0 forks source link

Angular project structure #9

Closed erikhofer closed 7 years ago

erikhofer commented 7 years ago

Module structure roposal:

Eagerly loaded feature modules:

Lazily loaded feature moduels:

core is eagerly loaded and includes everything that belongs to the whole app and is used everywhere (e.g. navigation). This is to keep the app module tidy. It contains a subfolder services that seperates core services (probably a few) from core components. Since services don't really belong to a module, this could also be placed in the app root. However, because features may contain their own sevices (that can then be lazily loaded along with the feature module) this would be inconsistent.

misc is lazily loaded and includes things that accessed rarely but aren't a whole feature on their own. This for example includes the "about" page, privacy policy and so on.

shared is (probably) eagerly loaded contains things like directives (no services!) that are used by child modules (and can thus not be declared in the root module). This is also a good place for model classes.

Module folders may contain any level of subfolders to organize components.

erikhofer commented 7 years ago

The angular-seed-advanced that the client is based on (see #10) has a different structure than a standard CLI project. It is more complex and has some disadvantages (imho). We will, however, stick to its structure for now because it would be very hard to alter the existing setup compared to the potential benefits.

Some of the ideas mentioned above are incorporated into the existing structure.