These API routes are for the Phase 2 web client (apps/web). The mobile app does NOT use these endpoints — it calls Supabase directly via RPC functions, table queries, and supabase.auth methods.
Base URL
Environment URL Development http://localhost:3000/apiProduction https://recipe-room.vercel.app/api
Authentication
Protected endpoints require a Bearer token in the Authorization header:
Authorization: Bearer <jwt-token>
Tokens are obtained via the login endpoint and managed by Supabase Auth.
All errors follow a consistent structure:
{
"error" : {
"code" : "VALIDATION_ERROR" ,
"message" : "Invalid email format" ,
"details" : { "field" : "email" }
}
}
Code Status Description VALIDATION_ERROR400 Invalid input data UNAUTHORIZED401 Missing or invalid token FORBIDDEN403 Insufficient permissions NOT_FOUND404 Resource not found CONFLICT409 Duplicate resource INTERNAL_ERROR500 Server error
List endpoints support pagination via query parameters:
Parameter Default Description page1 Page number limit20 Items per page
Paginated responses include a pagination object:
{
"data" : [ ... ],
"pagination" : {
"page" : 1 ,
"limit" : 20 ,
"total" : 150 ,
"totalPages" : 8
}
}
Endpoint Groups
Authentication Register, login, logout
Users Profiles, follow, followers
Recipes CRUD, favorites, featured
Posts CRUD, favorites, comments
Collections CRUD, items, favorites
Other Upload, search, notifications