-
Standalone Components:
- Each component can be standalone, meaning they don’t need to be declared in a module.
- This allows for better modularity and reusability.
-
Core Module:
- Keep the core directory for singleton services, guards, interceptors, and models.
- Core services and utilities that are used globally should be placed here.
-
Shared Module:
- The shared directory is for components, directives, and pipes that are reused across multiple features.
- Standalone components, directives, and pipes can be placed here without needing to declare them in a module.
-
Feature Modules:
- Organize features into their own directories.
- Feature-specific components, services, and routing modules should be placed within these directories.
-
Routing:
- Define routing in feature-specific routing modules.
- Lazy loading should be utilized to load feature modules on demand.
- Standalone Components: Utilize standalone components for modularity and reusability.
- Core and Shared Directories: Maintain a clear separation of core and shared resources.
- Feature Modules: Organize features into their own modules with dedicated routing.
- Routing: Use lazy loading for better performance and manage routing in feature-specific modules.
src/
├── app/
│ ├── core/
│ │ ├── interceptors/
│ │ ├── services/
│ │ ├── guards/
│ │ ├── models/
│ │ ├── core.module.ts
│ │ └── ...
│ ├── shared/
│ │ ├── components/
│ │ ├── directives/
│ │ ├── pipes/
│ │ └── ...
│ ├── features/
│ │ ├── feature1/
│ │ │ ├── components/
│ │ │ │ ├── example/
│ │ │ │ │ ├── example.component.html
│ │ │ │ │ ├── example.component.scss
│ │ │ │ │ ├── example.component.ts
│ │ │ │ │ ├── example.component.spec.ts
│ │ │ ├── services/
│ │ │ │ ├── example.service.ts
│ │ │ │ ├── example.service.spec.ts
│ │ │ ├── feature1-routing.module.ts
│ │ │ ├── feature1.module.ts
│ │ │ └── ...
│ │ ├── feature2/
│ │ │ ├── components/
│ │ │ ├── services/
│ │ │ ├── feature2-routing.module.ts
│ │ │ ├── feature2.module.ts
│ │ │ └── ...
│ ├── main.ts
│ ├── app.component.html
│ ├── app.component.scss
│ ├── app.component.ts
│ └── ...
├── assets/
├── environments/
├── styles/
├── index.html
├── polyfills.ts
├── test.ts
└── ...