πŸš€ Angular 20 Naming & Structure Guide: Clean, Scalable, and Ready for the Future

With Angular 20 now officially out, the updated style guide brings some much-needed clarity and modernization to how we name files and structure projects. If you’re spinning up a new app or considering refactoring a legacy codebase, this breakdown will help you adopt the new conventions confidently.


βœ… File Naming in Angular 20: Simpler, Smarter, Sharper

Angular is finally ditching verbose, redundant file names in favor of cleaner, role-focused naming β€” and I’m all for it.

🎯 Updated Naming Rules:

❌ No More Suffix Overload

Instead of long, repetitive filenames like user-profile.component.ts, we now go with:

  • user-profile.ts βœ…
  • highlight.ts βœ…
  • auth-store.ts βœ… (replaces auth.service.ts)

πŸ’‘ Note: The word “service” is out β€” the recommendation is to use domain-oriented or role-based names like *-store.ts, *-api.ts, or *-client.ts.

βœ… Hyphenated Suffixes for Specific Types

For other Angular constructs, suffixes are still useful β€” but cleaner.

Examples:

  • auth-guard.ts (was auth.guard.ts)
  • currency-pipe.ts (was currency.pipe.ts)
  • shared-module.ts (was shared.module.ts)

🧱 Project Structure: Domain-Driven & Maintainable

Angular 20 pushes a more scalable, modular approach β€” goodbye massive features/ folder, hello structure that mirrors how your product works.

πŸ“ Top-Level Layout

src/
└── app/
β”œβ”€β”€ core/ β†’ global, non-business features
β”œβ”€β”€ domains/ β†’ business-specific features
└── shared/ β†’ dumb, reusable logic and UI

πŸ” core/ β€” Global Features, Auth, Layout, etc.

This is where you’ll keep things like authentication logic, layout, guards, and global stores.

src/
└── app/
└── core/
β”œβ”€β”€ auth/
β”‚ β”œβ”€β”€ guards/
β”‚ β”‚ └── auth-guard.ts
β”‚ β”œβ”€β”€ models/
β”‚ β”‚ └── user.model.ts
β”‚ β”œβ”€β”€ stores/
β”‚ β”‚ └── auth-store.ts
β”‚ β”œβ”€β”€ auth.routes.ts
β”‚ └── pages/
β”‚ └── login/
β”‚ β”œβ”€β”€ login.ts
β”‚ β”œβ”€β”€ login.html
β”‚ └── login.css
└── layout/

πŸ’‘ Keep pages/ only for routed components. Use models/, stores/, and guards/ to stay organized.


πŸ’Ό domains/ β€” Business Logic, Organized by Feature

No more dumping all features into one bucket. Angular 20 encourages organizing around real product domains.

Example for a job board:

src/
└── app/
└── domains/
β”œβ”€β”€ jobs/
β”‚ β”œβ”€β”€ pages/
β”‚ β”‚ β”œβ”€β”€ job-list/
β”‚ β”‚ └── job-detail/
β”‚ β”œβ”€β”€ models/
β”‚ β”œβ”€β”€ stores/
β”‚ β”œβ”€β”€ services/
β”‚ └── jobs.routes.ts
β”œβ”€β”€ events/
└── groups/

βœ… Benefits:

  • Keeps concerns separated
  • Easier for teams to work independently
  • Code is easier to test, scale, and refactor

♻️ shared/ β€” Dumb UI + Reusable Utilities

If a component doesn’t need to know where data comes from, it belongs here.

src/
└── app/
└── shared/
β”œβ”€β”€ components/
β”‚ └── notification/
β”‚ β”œβ”€β”€ notification.ts
β”‚ β”œβ”€β”€ notification.html
β”‚ └── notification.css
β”œβ”€β”€ pipes/
β”‚ └── format-date-p.ts
└── utils/
└── string-utils.ts

πŸ“Œ Rule of Thumb: Shared logic is stateless, presentation-focused, and reused across domains.


πŸ†• Reminder: Angular Is Standalone by Default Now

Since Angular 17, the CLI defaults to Standalone Components β€” no NgModules needed.

src/
└── app/
β”œβ”€β”€ app.ts # Standalone root component
β”œβ”€β”€ app.routes.ts # Route config
└── app.config.ts # App-wide setup

This shift reduces boilerplate and makes it easier to adopt a component-first, modular mindset.


🧠 Final Thoughts

Angular 20 doesn’t just introduce new features β€” it encourages you to write cleaner, more intentional code. With simplified naming and a domain-driven project structure, your app becomes:

βœ… Easier to scale
βœ… Easier to test
βœ… Easier to onboard new devs

Whether you’re starting fresh or modernizing an existing codebase, this is the perfect opportunity to align with the latest best practices.


✍️ Coming Soon:

Follow along for more Angular 20 content, including:

  • Advanced usage of Angular Signals
  • Migrating legacy projects to standalone components
  • Clean state management without NgRx

Leave a Comment

Your email address will not be published. Required fields are marked *