Toy Store Shared Code

This directory contains code that is shared between the frontend and backend.

Files

  • types.ts - TypeScript interfaces and utility functions used by both frontend and backend

Shared Types

  • Product - Product data structure
  • Category - Category data structure
  • CartItem - Shopping cart item structure

Utility Functions

  • formatPrice - Format a number as a currency string
  • calculateCartTotal - Calculate the total price of items in the cart