Welcome to the Recipe Integration project using uAgents! This project leverages Fetch.ai's uAgents to provide detailed information about recipes, including nutrition, ingredients, instructions, and cost breakdown. The frontend is a React application that interacts with the uAgents backend to display this information to users.
- Nutrition Information: Get detailed nutritional content of any recipe.
- Ingredients List: View a comprehensive list of ingredients required for the recipe.
- Cooking Instructions: Access step-by-step instructions to prepare the dish.
- Cost Breakdown: Understand the cost associated with each ingredient and the total recipe.
-
Clone the repository:
git clone https://github.com/abhifetch/your-repo-name.git cd your-repo-name
-
Set up a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Run the uAgents backend:
cd backend/agents python nutritions.py # similarly run agents on different terminals
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start the React app:
npm start
-
Ensure the uAgents backend is running:
python main.py
-
Ensure the React frontend is running:
npm start
-
Access the application: Open your browser and navigate to
http://localhost:3000
.
The uAgents handle specific types of requests related to recipes. Here are the main agents and their functionalities:
- Nutrition Agent: Handles requests for nutritional information.
- Ingredients Agent: Handles requests for ingredients.
- Instructions Agent: Handles requests for cooking instructions.
- Cost Agent: Handles requests for cost breakdown.
-
Nutrition Information:
GET /api/nutrition/<recipe_name>
Response example:
{ "calories": "200 kcal", "protein": "10 g", "fat": "5 g" }
-
Ingredients:
GET /api/ingredients/<recipe_name>
Response example:
{ "ingredient1": "200 g", "ingredient2": "100 ml" }
-
Instructions:
GET /api/instructions/<recipe_name>
Response example:
[ "Step 1: Preheat the oven.", "Step 2: Mix ingredients." ]
-
Cost Breakdown:
GET /api/cost/<recipe_name>
Response example:
{ "ingredient1": "$2.00", "ingredient2": "$1.50", "totalCost": "$3.50", "totalCostPerServing": "$1.75" }
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start the React app:
npm start
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.