Add ingredients and generate a dish based on those ingredients. You can also take away ingredients and a new dish will be generated based off of the updated set of ingredients.
![image](https://private-user-images.githubusercontent.com/42917263/328067201-a2ae5ca9-d49b-4623-b56e-7ebe0b7d8974.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNTU3MjYsIm5iZiI6MTcxOTE1NTQyNiwicGF0aCI6Ii80MjkxNzI2My8zMjgwNjcyMDEtYTJhZTVjYTktZDQ5Yi00NjIzLWI1NmUtN2ViZTBiN2Q4OTc0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIzVDE1MTAyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY1NjNjNjhjYTY4NTA4MmQxMDg0ZmYwYTc2NWM5OGU5ODQ3MTVmYTY2Y2Q1NWViOWJkNTFjN2EzMjM2YWE0MzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.SbqBreH0jkzAiSyviKC3-WaRrRxnpANC-92Zu8m8RBI)
Set OPENAI_API_KEY
env var to be your openai api key
The backend server takes a request of a list of ingredients and a new ingredient and it returns a generated dish.
- There is an gaurdrails step that checks if the new input ingredient is a valid ingredient. It does this via an openai call
- If the new ingredient is a valid ingredient, then it will return a dish description and title
- In instances where there is no new ingredient, which happens in cases where generations are triggered by deleting an ingredient, pass in ingredient as '[NONE]'
To run the backend server:
cd server
nodemon server
To start the front-end cd into client
directory and run npm start
.
Add ingredients using the add ingredient form. This should trigger a new generation. Subtract ingredients by pressing the subtract button on the ingredient. This should also subtract a new generation.
If you delete all your ingredients, the dish returns to it's empty state.