feat: add product-lookup Edge Function (#24) #50

Merged
makiolaj merged 1 commits from feature/issue-24-product-lookup into develop 2026-02-24 00:03:05 +00:00
Owner

Creates Supabase Edge Function to fetch product data from Open Food Facts API.

Changes

  • Edge Function at supabase/functions/product-lookup/
  • Fetches from Open Food Facts API by barcode
  • Caches results in products table (upsert)
  • Returns cached data for subsequent requests
  • Handles product not found (404)
  • CORS enabled for frontend
  • Comprehensive error handling
  • README with usage examples

API

POST /functions/v1/product-lookup
{ "barcode": "8000500310427" }

Testing

Can be tested locally with supabase functions serve after Supabase CLI is set up.

Closes #24

Creates Supabase Edge Function to fetch product data from Open Food Facts API. ## Changes - ✅ Edge Function at supabase/functions/product-lookup/ - ✅ Fetches from Open Food Facts API by barcode - ✅ Caches results in products table (upsert) - ✅ Returns cached data for subsequent requests - ✅ Handles product not found (404) - ✅ CORS enabled for frontend - ✅ Comprehensive error handling - ✅ README with usage examples ## API ``` POST /functions/v1/product-lookup { "barcode": "8000500310427" } ``` ## Testing Can be tested locally with `supabase functions serve` after Supabase CLI is set up. Closes #24
makiolaj added 1 commit 2026-02-24 00:03:03 +00:00
feat: add product-lookup Edge Function (#24)
Some checks failed
Deploy to Coolify / Code Quality (pull_request) Has been cancelled
Deploy to Coolify / Run Tests (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Development (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Production (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Test (pull_request) Has been cancelled
Pull Request Checks / Validate PR (pull_request) Has been cancelled
521e3f552f
- Fetch product data from Open Food Facts API
- Cache results in products table
- Handle product not found gracefully
- CORS enabled for frontend access
- Returns cached data for performance

Closes #24
makiolaj merged commit 670b2f9200 into develop 2026-02-24 00:03:05 +00:00
Sign in to join this conversation.