### List All Reviews (Bash) Source: https://context7.com/prathmesh49/reciperadar/llms.txt Retrieves all reviews across all recipes. Each review includes rating, comment, associated recipe, user, and creation timestamp. Accessed via a GET request to the reviews endpoint. ```bash # Get all reviews curl -X GET http://localhost:8000/reviews/ \ -H "Content-Type: application/json" # Response [ { "url": "http://localhost:8000/reviews/1/", "recipe": "http://localhost:8000/recipes/1/", "user": "http://localhost:8000/users/2/", "rating": 5, "comment": "Absolutely delicious! My family loved it.", "created_date": "2024-01-16T18:45:00Z" } ] ``` -------------------------------- ### List All Recipes - Bash API Request Source: https://context7.com/prathmesh49/reciperadar/llms.txt Retrieves all recipes in the system using a GET request. Requires 'Content-Type: application/json' header. Returns an array of recipe objects, each including title, ingredients, instructions, cuisine, category, image URL, and creation date. ```bash # Get all recipes curl -X GET http://localhost:8000/recipes/ \ -H "Content-Type: application/json" ``` -------------------------------- ### List All Users - Bash API Request Source: https://context7.com/prathmesh49/reciperadar/llms.txt Retrieves all registered user profiles from the database using a GET request. Requires 'Content-Type: application/json' header. Returns an array of user objects. ```bash # Get all users curl -X GET http://localhost:8000/users/ \ -H "Content-Type: application/json" ``` -------------------------------- ### Get Reviews by Recipe ID (Bash) Source: https://context7.com/prathmesh49/reciperadar/llms.txt Fetches all reviews for a specific recipe ID. Useful for displaying recipe feedback on detail pages. Requires the recipe ID in the URL path. ```bash # Get all reviews for recipe ID 1 curl -X GET http://localhost:8000/reviews/recipe/1/ \ -H "Content-Type: application/json" # Response [ { "url": "http://localhost:8000/reviews/1/", "recipe": "http://localhost:8000/recipes/1/", "user": "http://localhost:8000/users/2/", "rating": 5, "comment": "Absolutely delicious! My family loved it.", "created_date": "2024-01-16T18:45:00Z" }, { "url": "http://localhost:8000/reviews/3/", "recipe": "http://localhost:8000/recipes/1/", "user": "http://localhost:8000/users/3/", "rating": 4, "comment": "Great recipe, added extra garlic for more flavor.", "created_date": "2024-01-17T12:00:00Z" } ] ``` -------------------------------- ### Save Recipe to Collection (Bash) Source: https://context7.com/prathmesh49/reciperadar/llms.txt Saves a recipe to a user's personal collection. Requires UserProfile and Recipe URLs in the request body for POST requests. Supports retrieving all saved recipes with a GET request. ```bash # Save a recipe to user's collection curl -X POST http://localhost:8000/savedrecipes/ \ -H "Content-Type: application/json" \ -d '{ "UserProfile": "http://localhost:8000/users/1/", "Recipe": "http://localhost:8000/recipes/2/" }' # Response (201 Created) { "url": "http://localhost:8000/savedrecipes/1/", "UserProfile": "http://localhost:8000/users/1/", "Recipe": "http://localhost:8000/recipes/2/" } # Get all saved recipes curl -X GET http://localhost:8000/savedrecipes/ \ -H "Content-Type: application/json" ``` -------------------------------- ### Get User by Username - Bash API Request Source: https://context7.com/prathmesh49/reciperadar/llms.txt Fetches a specific user profile by their unique username using a GET request. This custom endpoint requires 'Content-Type: application/json' header. Returns a single user object. ```bash # Get user by username curl -X GET http://localhost:8000/users/username/chef_john/ \ -H "Content-Type: application/json" ``` -------------------------------- ### Create Review (Bash) Source: https://context7.com/prathmesh49/reciperadar/llms.txt Submits a new review for a recipe. Requires recipe and user references, rating (integer), and comment text in the JSON body of a POST request. ```bash # Create a new review curl -X POST http://localhost:8000/reviews/ \ -H "Content-Type: application/json" \ -d '{ "recipe": "http://localhost:8000/recipes/2/", "user": "http://localhost:8000/users/1/", "rating": 5, "comment": "Perfect pizza recipe! The crust came out crispy and delicious." }' # Response (201 Created) { "url": "http://localhost:8000/reviews/4/", "recipe": "http://localhost:8000/recipes/2/", "user": "http://localhost:8000/users/1/", "rating": 5, "comment": "Perfect pizza recipe! The crust came out crispy and delicious.", "created_date": "2024-01-20T15:30:00Z" } ``` -------------------------------- ### Create New User - Bash API Request Source: https://context7.com/prathmesh49/reciperadar/llms.txt Registers a new user profile using a POST request. Requires 'Content-Type: application/json' header and a JSON payload with user details. Returns the created user object with a 201 Created status. ```bash # Create a new user curl -X POST http://localhost:8000/users/ \ -H "Content-Type: application/json" \ -d '{ "username": "home_cook_jane", "password": "securepassword123", "bio": "Home cook passionate about Italian cuisine", "location": "Los Angeles, CA", "avatar_url": "https://example.com/avatars/jane.png", "name": "Jane Doe" }' ``` -------------------------------- ### Create New Recipe - Bash API Request Source: https://context7.com/prathmesh49/reciperadar/llms.txt Adds a new recipe to the platform using a POST request. Requires 'Content-Type: application/json' header and a JSON payload with recipe details including title, ingredients, instructions, cuisine, category, and user profile. Returns the created recipe object with a 201 Created status. ```bash # Create a new recipe curl -X POST http://localhost:8000/recipes/ \ -H "Content-Type: application/json" \ -d '{ "title": "Homemade Margherita Pizza", "ingredients": ["pizza dough", "tomato sauce", "fresh mozzarella", "basil", "olive oil"], "instructions": "1. Preheat oven to 475°F. 2. Roll out dough. 3. Spread sauce evenly. 4. Add mozzarella slices. 5. Bake for 12-15 minutes. 6. Top with fresh basil.", "cuisine": "Italian", "category": "Main Course", "image": "https://example.com/images/margherita.jpg", "UserProfile": "http://localhost:8000/users/1/" }' ``` -------------------------------- ### Search Recipes by Title (Bash) Source: https://context7.com/prathmesh49/reciperadar/llms.txt Searches for recipes by title using a case-insensitive partial match. Requires a 'query' parameter. Returns a list of matching recipes or appropriate error messages for missing queries or no results. ```bash # Search for recipes containing "chicken" curl -X GET "http://localhost:8000/recipe/search/?query=chicken" \ -H "Content-Type: application/json" # Response [ { "url": "http://localhost:8000/recipes/1/", "title": "Classic Chicken Stir Fry", "ingredients": ["chicken breast", "soy sauce", "garlic", "ginger", "vegetables"], "instructions": "1. Slice chicken...", "cuisine": "Asian", "category": "Main Course", "image": "https://example.com/images/stir-fry.jpg", "UserProfile": "http://localhost:8000/users/1/", "created_date": "2024-01-15T10:30:00Z" }, { "url": "http://localhost:8000/recipes/5/", "title": "Lemon Herb Chicken", "ingredients": ["chicken thighs", "lemon", "herbs", "garlic"], "instructions": "1. Marinate chicken...", "cuisine": "Mediterranean", "category": "Main Course", "image": "https://example.com/images/lemon-chicken.jpg", "UserProfile": "http://localhost:8000/users/2/", "created_date": "2024-01-18T09:15:00Z" } ] # Error response when no query provided # GET /recipe/search/ # Response (400 Bad Request): "Please provide a search query." # Error response when no results found # GET /recipe/search/?query=nonexistent # Response (404 Not Found): "No recipes found." ``` -------------------------------- ### Reviews API Source: https://context7.com/prathmesh49/reciperadar/llms.txt Endpoints for retrieving and creating recipe reviews. ```APIDOC ## GET /reviews/ ### Description Retrieves all reviews across all recipes. Each review includes rating, comment, associated recipe, user, and creation timestamp. ### Method GET ### Endpoint `/reviews/` ### Response #### Success Response (200) - **url** (string) - The URL of the review. - **recipe** (string) - The URL of the recipe the review is for. - **user** (string) - The URL of the user who submitted the review. - **rating** (integer) - The rating given to the recipe (e.g., 1-5). - **comment** (string) - The textual comment provided by the user. - **created_date** (string) - The date and time the review was created (ISO 8601 format). #### Response Example ```json [ { "url": "http://localhost:8000/reviews/1/", "recipe": "http://localhost:8000/recipes/1/", "user": "http://localhost:8000/users/2/", "rating": 5, "comment": "Absolutely delicious! My family loved it.", "created_date": "2024-01-16T18:45:00Z" } ] ``` ## GET /reviews/recipe/:recipe_id/ ### Description Fetches all reviews for a specific recipe ID. Useful for displaying recipe feedback and ratings on recipe detail pages. ### Method GET ### Endpoint `/reviews/recipe/:recipe_id/` #### Path Parameters - **recipe_id** (integer) - Required - The ID of the recipe for which to retrieve reviews. ### Response #### Success Response (200) - Returns a list of review objects for the specified recipe. #### Response Example ```json [ { "url": "http://localhost:8000/reviews/1/", "recipe": "http://localhost:8000/recipes/1/", "user": "http://localhost:8000/users/2/", "rating": 5, "comment": "Absolutely delicious! My family loved it.", "created_date": "2024-01-16T18:45:00Z" } ] ``` ## POST /reviews/ ### Description Submits a new review for a recipe. Requires the recipe reference, user reference, rating (integer), and comment text. ### Method POST ### Endpoint `/reviews/` #### Request Body - **recipe** (string) - Required - The URL of the recipe being reviewed. - **user** (string) - Required - The URL of the user submitting the review. - **rating** (integer) - Required - The rating given to the recipe (e.g., 1-5). - **comment** (string) - Required - The textual comment for the review. ### Request Example ```bash curl -X POST http://localhost:8000/reviews/ \ -H "Content-Type: application/json" \ -d '{ "recipe": "http://localhost:8000/recipes/2/", "user": "http://localhost:8000/users/1/", "rating": 5, "comment": "Perfect pizza recipe! The crust came out crispy and delicious." }' ``` ### Response #### Success Response (201 Created) - **url** (string) - The URL of the newly created review. - **recipe** (string) - The URL of the recipe being reviewed. - **user** (string) - The URL of the user who submitted the review. - **rating** (integer) - The rating given to the recipe. - **comment** (string) - The textual comment provided by the user. - **created_date** (string) - The date and time the review was created (ISO 8601 format). #### Response Example ```json { "url": "http://localhost:8000/reviews/4/", "recipe": "http://localhost:8000/recipes/2/", "user": "http://localhost:8000/users/1/", "rating": 5, "comment": "Perfect pizza recipe! The crust came out crispy and delicious.", "created_date": "2024-01-20T15:30:00Z" } ``` ``` -------------------------------- ### User Management API Source: https://context7.com/prathmesh49/reciperadar/llms.txt Endpoints for retrieving and creating user profiles. ```APIDOC ## GET /users/ ### Description Retrieves all registered user profiles from the database. Returns an array of user objects containing profile information including username, bio, location, and avatar URL. ### Method GET ### Endpoint /users/ ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **url** (string) - The URL of the user profile. - **username** (string) - The unique username of the user. - **password** (string) - The user's password (should be treated as sensitive and not exposed in typical GET requests). - **bio** (string) - A short biography of the user. - **location** (string) - The user's location. - **avatar_url** (string) - The URL of the user's avatar image. - **name** (string) - The full name of the user. #### Response Example ```json [ { "url": "http://localhost:8000/users/1/", "username": "chef_john", "password": "********", "bio": "Professional chef with 10 years experience", "location": "New York, NY", "avatar_url": "https://example.com/avatars/chef_john.png", "name": "John Smith" } ] ``` ## GET /users/username// ### Description Fetches a specific user profile by their unique username. This custom endpoint allows looking up users without knowing their database ID. ### Method GET ### Endpoint /users/username/{username}/ ### Parameters #### Path Parameters - **username** (string) - Required - The unique username of the user to retrieve. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **url** (string) - The URL of the user profile. - **username** (string) - The unique username of the user. - **bio** (string) - A short biography of the user. - **location** (string) - The user's location. - **avatar_url** (string) - The URL of the user's avatar image. - **name** (string) - The full name of the user. #### Response Example ```json { "url": "http://localhost:8000/users/1/", "username": "chef_john", "bio": "Professional chef with 10 years experience", "location": "New York, NY", "avatar_url": "https://example.com/avatars/chef_john.png", "name": "John Smith" } ``` ## POST /users/ ### Description Registers a new user profile in the system. Accepts user details including username, password, bio, location, and optional avatar URL. ### Method POST ### Endpoint /users/ ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **username** (string) - Required - The unique username for the new user. - **password** (string) - Required - The password for the new user. - **bio** (string) - Optional - A short biography for the user. - **location** (string) - Optional - The user's location. - **avatar_url** (string) - Optional - The URL of the user's avatar image. - **name** (string) - Required - The full name of the user. ### Request Example ```json { "username": "home_cook_jane", "password": "securepassword123", "bio": "Home cook passionate about Italian cuisine", "location": "Los Angeles, CA", "avatar_url": "https://example.com/avatars/jane.png", "name": "Jane Doe" } ``` ### Response #### Success Response (201 Created) - **url** (string) - The URL of the newly created user profile. - **username** (string) - The username of the newly created user. - **bio** (string) - The biography of the newly created user. - **location** (string) - The location of the newly created user. - **avatar_url** (string) - The avatar URL of the newly created user. - **name** (string) - The full name of the newly created user. #### Response Example ```json { "url": "http://localhost:8000/users/2/", "username": "home_cook_jane", "bio": "Home cook passionate about Italian cuisine", "location": "Los Angeles, CA", "avatar_url": "https://example.com/avatars/jane.png", "name": "Jane Doe" } ``` ``` -------------------------------- ### Full Recipe Update (PUT) API Request Source: https://context7.com/prathmesh49/reciperadar/llms.txt This snippet demonstrates how to perform a full update on a recipe using an HTTP PUT request. It includes the endpoint, headers, and a JSON payload with updated recipe details. Ensure the 'Content-Type' header is set to 'application/json'. ```bash curl -X PUT http://localhost:8000/recipes/1/ \ -H "Content-Type: application/json" \ -d '{ "title": "Classic Chicken Stir Fry with Vegetables", "ingredients": ["chicken breast", "soy sauce", "garlic", "ginger", "bell peppers", "broccoli"], "instructions": "Complete updated instructions...", "cuisine": "Asian", "category": "Main Course", "image": "https://example.com/images/stir-fry-updated.jpg", "UserProfile": "http://localhost:8000/users/1/" }' ``` -------------------------------- ### Recipe Management API Source: https://context7.com/prathmesh49/reciperadar/llms.txt Endpoints for retrieving and creating recipes. ```APIDOC ## GET /recipes/ ### Description Retrieves all recipes in the system. Each recipe includes title, ingredients (as JSON array), instructions, cuisine type, category, image URL, and creation date. ### Method GET ### Endpoint /recipes/ ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **url** (string) - The URL of the recipe. - **title** (string) - The title of the recipe. - **ingredients** (array of strings) - A list of ingredients for the recipe. - **instructions** (string) - Step-by-step instructions for preparing the recipe. - **cuisine** (string) - The cuisine type of the recipe (e.g., Italian, Asian). - **category** (string) - The category of the recipe (e.g., Main Course, Dessert). - **image** (string) - The URL of the recipe's image. - **UserProfile** (string) - The URL of the user who created the recipe. - **created_date** (string) - The date and time the recipe was created (ISO 8601 format). #### Response Example ```json [ { "url": "http://localhost:8000/recipes/1/", "title": "Classic Chicken Stir Fry", "ingredients": ["chicken breast", "soy sauce", "garlic", "ginger", "vegetables"], "instructions": "1. Slice chicken. 2. Heat oil in wok. 3. Stir fry chicken until golden...", "cuisine": "Asian", "category": "Main Course", "image": "https://example.com/images/stir-fry.jpg", "UserProfile": "http://localhost:8000/users/1/", "created_date": "2024-01-15T10:30:00Z" } ] ``` ## POST /recipes/ ### Description Adds a new recipe to the platform. Requires title, ingredients array, instructions, cuisine, category, and associated user profile. ### Method POST ### Endpoint /recipes/ ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **title** (string) - Required - The title of the recipe. - **ingredients** (array of strings) - Required - A list of ingredients for the recipe. - **instructions** (string) - Required - Step-by-step instructions for preparing the recipe. - **cuisine** (string) - Required - The cuisine type of the recipe. - **category** (string) - Required - The category of the recipe. - **image** (string) - Optional - The URL of the recipe's image. - **UserProfile** (string) - Required - The URL of the user who created the recipe. ### Request Example ```json { "title": "Homemade Margherita Pizza", "ingredients": ["pizza dough", "tomato sauce", "fresh mozzarella", "basil", "olive oil"], "instructions": "1. Preheat oven to 475°F. 2. Roll out dough. 3. Spread sauce evenly. 4. Add mozzarella slices. 5. Bake for 12-15 minutes. 6. Top with fresh basil.", "cuisine": "Italian", "category": "Main Course", "image": "https://example.com/images/margherita.jpg", "UserProfile": "http://localhost:8000/users/1/" } ``` ### Response #### Success Response (201 Created) - **url** (string) - The URL of the newly created recipe. - **title** (string) - The title of the newly created recipe. - **ingredients** (array of strings) - The ingredients of the newly created recipe. - **instructions** (string) - The instructions for the newly created recipe. - **cuisine** (string) - The cuisine type of the newly created recipe. - **category** (string) - The category of the newly created recipe. - **image** (string) - The image URL of the newly created recipe. - **UserProfile** (string) - The URL of the user who created the recipe. - **created_date** (string) - The date and time the recipe was created (ISO 8601 format). #### Response Example ```json { "url": "http://localhost:8000/recipes/2/", "title": "Homemade Margherita Pizza", "ingredients": ["pizza dough", "tomato sauce", "fresh mozzarella", "basil", "olive oil"], "instructions": "1. Preheat oven to 475°F...", "cuisine": "Italian", "category": "Main Course", "image": "https://example.com/images/margherita.jpg", "UserProfile": "http://localhost:8000/users/1/", "created_date": "2024-01-20T14:00:00Z" } ``` ``` -------------------------------- ### Full Update Recipe Source: https://context7.com/prathmesh49/reciperadar/llms.txt Updates an existing recipe with new details. This endpoint allows for a complete replacement of recipe information. ```APIDOC ## PUT /recipes/{id}/ ### Description Updates an existing recipe identified by its ID with the provided data. This is a full update, meaning all fields can be modified. ### Method PUT ### Endpoint `/recipes/{id}/` ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the recipe to update. #### Query Parameters None #### Request Body - **title** (string) - Required - The title of the recipe. - **ingredients** (array of strings) - Required - A list of ingredients for the recipe. - **instructions** (string) - Required - The step-by-step instructions for preparing the recipe. - **cuisine** (string) - Optional - The cuisine type of the recipe (e.g., "Asian"). - **category** (string) - Optional - The category of the recipe (e.g., "Main Course"). - **image** (string) - Optional - URL of the recipe's image. - **UserProfile** (string) - Required - URL pointing to the UserProfile associated with the recipe. ### Request Example ```json { "title": "Classic Chicken Stir Fry with Vegetables", "ingredients": ["chicken breast", "soy sauce", "garlic", "ginger", "bell peppers", "broccoli"], "instructions": "Complete updated instructions...", "cuisine": "Asian", "category": "Main Course", "image": "https://example.com/images/stir-fry-updated.jpg", "UserProfile": "http://localhost:8000/users/1/" } ``` ### Response #### Success Response (200 OK) - **message** (string) - Indicates the recipe was updated successfully. #### Response Example ```json { "message": "Recipe updated successfully." } ``` ``` -------------------------------- ### Update Recipe (Bash) Source: https://context7.com/prathmesh49/reciperadar/llms.txt Updates an existing recipe with new information. Supports partial updates using PATCH or full replacement using PUT. Requires the recipe ID in the URL path and the fields to update in the JSON body. ```bash # Update recipe title and instructions (PATCH) curl -X PATCH http://localhost:8000/recipes/1/ \ -H "Content-Type: application/json" \ -d '{ "title": "Classic Chicken Stir Fry with Vegetables", "instructions": "Updated instructions: 1. Slice chicken thinly..." }' ``` -------------------------------- ### Recipe Management API Source: https://github.com/prathmesh49/reciperadar/blob/main/README.md Endpoints for retrieving, creating, updating, and deleting recipes. ```APIDOC ## GET /api/recipes ### Description Retrieve all recipes. ### Method GET ### Endpoint /api/recipes ### Parameters #### Query Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **recipes** (array) - A list of recipe objects. #### Response Example ```json { "recipes": [ { "id": 101, "name": "Spaghetti Carbonara", "cuisine": "Italian", "prep_time_minutes": 15, "cook_time_minutes": 20 } ] } ``` ## POST /api/recipes ### Description Create a new recipe. ### Method POST ### Endpoint /api/recipes ### Parameters #### Request Body - **name** (string) - Required - The name of the recipe. - **description** (string) - Optional - A description of the recipe. - **ingredients** (array) - Required - A list of ingredients. - **instructions** (array) - Required - A list of cooking instructions. - **cuisine** (string) - Optional - The cuisine type of the recipe. - **prep_time_minutes** (integer) - Optional - Preparation time in minutes. - **cook_time_minutes** (integer) - Optional - Cooking time in minutes. ### Request Example ```json { "name": "Chicken Stir-fry", "description": "A quick and easy chicken stir-fry recipe.", "ingredients": ["chicken breast", "broccoli", "soy sauce", "ginger"], "instructions": ["Cut chicken", "Stir-fry vegetables", "Add sauce"], "cuisine": "Asian", "prep_time_minutes": 10, "cook_time_minutes": 15 } ``` ### Response #### Success Response (201) - **message** (string) - Confirmation message. - **recipe** (object) - The newly created recipe object. #### Response Example ```json { "message": "Recipe created successfully", "recipe": { "id": 102, "name": "Chicken Stir-fry", "cuisine": "Asian" } } ``` ## DELETE /api/recipes ### Description Delete a recipe. ### Method DELETE ### Endpoint /api/recipes ### Parameters #### Query Parameters - **recipe_id** (integer) - Required - The ID of the recipe to delete. ### Request Example ```json { "recipe_id": 101 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Recipe deleted successfully" } ``` ## PUT /api/recipes ### Description Update an existing recipe. ### Method PUT ### Endpoint /api/recipes ### Parameters #### Query Parameters - **recipe_id** (integer) - Required - The ID of the recipe to update. #### Request Body - **name** (string) - Optional - The new name of the recipe. - **description** (string) - Optional - The new description of the recipe. - **ingredients** (array) - Optional - The new list of ingredients. - **instructions** (array) - Optional - The new list of cooking instructions. - **cuisine** (string) - Optional - The new cuisine type. - **prep_time_minutes** (integer) - Optional - The new preparation time. - **cook_time_minutes** (integer) - Optional - The new cooking time. ### Request Example ```json { "recipe_id": 102, "description": "An updated quick and easy chicken stir-fry recipe." } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. - **recipe** (object) - The updated recipe object. #### Response Example ```json { "message": "Recipe updated successfully", "recipe": { "id": 102, "name": "Chicken Stir-fry", "description": "An updated quick and easy chicken stir-fry recipe.", "cuisine": "Asian" } } ``` ``` -------------------------------- ### Search Recipes Source: https://context7.com/prathmesh49/reciperadar/llms.txt Searches for recipes by title using a case-insensitive partial match. Returns all recipes whose titles contain the specified search term. ```APIDOC ## GET /recipe/search/ ### Description Searches recipes by title using a case-insensitive partial match query. Returns all recipes whose titles contain the search term. ### Method GET ### Endpoint `/recipe/search/` #### Query Parameters - **query** (string) - Required - The search term to match against recipe titles. ### Request Example ```bash curl -X GET "http://localhost:8000/recipe/search/?query=chicken" \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **url** (string) - The URL of the recipe. - **title** (string) - The title of the recipe. - **ingredients** (array of strings) - A list of ingredients for the recipe. - **instructions** (string) - Step-by-step instructions for preparing the recipe. - **cuisine** (string) - The cuisine type of the recipe. - **category** (string) - The category of the recipe. - **image** (string) - URL of the recipe's image. - **UserProfile** (string) - URL of the user who created the recipe. - **created_date** (string) - The date and time the recipe was created (ISO 8601 format). #### Response Example ```json [ { "url": "http://localhost:8000/recipes/1/", "title": "Classic Chicken Stir Fry", "ingredients": ["chicken breast", "soy sauce", "garlic", "ginger", "vegetables"], "instructions": "1. Slice chicken...", "cuisine": "Asian", "category": "Main Course", "image": "https://example.com/images/stir-fry.jpg", "UserProfile": "http://localhost:8000/users/1/", "created_date": "2024-01-15T10:30:00Z" } ] ``` #### Error Response (400 Bad Request) - **Message**: "Please provide a search query." #### Error Response (404 Not Found) - **Message**: "No recipes found." ``` -------------------------------- ### Update Recipe Source: https://context7.com/prathmesh49/reciperadar/llms.txt Updates an existing recipe's information. Supports partial updates using PATCH or full replacement using PUT. ```APIDOC ## PATCH /recipes/:recipe_id/ ### Description Updates specific fields of an existing recipe. ### Method PATCH ### Endpoint `/recipes/:recipe_id/` #### Path Parameters - **recipe_id** (integer) - Required - The ID of the recipe to update. #### Request Body - **title** (string) - Optional - The new title for the recipe. - **instructions** (string) - Optional - The updated instructions for the recipe. - Other recipe fields can also be updated. ### Request Example ```bash curl -X PATCH http://localhost:8000/recipes/1/ \ -H "Content-Type: application/json" \ -d '{ "title": "Classic Chicken Stir Fry with Vegetables", "instructions": "Updated instructions: 1. Slice chicken thinly..." }' ``` ## PUT /recipes/:recipe_id/ ### Description Replaces an existing recipe entirely with new information. ### Method PUT ### Endpoint `/recipes/:recipe_id/` #### Path Parameters - **recipe_id** (integer) - Required - The ID of the recipe to update. #### Request Body - Requires all fields for a complete recipe object to replace the existing one. ``` -------------------------------- ### Vue.js Router Configuration Source: https://context7.com/prathmesh49/reciperadar/llms.txt This JavaScript code configures the Vue Router for client-side navigation. It utilizes lazy loading for route components to enhance performance. The configuration includes routes for home, about, registration, login, and a general recipe view. ```javascript // frontend/src/router/index.js import { createRouter, createWebHistory } from 'vue-router' import HomeView from '../views/HomeView.vue' const routes = [ { path: '/', name: 'home', component: HomeView }, { path: '/about', name: 'about', component: () => import('../views/AboutView.vue') // Add Recipe page }, { path: '/register', name: 'register', component: () => import('../views/Reg.vue') }, { path: '/login', name: 'login', component: () => import('../views/Login.vue') }, { path: '/recipe', name: 'recipe', component: () => import('../components/HelloWorld.vue') } ] const router = createRouter({ history: createWebHistory(process.env.BASE_URL), routes }) export default router ``` -------------------------------- ### User Management API Source: https://github.com/prathmesh49/reciperadar/blob/main/README.md Endpoints for retrieving, creating, updating, and deleting user information. ```APIDOC ## GET /api/users ### Description Retrieve all users. ### Method GET ### Endpoint /api/users ### Parameters #### Query Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **users** (array) - A list of user objects. #### Response Example ```json { "users": [ { "id": 1, "username": "john_doe", "email": "john.doe@example.com" } ] } ``` ## POST /api/users ### Description Create a new user. ### Method POST ### Endpoint /api/users ### Parameters #### Request Body - **username** (string) - Required - The username for the new user. - **email** (string) - Required - The email address for the new user. - **password** (string) - Required - The password for the new user. ### Request Example ```json { "username": "jane_doe", "email": "jane.doe@example.com", "password": "securepassword123" } ``` ### Response #### Success Response (201) - **message** (string) - Confirmation message. - **user** (object) - The newly created user object. #### Response Example ```json { "message": "User created successfully", "user": { "id": 2, "username": "jane_doe", "email": "jane.doe@example.com" } } ``` ## DELETE /api/users ### Description Delete a user. ### Method DELETE ### Endpoint /api/users ### Parameters #### Query Parameters - **user_id** (integer) - Required - The ID of the user to delete. ### Request Example ```json { "user_id": 1 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "User deleted successfully" } ``` ## PUT /api/users ### Description Update an existing user. ### Method PUT ### Endpoint /api/users ### Parameters #### Query Parameters - **user_id** (integer) - Required - The ID of the user to update. #### Request Body - **email** (string) - Optional - The new email address for the user. - **password** (string) - Optional - The new password for the user. ### Request Example ```json { "user_id": 1, "email": "john.doe.updated@example.com" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. - **user** (object) - The updated user object. #### Response Example ```json { "message": "User updated successfully", "user": { "id": 1, "username": "john_doe", "email": "john.doe.updated@example.com" } } ``` ``` -------------------------------- ### Save Recipe to Collection Source: https://context7.com/prathmesh49/reciperadar/llms.txt Saves a recipe to a user's personal collection. This endpoint links a user profile with a recipe record, allowing users to bookmark recipes. ```APIDOC ## POST /savedrecipes/ ### Description Saves a recipe to a user's personal collection for easy access later. Links a user profile with a recipe record. ### Method POST ### Endpoint `/savedrecipes/` #### Request Body - **UserProfile** (string) - Required - The URL of the user's profile. - **Recipe** (string) - Required - The URL of the recipe to save. ### Request Example ```bash curl -X POST http://localhost:8000/savedrecipes/ \ -H "Content-Type: application/json" \ -d '{ "UserProfile": "http://localhost:8000/users/1/", "Recipe": "http://localhost:8000/recipes/2/" }' ``` ### Response #### Success Response (201 Created) - **url** (string) - The URL of the saved recipe entry. - **UserProfile** (string) - The URL of the user's profile. - **Recipe** (string) - The URL of the saved recipe. #### Response Example ```json { "url": "http://localhost:8000/savedrecipes/1/", "UserProfile": "http://localhost:8000/users/1/", "Recipe": "http://localhost:8000/recipes/2/" } ``` ## GET /savedrecipes/ ### Description Retrieves a list of all recipes saved by users. ### Method GET ### Endpoint `/savedrecipes/` ### Response #### Success Response (200) - Returns a list of saved recipe objects, each containing user and recipe URLs. ``` -------------------------------- ### Saved Recipes API Source: https://github.com/prathmesh49/reciperadar/blob/main/README.md Endpoints for retrieving, creating, updating, and deleting saved recipes. ```APIDOC ## GET /api/savedrecipes ### Description Retrieve all saved recipes. ### Method GET ### Endpoint /api/savedrecipes ### Parameters #### Query Parameters - **user_id** (integer) - Optional - Filter saved recipes by user ID. ### Request Example ```json { "user_id": 1 } ``` ### Response #### Success Response (200) - **saved_recipes** (array) - A list of saved recipe objects. #### Response Example ```json { "saved_recipes": [ { "id": 301, "user_id": 1, "recipe_id": 101 } ] } ``` ## POST /api/savedrecipes ### Description Save a recipe for a user. ### Method POST ### Endpoint /api/savedrecipes ### Parameters #### Request Body - **user_id** (integer) - Required - The ID of the user. - **recipe_id** (integer) - Required - The ID of the recipe to save. ### Request Example ```json { "user_id": 1, "recipe_id": 102 } ``` ### Response #### Success Response (201) - **message** (string) - Confirmation message. - **saved_recipe** (object) - The newly saved recipe object. #### Response Example ```json { "message": "Recipe saved successfully", "saved_recipe": { "id": 302, "user_id": 1, "recipe_id": 102 } } ``` ## DELETE /api/savedrecipes ### Description Remove a saved recipe for a user. ### Method DELETE ### Endpoint /api/savedrecipes ### Parameters #### Query Parameters - **saved_recipe_id** (integer) - Required - The ID of the saved recipe entry to delete. ### Request Example ```json { "saved_recipe_id": 301 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Saved recipe removed successfully" } ``` ## PUT /api/savedrecipes ### Description Update a saved recipe entry (e.g., add notes, though this is a placeholder as typical PUT operations for saved items are less common than POST/DELETE). ### Method PUT ### Endpoint /api/savedrecipes ### Parameters #### Query Parameters - **saved_recipe_id** (integer) - Required - The ID of the saved recipe entry to update. #### Request Body - **notes** (string) - Optional - User-added notes for the saved recipe. ### Request Example ```json { "saved_recipe_id": 302, "notes": "Make sure to use fresh basil." } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. - **saved_recipe** (object) - The updated saved recipe object. #### Response Example ```json { "message": "Saved recipe updated successfully", "saved_recipe": { "id": 302, "user_id": 1, "recipe_id": 102, "notes": "Make sure to use fresh basil." } } ``` ```