Skip to main content
The Angular PWA Demo is a modern Progressive Web Application built with Angular 21, showcasing enterprise-level architecture patterns and best practices.

Core architecture principles

This application follows a modular, service-oriented architecture designed for scalability, maintainability, and optimal performance.

Module-based structure

Organized into feature modules for better code organization and lazy loading

Service layer pattern

Centralized business logic in injectable services with dependency injection

Progressive enhancement

PWA capabilities with offline support and installability

Modern Angular features

Leverages Angular 21 features including signals, functional injection, and standalone components

Application layers

Components and modules

The presentation layer consists of organized feature modules:
  • Home module: Landing pages and navigation
  • About module: Application information and specs
  • Demos module: Feature demonstrations organized by category
    • Algorithm demonstrations
    • File generation features
    • Games and interactive demos
    • Machine learning examples
    • Miscellaneous features
Components use modern Angular patterns:
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
  standalone: false
})
export class AppComponent implements OnInit {
  // Modern dependency injection
  private readonly _configService = inject(ConfigService);
  private readonly backendService = inject(BackendService);

  // Reactive state with Signals
  public readonly title = signal<string>('');
  public readonly appBrand = signal<string>('');
  public readonly appVersion = signal<string>('');
}

Dependency injection pattern

The application uses Angular’s modern dependency injection with functional injection syntax:
// Inyección de servicios (v21 Style)
private readonly _configService   = inject(ConfigService);
private readonly backendService   = inject(BackendService);
private readonly titleService     = inject(Title);
private readonly algorithmService = inject(AlgorithmService);
The inject() function is the modern Angular 21+ approach for dependency injection, replacing constructor-based injection for cleaner and more flexible code.

Module structure

The application is organized into focused feature modules:
app.module.ts:87-106
imports: [
  BrowserModule,
  BrowserAnimationsModule,
  CommonModule,
  NgbModule,
  FormsModule,
  ReactiveFormsModule,
  AppRoutingModule,
  SharedModule,
  FileGenerationModule,
  GamesModule,
  AlgorithmModule,
  MiscelaneousModule,
  AboutModule,
  SpeechPanelComponent,  // Standalone
  BaseSortableHeader,    // Standalone
  ServiceWorkerModule.register('ngsw-worker.js', {
    enabled: !isDevMode(),
    registrationStrategy: 'registerWhenStable:30000'
  })
]
The application supports both traditional module-based components and standalone components, demonstrating Angular’s flexibility in architectural approaches.

State management

The application uses Angular Signals for reactive state management:
app.component.ts:20-23
// Propiedades reactivas usando Signals
public readonly title      = signal<string>('');
public readonly appBrand   = signal<string>('');
public readonly appVersion = signal<string>('');
Signals provide:
  • Fine-grained reactivity
  • Automatic change detection optimization
  • Type-safe reactive state
  • Better performance than traditional observables for simple state

Next steps

PWA features

Learn about Progressive Web App capabilities

Routing system

Explore the routing configuration and navigation

Service architecture

Deep dive into the service layer pattern

Quick start

Start building with the application

Build docs developers (and LLMs) love