Shared

Shared code between frontend and backend.

Structure

shared/
├── types.ts          # TypeScript interfaces and types
└── utils.ts          # Shared utility functions

Guidelines

  • Code here must work in both browser and Deno environments
  • Do NOT use the Deno keyword directly
  • Use https://esm.sh for imports to ensure compatibility
  • Keep dependencies minimal

Types

Core Types

  • Recipe - Recipe metadata
  • Ingredient - Recipe ingredient with quantity/unit
  • Instruction - Recipe step
  • RecipeWithDetails - Full recipe with ingredients and instructions

API Types

  • IngestRequest - Recipe URL submission
  • ShoppingListRequest - Shopping list generation request
  • ShoppingListItem - Aggregated shopping list entry