This is a React-based application that allows users to input ingredients and receive a full recipe generated by an AI model. The app leverages the getRecipeFromMistral function to fetch recipes and displays them dynamically.
- Input ingredients via a simple form
- View the list of added ingredients
- Generate a recipe based on the selected ingredients
- Display recipe formatted in Markdown using the
ClaudeRecipecomponent
- Main: Manages state and interactions for ingredient input and recipe generation
- IngredientsList: Displays all added ingredients and allows the user to request a recipe
- ClaudeRecipe: Renders the AI-generated recipe
- getRecipeFromMistral: Async function to fetch a recipe from an AI source (e.g., Mistral model)
src/
├── components/
│ ├── IngredientsList.jsx
│ └── ClaudeRecipe.jsx
├── ai.js
└── Main.jsx
- Node.js (v16+ recommended)
- npm or yarn
- Clone the repository:
git clone https://github.com/your-username/ai-recipe-generator.git
cd ai-recipe-generator- Install dependencies:
npm install
# or
yarn install- Start the development server:
npm run dev
# or
yarn devThe app will be available at http://localhost:3000.
The getRecipeFromMistral function should be implemented in ai.js. It takes an array of ingredients and returns a Markdown-formatted recipe. Example:
export async function getRecipeFromMistral(ingredients) {
// Call to your AI backend here
return "# Sample Recipe\n\nIngredients:\n- " + ingredients.join("\n- ") + "\n\nInstructions:\n1. Mix ingredients.\n2. Cook well.\n";
}Contributions are welcome! Feel free to submit issues or pull requests.