angular-architecture

Router-First architecture, enterprise patterns, modular design with lazy loading

View on GitHub
Author Ihsan - Full-Stack Developer & AI Strategist
Namespace @EhssanAtassi/angular-master-marketplace
Category architecture
Version 1.0.0
Stars 0
Downloads 4
self.md verified
Table of content

Router-First architecture, enterprise patterns, modular design with lazy loading

Installation

npx claude-plugins install @EhssanAtassi/angular-master-marketplace/angular-architecture

Contents

Folders: agents, commands, skills

Files: VERIFICATION.md

Included Skills

This plugin includes 2 skill definitions:

enterprise-patterns

View skill definition

Enterprise Angular Patterns

Proven architectural patterns for building scalable Angular applications in enterprise environments with teams of 5-100+ developers.

Pattern 1: Core-Shared-Features Structure

Overview

Organize code into three main categories based on scope and reusability.

The Three Folders

src/app/
├── core/          # App-wide singletons (loaded once)
├── shared/        # Reusable components/utilities
└── features/      # Feature modules (lazy loaded)

Core Module Rules

What belongs in core:

What does NOT belong:

Example:

// core/services/auth.service.ts
@Injectable({ providedIn: 'root' })
export class AuthService {
  private currentUser$ = new BehaviorSubject<User | null>(null);
  
  login(credentials: Credentials): Observable<User> {
    return this.http.post<User>('/api/auth/login', credentials).pipe(
      tap(user => this.currentUser$.next(user))
    );
  }
  
  getCurrentUser(): Observable<User | null> {
    return this.currentUser$.asObservable();
  }
}

Shared Module Rules

What belongs in shared:

…(truncated)

router-first-methodology

View skill definition

Router-First Methodology

Author: Doguhan Uluca
Source: Angular for Enterprise Applications, 3rd Edition
Context: Enterprise Angular architecture for teams of 5-100+ developers

Why Router-First?

Traditional development often starts with components, leading to:

Router-First solves this by:


The 7 Steps

Step 1: Develop a Roadmap and Scope

Goal: Define what features your application needs

Process:

  1. List all user-facing features
  2. Identify MVP vs. future features
  3. Group related functionality
  4. Define user roles and permissions

Example:

E-commerce App Roadmap:

Phase 1 (MVP):
- Product browsing
- Shopping cart
- Checkout
- User authentication

Phase 2:
- Order history
- Product reviews
- Wishlist
- Admin panel

Phase 3:
- Analytics dashboard
- Inventory management
- Customer support

Output: Feature list with priorities


Step 2: Design with Lazy Loading in Mind

Goal: Plan bundle structure for optimal performance

Process:

  1. Each major feature = separate lazy-loaded module
  2. Identify shared dependencies
  3. Plan loading strategies

…(truncated)

Source

View on GitHub

Tags: architecture angulararchitecturerouter-firstenterprisemodular