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
- 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 develop2026-02-24 00:03:05 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Creates Supabase Edge Function to fetch product data from Open Food Facts API.
Changes
API
Testing
Can be tested locally with
supabase functions serveafter Supabase CLI is set up.Closes #24