Skip to content

va-stefanek/workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Angular Shopping Cart Workshop

Master the transition from RxJS to Angular Signals through building a comprehensive shopping cart application

Angular TypeScript Signals License

🎯 Workshop Overview

This comprehensive workshop guides you through the evolution of reactive programming in Angular, from traditional RxJS patterns to modern Angular Signals. Build a feature-rich shopping cart application while learning cutting-edge Angular patterns and best practices.

πŸ† Key Learning Outcomes

  • Master Angular Signals: Understand reactive primitives and fine-grained reactivity
  • Migrate from RxJS: Learn systematic migration strategies and patterns
  • Build Production-Ready UIs: Implement responsive, accessible, and performant interfaces
  • Advanced State Management: Handle complex application state with modern patterns
  • Performance Optimization: Leverage signals for optimal change detection
  • Real-World Patterns: Apply enterprise-grade architecture and testing strategies

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm 9+
  • Angular CLI 18+
  • Modern browser with developer tools
  • Angular DevTools extension (recommended)

Installation

# Clone the repository
git clone <repository-url>
cd shopping-cart-workshop

# Install dependencies
npm install

# Start the development server
npm start

# Open browser to http://localhost:4200

πŸ“š Workshop Levels

🟒 Level 1: Basic (RxJS Implementation)

Master traditional reactive patterns

  • Learn RxJS BehaviorSubject and Observable patterns
  • Implement reactive state management
  • Handle asynchronous operations and side effects
  • Build reactive UI components
  • Files: src/app/basic/services/shopping-cart-rxjs.service.ts

🟑 Level 2: Intermediate (Signals + Computed)

Transition to modern reactive programming

  • Understand Angular Signals fundamentals
  • Implement computed signals for derived state
  • Use effects for side effects and persistence
  • Build advanced filtering and analytics
  • Files: src/app/intermediate/services/cart-computed.service.ts

πŸ”΄ Level 3: Advanced (Resource API + Performance)

Build production-ready applications

  • Master the Resource API for data fetching
  • Implement complex signal compositions
  • Build comprehensive analytics and monitoring
  • Create export/import functionality
  • Files: src/app/advanced/services/product-resource.service.ts

🎨 Modern UI Features

3-Column Responsive Cart Layout

Our cart implementation features a modern, responsive 3-column layout:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  [Image]  β”‚        Item Details        β”‚   Actions   β”‚
β”‚   80px    β”‚                           β”‚    160px    β”‚
β”‚           β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚             β”‚
β”‚           β”‚  β”‚ Name & Category     β”‚   β”‚ [Duplicate] β”‚
β”‚           β”‚  β”‚ Price per unit      β”‚   β”‚ [Wishlist]  β”‚
β”‚           β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚ [Remove]    β”‚
β”‚           β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚             β”‚
β”‚           β”‚  β”‚ [βˆ’] [2] [+] | $50   β”‚   β”‚             β”‚
β”‚           β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Improvements:

  • Responsive Design: Adapts from 3-column desktop to single-column mobile
  • Accessibility: 44px touch targets, ARIA labels, keyboard navigation
  • Performance: Optimized CSS Grid with efficient breakpoints
  • Consistency: Unified design across all three workshop levels

Responsive Breakpoints

  • Desktop (1400px+): Full 3-column layout with spacious controls
  • Tablet (1200px-1400px): Compact 3-column with smaller elements
  • Mobile (768px-1200px): Stacked layout with larger touch targets
  • Small Mobile (<768px): Single column with centered content

πŸ— Architecture

Branch Strategy

Branch Purpose Status
workshop-starter Educational skeleton code with TODOs βœ… Current
workshop-complete Full solution with comments βœ… Ready
production-ready Optimized production implementation βœ… Ready
main Final polished version πŸ”„ In Progress

Project Structure

