Angular Project Structure for Modularity and Reusability
This note outlines an Angular folder structure with core, features, and shared modules to keep the app modular and reusable.
Directory Structure
- core
- Contains application-core functionality, including constants, guards, interceptors, models, and services.
- These are accessible by the
featuresdirectory but should never reference features or shared components.
- features
- Each feature module resides here.
- These modules may reference
coreorsharedbut must remain isolated from the rest of the application to maintain modularity.
- shared
- Contains reusable parts like directives, forms, pipes, and services.
- These are available to
featuresbut must avoid referencing them.

src/├── app/│ ├── core/│ │ ├── constants/│ │ ├── decorators/│ │ ├── guards/│ │ ├── interceptors/│ │ ├── interfaces/│ │ │ ├── api/│ │ ├── models/│ │ ├── resolvers/│ │ ├── services/│ │ │ ├── api/│ │ ├── validators/│ ├── features/│ │ ├── auth/│ │ │ ├── password-reset/│ │ │ ├── sign-in/│ │ │ ├── sign-up/│ │ │ ├── verify/│ │ │ ├── auth.module.ts│ │ │ ├── auth.service.ts│ │ │ ├── auth-routing.module.ts│ │ ├── .../│ ├── shared/│ │ ├── components/│ │ ├── directives/│ │ │ ├── attribute/│ │ │ ├── structural/│ │ ├── forms/│ │ │ ├── input/│ │ │ ├── select/│ │ │ ├── .../│ │ ├── pipes/│ │ ├── services/│ ├── app.component.ts│ ├── app.module.ts│ ├── app-routing.module.tsassets/environments/styles/tests/theme/global.scssWhile the Angular coding style guide advises keeping directories flat, you should consider subdirectories when a folder exceeds seven files.
Consider creating sub-folders when a folder reaches seven or more files. – Angular coding style guide
Reference
Conclusion
Organizing an Angular app into core, features, and shared directories, each with a defined dependency direction, keeps feature modules isolated and reusable code centralized. The rule that keeps this structure from decaying is directional: core must never reference features or shared, and features may depend on core and shared but never on each other directly. That one-way flow is what makes each feature module’s boundaries predictable — anything a feature needs that isn’t specific to it belongs in core or shared instead of a cross-feature import. The style guide’s seven-file threshold for introducing subdirectories is a reasonable trigger for when a shared/services or core/guards folder is getting crowded enough to warrant splitting further.
Related posts
Spying on Mock Object Properties in Jasmine
Working around Jasmine's "already been spied upon" error when spying on a mocked object's property with Object.getOwnPropertyDescriptor.

Integrating AWS Amplify with Eclipse Mosquitto for MQTT Messaging
Testing AWS Amplify's PubSub module against a local Eclipse Mosquitto broker before pointing it at AWS IoT Core.
Sign in with Slack Using Cognito User Pools and OIDC
Federating Cognito user pools with Slack over OIDC and wiring "Sign in with Slack" into a Next.js app with Amplify.
Deploying FastAPI on AWS Lambda with Lambda Web Adapter
This example guides you through the process of developing API backends with FastAPI using Lambda Web Adapter.
Testing ECMAScript Modules with Jest
Fixing Jest's "Cannot use import statement outside a module" error by wiring up ESM support across package.json, TypeScript, and Jest config.
