0
0
Angularframework~10 mins

Angular project structure walkthrough - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Angular project structure walkthrough
Start: Angular CLI creates project
Create root folder
Add src folder
Add main.ts and index.html
Add app folder with components
Add assets and environments folders
Add angular.json and package.json
Project ready for development
This flow shows how Angular CLI builds the project folder step-by-step, organizing files and folders for app development.
Execution Sample
Angular
my-angular-project/
  src/
    main.ts
    index.html
    app/
      app.component.ts
      app.component.html
  angular.json
  package.json
This is a simplified snapshot of the main folders and files created in an Angular project.
Execution Table
StepActionFolder/File CreatedPurpose
1Create root foldermy-angular-project/Holds entire project
2Add src foldersrc/Source code lives here
3Add main.tssrc/main.tsEntry point to bootstrap app
4Add index.htmlsrc/index.htmlMain HTML page loaded by browser
5Add app foldersrc/app/Contains app components and logic
6Add app.component.tssrc/app/app.component.tsRoot component TypeScript code
7Add app.component.htmlsrc/app/app.component.htmlRoot component HTML template
8Add assets foldersrc/assets/Static files like images
9Add environments foldersrc/environments/Config for dev and prod
10Add angular.jsonangular.jsonAngular CLI config file
11Add package.jsonpackage.jsonProject dependencies and scripts
12Project ready-All files and folders set up for development
💡 All essential files and folders created, project structure complete.
Variable Tracker
Folder/FileBeforeAfter
my-angular-project/NoYes
src/NoYes
src/main.tsNoYes
src/index.htmlNoYes
src/app/NoYes
src/app/app.component.tsNoYes
src/app/app.component.htmlNoYes
src/assets/NoYes
src/environments/NoYes
angular.jsonNoYes
package.jsonNoYes
Key Moments - 3 Insights
Why is the src folder important in Angular projects?
The src folder holds all the source code and assets for the app, as shown in steps 2-9 of the execution_table.
What is the role of main.ts compared to index.html?
index.html is the main HTML page loaded by the browser, while main.ts bootstraps the Angular app inside that page (steps 3 and 4).
Why do we have both app.component.ts and app.component.html?
app.component.ts contains the logic and data, while app.component.html contains the HTML template. Together they form the root component (step 6 and 7).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step is the root component's HTML template created?
AStep 5
BStep 6
CStep 7
DStep 8
💡 Hint
Check the 'Folder/File Created' column for app.component.html
According to variable_tracker, which folder is created immediately after the root project folder?
Aassets/
Bsrc/
Csrc/app/
Denvironments/
💡 Hint
Look at the order of creation in variable_tracker rows
If the angular.json file was missing, which step in execution_table would be incomplete?
AStep 10
BStep 9
CStep 11
DStep 12
💡 Hint
Check which step mentions angular.json in the 'Folder/File Created' column
Concept Snapshot
Angular project structure:
- Root folder holds all files
- src/ contains source code
- main.ts bootstraps app
- index.html is main HTML page
- app/ holds components (logic + templates)
- assets/ for static files
- angular.json configures CLI
- package.json manages dependencies
Full Transcript
This visual execution shows how an Angular project folder is created step-by-step by Angular CLI. It starts with the root folder, then adds the src folder where all source code lives. Inside src, main.ts is the entry point that bootstraps the app, and index.html is the main HTML page loaded by the browser. The app folder inside src contains the root component files: app.component.ts for logic and app.component.html for the template. Assets and environments folders hold static files and environment configs. At the root level, angular.json configures the Angular CLI and package.json manages dependencies. This structure organizes the project clearly for development.