Backend APIs
Food API
Standalone ingredient and recipe catalog service
Food API
The Food API is the standalone catalog service. It runs on port 8081 by default and owns the public food data layer for Cookest.
It provides:
- ingredient search and detail
- recipe catalog browsing
- recipe/ingredient nutrition data
- portion sizes and allergens
- API-key protected write access for catalog maintenance
The App API consumes this service through FOOD_API_URL.
Base URL
http://localhost:8081Health check
GET /healthAuthentication
Read endpoints are public. Write endpoints require an x-api-key header with a write-tier key.
curl -H "x-api-key: <key>" http://localhost:8081/api/v1/recipesEndpoint groups
| Group | Path prefix | Auth required |
|---|---|---|
| Ingredients | /api/v1/ingredients | No |
| Recipes | /api/v1/recipes | Public reads, API key for writes |
Browse Proxy (App API)
The mobile app does not call the Food API directly. Instead, it uses JWT-protected App API proxy routes:
GET /api/browse/recipesGET /api/browse/recipes/{id}GET /api/browse/ingredientsGET /api/browse/ingredients/{id}
The App API validates the JWT first, then forwards the request to the Food API using FOOD_API_URL. This keeps the Food API behind the authenticated application boundary and avoids exposing internal service configuration to clients.
Notes
- The Food API uses
FOOD_DATABASE_URL,FOOD_HOST,FOOD_PORT, andFOOD_CORS_ORIGIN. - The App API talks to this service through
FOOD_API_URLand optionallyFOOD_API_KEY.