Cookest
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:8081

Health check

GET /health

Authentication

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/recipes

Endpoint groups

GroupPath prefixAuth required
Ingredients/api/v1/ingredientsNo
Recipes/api/v1/recipesPublic 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/recipes
  • GET /api/browse/recipes/{id}
  • GET /api/browse/ingredients
  • GET /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, and FOOD_CORS_ORIGIN.
  • The App API talks to this service through FOOD_API_URL and optionally FOOD_API_KEY.

On this page