Shared - Common Types and Data

This directory contains TypeScript types and data that are shared between the frontend and backend.

Files

  • types.ts - TypeScript interfaces and the pastry menu data

Types

Core Interfaces

  • PastryItem - Individual pastry with id, name, description, price, image, and category
  • CartItem - Pastry item with quantity
  • CustomerInfo - Customer details for orders
  • Order - Complete order with customer info, items, total, and status
  • PASTRY_MENU - Array of all available pastries with details

Categories

The system supports these pastry categories:

  • croissants - Butter croissants, pain au chocolat, almond croissants
  • cakes - Cake slices and desserts
  • cookies - Cookie packs
  • breads - Artisan breads and baguettes
  • specialties - Éclairs, macarons, danishes

Usage

Both frontend and backend import these types to ensure consistency across the application. The menu data is used to populate the customer interface and validate orders.