shopping-cart-workshop/
β”œβ”€β”€ src/app/
β”‚   β”œβ”€β”€ basic/              # Level 1: RxJS patterns
β”‚   β”‚   β”œβ”€β”€ services/       # State management services
β”‚   β”‚   └── components/     # UI components
β”‚   β”œβ”€β”€ intermediate/       # Level 2: Signals + Computed
β”‚   β”‚   β”œβ”€β”€ services/       # Advanced signal patterns
β”‚   β”‚   └── components/     # Enhanced UI with filters
β”‚   β”œβ”€β”€ advanced/          # Level 3: Resource API
β”‚   β”‚   β”œβ”€β”€ services/       # Production-ready services
β”‚   β”‚   └── components/     # Feature-rich components
β”‚   └── shared/            # Common utilities and models
β”œβ”€β”€ docs/                  # Comprehensive documentation
β”œβ”€β”€ tests/                 # Test suites for each level
└── assets/               # Static resources and data

πŸ›  Available Commands

# Development
npm start                    # Start development server
npm run build               # Build for production
npm run test                # Run all tests
npm run lint                # Lint the codebase

# Level-specific testing
npm run test:basic          # Test basic level
npm run test:intermediate   # Test intermediate level
npm run test:advanced       # Test advanced level

# Documentation
npm run docs:serve          # Serve documentation locally
npm run docs:build          # Build documentation

✨ Features Implemented

Core Shopping Cart

  • βœ… Add/Remove Products: Intuitive cart management
  • βœ… Quantity Controls: Responsive +/- buttons with validation
  • βœ… Real-time Calculations: Automatic totals, tax, and discounts
  • βœ… Persistence: LocalStorage with error handling
  • βœ… Bulk Operations: Multi-item actions and optimizations

Advanced Features

  • βœ… Smart Filtering: Category, search, and price range filters
  • βœ… Dynamic Sorting: Multiple sort options with live updates
  • βœ… Pagination: Efficient data loading and navigation
  • βœ… Analytics Dashboard: Real-time metrics and insights
  • βœ… Export/Import: JSON-based cart data exchange
  • βœ… Wishlist Management: Save items for later
  • βœ… History Tracking: Undo/redo operations

UI/UX Excellence

  • βœ… Responsive Design: Mobile-first, progressive enhancement
  • βœ… Accessibility: WCAG 2.1 AA compliance
  • βœ… Modern Styling: Clean, professional interface
  • βœ… Loading States: Skeleton screens and progress indicators
  • βœ… Error Handling: User-friendly error messages
  • βœ… Performance: Optimized rendering and minimal re-renders

πŸ§ͺ Testing Strategy

Automated Testing

  • Unit Tests: Comprehensive service and component testing
  • Integration Tests: End-to-end workflow validation
  • Performance Tests: Signal update efficiency testing
  • Accessibility Tests: Automated a11y validation

Manual Testing Checklist

  • βœ… Cross-browser compatibility (Chrome, Firefox, Safari, Edge)
  • βœ… Responsive design on various screen sizes
  • βœ… Keyboard navigation and screen reader support
  • βœ… Touch device usability
  • βœ… Performance under load

πŸ“– Documentation

Document Purpose
Setup Instructions Getting started guide
Basic Level Guide RxJS implementation
Intermediate Guide Signals transition
Advanced Guide Resource API mastery
Layout Guide UI design patterns
Branch Guide Git workflow
Changelog Version history

🎯 Success Criteria

You've mastered the workshop when you can:

  • βœ… Explain the differences between RxJS and Signals
  • βœ… Implement reactive state management with both approaches
  • βœ… Migrate existing RxJS code to Signals systematically
  • βœ… Build responsive, accessible UIs with modern patterns
  • βœ… Optimize performance using fine-grained reactivity
  • βœ… Apply production-ready patterns and error handling

🀝 Contributing

This workshop is designed for learning. Feel free to:

  • Experiment: Modify code and explore different approaches
  • Extend: Add new features or improve existing ones
  • Share: Discuss learnings and insights with others
  • Report Issues: Help improve the workshop experience

πŸ“„ License

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

πŸ™ Acknowledgments

  • Angular Team: For Signals and the Resource API
  • Community: For feedback and contributions
  • Educators: For sharing knowledge and best practices

Ready to start your Angular Signals journey? πŸš€

πŸ‘‰ Begin with Setup Instructions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •