π Understanding Angular Project Structure β A Complete Beginnerβs Guide

Table of contents
π 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.
π§© 4. Scalable Feature-Based Structure (Recommended for Angular 19)
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.
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.