Skip to content

Modern Angular application to showcase stand-alone components, typed forms, signals and newer features

License

Notifications You must be signed in to change notification settings

loiane/modern-angular

Repository files navigation

Modern Angular Shop πŸš€πŸ›’

Angular Build Angular Version Node Version Test Framework

A modern Angular sample project showcasing the latest features and best practices, built as an interactive coffee shop application.

🎯 Featured Angular Technologies

  • Angular v20 (Release Candidate) - Latest Angular features
  • Standalone Components (v14+) - No NgModule dependencies
  • Angular Signals (v16+) - Modern reactive primitives
  • New Control Flow (v17+) - @if, @for, @switch syntax
  • Modern inject() function - Dependency injection
  • Angular Material - UI component library
  • Jest Testing - Modern testing framework

πŸ› οΈ Development Tools & Extensions

Recommended IDE Setup

  • Visual Studio Code - Primary development environment
  • Angular Language Service - Essential for Angular development
  • Angular Essentials Extension Pack by Loiane - Install here

Key Extensions Included:

  • Angular Language Service
  • Angular Snippets
  • TypeScript Hero
  • GitLens
  • Prettier
  • ESLint
  • Material Icon Theme

πŸ“š Learning Resources

This project includes comprehensive documentation in the /docs folder:

πŸ§ͺ Testing Strategy

The project uses Jest instead of Karma for faster test execution:

  • Unit Tests: Component and service testing
  • Coverage Reports: Available in /coverage directory
  • CI/CD Integration: GitHub Actions automated testing
  • Test-Driven Development: Comprehensive test suites

Test Coverage

Current test coverage includes:

  • βœ… All services (Cart, Products, Form Utils)
  • βœ… All components (Cart, Products, Shared)
  • βœ… Route configuration
  • βœ… Application bootstrap

πŸ”§ Technical Details

Project Structure

src/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ cart/              # Shopping cart feature
β”‚   β”œβ”€β”€ products/          # Product catalog feature
β”‚   β”œβ”€β”€ components/        # Shared components
β”‚   β”œβ”€β”€ app.routes.ts      # Route configuration
β”‚   └── app.component.ts   # Root component
β”œβ”€β”€ public/                # Static assets
└── styles.scss            # Global styles

Modern Angular Patterns Used

  1. Standalone Components: No NgModule dependencies

    @Component({
      standalone: true,
      imports: [CommonModule, MatButtonModule],
      // ...
    })
  2. Signal-based State Management:

    cartItems = signal<CartItem[]>([]);
    cartCount = computed(() => this.cartItems().length);
  3. Modern Dependency Injection:

    private cartService = inject(CartService);
    private router = inject(Router);

πŸš€ Deployment

The project includes GitHub Actions for:

  • βœ… Continuous Integration - Automated testing
  • βœ… Build Verification - Ensure production builds work
  • βœ… Dependency Updates - Automated dependency management

Production Build

npm run build
# Outputs to dist/ directory

🀝 Contributing

This is a demonstration project showcasing modern Angular features. Feel free to:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add/update tests
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘©β€πŸ’» Author

Loiane Groner


⭐ Star this repository if you found it helpful! ⭐

πŸ“Έ Application Screenshots

Products List Page

Modern product listing with Material Design components and shopping cart integration:

Products Page - Coffee Shop Main Page

Shopping Cart Page

Interactive cart with quantity management and total calculations:

Shopping Cart Page

πŸ—οΈ Project Architecture

This application demonstrates modern Angular architecture patterns:

  • Feature-based structure with lazy-loaded routes
  • Standalone components eliminating NgModule complexity
  • Signal-based state management for cart functionality
  • Reactive forms with typed validators
  • Service-based architecture with dependency injection
  • Material Design for consistent UI/UX

Key Features Implemented

  • πŸ›οΈ Product Catalog - Browse coffee products with filtering
  • πŸ›’ Shopping Cart - Add/remove items with real-time updates
  • πŸ“± Responsive Design - Mobile-first Material Design
  • πŸ§ͺ Comprehensive Testing - Jest unit tests with coverage

πŸš€ Quick Start Guide

Prerequisites

  • Node.js 22+ - Download here
  • npm (comes with Node.js)
  • Git (optional, for cloning)

Installation & Running

  1. Install dependencies:

    npm install
  2. Start the development server:

    npm run start

    The application will automatically open at http://localhost:4200

  3. Run tests:

    npm run test           # Run all tests
    npm run test:watch     # Watch mode
    npm run test:coverage  # Generate coverage report
  4. Build for production:

    npm run build

Available NPM Scripts

Command Description
npm run start Start dev server with auto-reload
npm run build Production build
npm run test Run Jest tests once
npm run test:watch Run tests in watch mode
npm run test:coverage Generate test coverage report
npm run watch Build in watch mode

About

Modern Angular application to showcase stand-alone components, typed forms, signals and newer features

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •