πŸ“‚ Understanding Angular Project Structure β€” A Complete Beginner’s Guide

πŸ— 1. Creating a Angular 19 Project

If you don’t have a project yet, let’s create one:

ng new angular-structure-demo
cd angular-structure-demo
code .

πŸ“ 2. Angular 19 Default Folder Structure

When you run ng new, Angular CLI generates the following structure:

my-app/
β”œβ”€β”€ node_modules/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ app.component.css
β”‚   β”‚   β”œβ”€β”€ app.component.html
β”‚   β”‚   β”œβ”€β”€ app.component.ts
β”‚   β”‚   β”œβ”€β”€ app.config.ts 
β”‚   β”‚   └── app.routes.ts 
β”‚   β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ environments/
β”‚   β”‚   β”œβ”€β”€ environment.ts
β”‚   β”‚   └── environment.prod.ts
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ main.ts
β”‚   β”œβ”€β”€ styles.scss
β”‚   └── polyfills.ts
β”œβ”€β”€ angular.json
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ tsconfig.app.json
└── README.md

πŸ” 3. Key Folders & Files Explained

πŸ“ node_modules/

Contains all installed npm packages and dependencies.
⚠ Don’t edit this manually.

πŸ“ src/

Main source code folder β€” everything here will be compiled into your app.


πŸ“ src/app/

  • app.component.ts β†’ Main component logic.

  • app.component.html β†’ UI template.

  • app.component.css β†’ Component-specific styles.

  • app.config.ts β†’ App-wide configuration (new standalone approach).

  • app.routes.ts β†’ Routing setup if enabled during creation.


πŸ“ assets/

Holds static files like images, JSON data, icons,config.json etc.


πŸ“ environments/

  • environment.ts β†’ Development settings.

  • environment.prod.ts β†’ Production settings.


πŸ“„ angular.json

Angular CLI configuration β€” defines build options, styles, and scripts.


πŸ“„ package.json

Lists dependencies and npm scripts.


πŸ“„ tsconfig.json

TypeScript compiler configuration.


πŸ“„ index.html

Main HTML entry file β€” Angular injects the app here.


While the default structure works for small projects, for larger apps we use a feature-based approach:

src/
└── app/
    β”œβ”€β”€ core/           // Singleton services, guards, interceptors
    β”œβ”€β”€ shared/         // Reusable components, directives, pipes
    β”œβ”€β”€ features/       // Each feature has its own module & routing
    β”‚   └── home/
    β”‚       β”œβ”€β”€ components/
    β”‚       β”œβ”€β”€ services/
    β”‚       β”œβ”€β”€ home.routes.ts
    β”‚       └── home.component.ts/html/css
    β”œβ”€β”€ layouts/        // Global layout components (header, footer)
    β”œβ”€β”€ app.config.ts
    β”œβ”€β”€ app.routes.ts
    └── main.ts

πŸ’‘ Why This Structure Works for Angular 19

βœ… Keeps code modular and organised
βœ… Makes lazy loading easier
βœ… Improves maintainability for large apps
βœ… Helps teams work without conflicts


🎯 5. Quick Demo β€” Editing Your First Component

Open app.component.html and change the text:

<h1>Welcome to My First Angular 19 App πŸš€</h1>

Save, and you’ll see the browser update instantly.


βœ… Conclusion

Understanding the project structure is essential before writing real features.
we’ll explore Angular Components in Depth and start building UI.


πŸ“Œ Tip: You can reorganise your Angular app into a feature-based structure from the start β€” it will make scaling much easier later.

1
Subscribe to my newsletter

Read articles from Shubham Deshmukh directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shubham Deshmukh
Shubham Deshmukh

My career objective is to be a competent individual who can contribute significantly to an organization's growth and also get valuable exposure, that would help me enhance my skill sets and provide me with opportunities to grow and further develop my talents as an individual. Also will offer me a work-life balance.