Skip to content

A modern, feature-rich e-commerce storefront built with Angular 19, showcasing best practices in state management, routing, and user experience design.

Notifications You must be signed in to change notification settings

Deltas-Lee/Storefront

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DeltaStore - Angular Storefront Application

A modern, feature-rich e-commerce storefront built with Angular 19, showcasing best practices in state management, routing, and user experience design.

Screenshots

Products Page Product Details

πŸš€ Quick Start

Prerequisites

  • Node.js (v18 or higher)
  • npm (v9 or higher)
  • Angular CLI (v19.0.0)

Installation

  1. Install Angular CLI globally (if not already installed):

    npm install -g @angular/cli@19
  2. Install project dependencies:

    cd storefront
    npm install
  3. Start the development server:

    npm start
    # or
    ng serve
  4. Open your browser and navigate to http://localhost:4200/

πŸ“ Project Structure

storefront/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ cart/           # Shopping cart component
β”‚   β”‚   β”‚   β”œβ”€β”€ footer/         # Footer component
β”‚   β”‚   β”‚   β”œβ”€β”€ header/         # Navigation header
β”‚   β”‚   β”‚   β”œβ”€β”€ loading-spinner/ # Loading state indicator
β”‚   β”‚   β”‚   β”œβ”€β”€ product-card/   # Product display card
β”‚   β”‚   β”‚   β”œβ”€β”€ product-details/ # Product detail modal
β”‚   β”‚   β”‚   └── toast/          # Toast notifications
β”‚   β”‚   β”œβ”€β”€ pages/              # Route-level components
β”‚   β”‚   β”‚   β”œβ”€β”€ checkout/       # Checkout page
β”‚   β”‚   β”‚   └── product-list/   # Product listing page
β”‚   β”‚   β”œβ”€β”€ models/             # TypeScript interfaces
β”‚   β”‚   β”‚   └── product.model.ts
β”‚   β”‚   β”œβ”€β”€ services/           # Business logic services
β”‚   β”‚   β”‚   β”œβ”€β”€ cart.service.ts      # Cart state management
β”‚   β”‚   β”‚   β”œβ”€β”€ product.service.ts   # Product data fetching
β”‚   β”‚   β”‚   └── toast.service.ts     # Toast notifications
β”‚   β”‚   β”œβ”€β”€ app.config.ts       # Application configuration
β”‚   β”‚   β”œβ”€β”€ app.routes.ts       # Routing configuration
β”‚   β”‚   └── app.component.ts    # Root component
β”‚   β”œβ”€β”€ assets/                 # Static assets
β”‚   β”œβ”€β”€ styles.scss            # Global styles
β”‚   └── index.html             # Main HTML file
β”œβ”€β”€ angular.json               # Angular workspace configuration
β”œβ”€β”€ package.json              # Dependencies and scripts
└── tsconfig.json            # TypeScript configuration

✨ Features

Core Functionality

  • Product Browsing: Display all products from Fake Store API
  • Category Filtering: Filter products by category with responsive sidebar
  • Shopping Cart: Add, remove, update quantities, and manage cart items
  • Product Details: View detailed product information in modal
  • Toast Notifications: Real-time feedback for user actions
  • Loading States: Smooth loading indicators for better UX

Advanced Features

  • Signal-Based State Management: Using Angular Signals for reactive state
  • Computed Values: Automatic recalculation of totals, taxes, and derived state
  • Browser Warnings: Alert users before losing cart data on refresh
  • Custom Confirmation Dialogs: Beautiful modal confirmations instead of browser alerts
  • Responsive Design: Mobile-friendly layout with breakpoints
  • Accessibility: ARIA labels, keyboard navigation, screen reader support
  • Animations: Smooth transitions and micro-interactions

Technical Highlights

  • Standalone Components: Modern Angular architecture without NgModules
  • RxJS Integration: Observable-based HTTP requests
  • CSS Grid & Flexbox: Modern layout techniques
  • SCSS Variables: Maintainable styling with CSS custom properties
  • TypeScript Strict Mode: Type-safe code throughout

🎨 Key Components

Services

CartService

  • Signal-based reactive cart state management
  • Computed totals and item counts
  • Persistent state during session
  • Toast notification integration

ProductService

  • HTTP client for Fake Store API
  • Observable-based data fetching
  • Type-safe product models

ToastService

  • Global notification system
  • Multiple toast types (success, error, info, warning)
  • Auto-dismiss functionality
  • Signal-based state management

Components

Header

  • Sticky navigation with gradient background
  • Active route highlighting
  • Cart badge with item count
  • Responsive mobile menu

Product List

  • Grid layout with category filters
  • Loading spinner during data fetch
  • Empty state handling
  • Product detail modal integration

Cart

  • Item management (add, remove, update quantity)
  • Real-time total calculations
  • Tax estimation (15%)
  • Confirmation dialog for clearing cart
  • Enhanced empty state with call-to-action

Product Card

  • Consistent card heights
  • Hidden "Add to Cart" button (reveals on hover)
  • Image optimization
  • Truncated text with ellipsis

πŸ› οΈ Available Scripts

# Start development server
npm start

# Build for production
npm run build

# Run unit tests
npm test

# Run linter
npm run lint

# Generate component
ng generate component component-name

πŸ”§ Configuration

Angular Version

This project uses Angular 19.0.0 with standalone components architecture.

API Integration

The application consumes the Fake Store API:

  • Products endpoint: https://fakestoreapi.com/products

Routing

  • /products - Product listing page (default)
  • /cart - Shopping cart page
  • / - Redirects to /products

🎯 State Management

This application uses Angular Signals for state management:

// Example: Cart Service with Signals
private readonly _items = signal<CartItem[]>([]);
readonly items = computed(() => this._items());
readonly totalItems = computed(() => 
  this._items().reduce((sum, item) => sum + item.quantity, 0)
);

🎨 Styling Approach

  • SCSS for enhanced CSS capabilities
  • CSS Custom Properties for theming
  • BEM-like naming for component styles
  • CSS Grid & Flexbox for layouts
  • Media queries for responsive design

β™Ώ Accessibility Features

  • Semantic HTML elements
  • ARIA labels and roles
  • Keyboard navigation support
  • Focus visible states
  • Screen reader announcements
  • Color contrast compliance

πŸ› Known Limitations

  • Cart data is not persisted (resets on page refresh)
  • Checkout is non-functional (UI only)

πŸš€ Future Enhancements

Potential improvements if time permits:

  • LocalStorage cart persistence
  • Product search with debouncing
  • Sort products by price/rating/name
  • Pagination or infinite scroll
  • Wishlist functionality
  • Dark mode theme
  • E2E tests with Cypress

πŸ“š Additional Resources

πŸ“„ License

This project was created for learning purpose.


Built with ❀️ using Angular 19 and TypeScript

About

A modern, feature-rich e-commerce storefront built with Angular 19, showcasing best practices in state management, routing, and user experience design.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published