Let me know if you end up building this and send me your creations! Especially if you add more stuff to it, like recipe details, ingredient list, meal preparation instructions or something similar.
@basiccoder2166
2 жыл бұрын
Amazing video learnt alot i used axios instead of fetch.
@AleksPopovic
2 жыл бұрын
@@basiccoder2166 Thanks a lot friend and welcome to the channel!
@raghavgupta6446
3 жыл бұрын
teaching by building this is what I like to see keep up the good work :)
@AleksPopovic
3 жыл бұрын
Thank you and welcome to the channel!
@milos-makes-maps
3 жыл бұрын
Straightforward presentation and useful content once again. I like that you zoom in your code, which makes it easier to follow you.
@AleksPopovic
3 жыл бұрын
Thank you!
@Yackkimani
3 жыл бұрын
Can I say “I love you “ lol this is the best explanation
@AleksPopovic
3 жыл бұрын
Thank you Jackie, I'm really glad you liked it! Welcome to the channel!
@charlesmagno28
Жыл бұрын
lets say i dont use api for the food, is it better to hardcode the ingredients or use database like firebase? i cant find any api for filipino foods website. pla advise thanks
@AleksPopovic
Жыл бұрын
If this is for your personal use I would say do whatever is easier for you. If you plan on having other users I would go with a database, which could make the project way more complex, depending on what you are building.
@SaniPatel-o7z
Жыл бұрын
Cannot read properties of undefined (reading 'calories') I'm Getting this error!'
@AleksPopovic
Жыл бұрын
If you console.log the mealData object at the top of MealList.js you should see an error message on why you aren't getting any data. For me it says the daily limit for the free API version has been reached, so you are probably having the same issue. If you are using my API key from the video, please make your own and then you won't have other people spending your daily limit. If you did make your own API key then you reached the daily limit on your own and will unfortunately need to wait for it to reset the next day. You can track your daily limit at spoonacular.com/food-api/console .
@kiyanalavi7725
10 ай бұрын
Hi Aleks Did you use free plan?
@AleksPopovic
10 ай бұрын
Hello Kiyan and welcome to the channel! Yes, I used the free plan.
@abrarkanekar142
3 жыл бұрын
which code editor did u used?
@AleksPopovic
3 жыл бұрын
I use VS Code for all of my projects.
@Javedboqo1
3 жыл бұрын
How to generate meal for some specific date on Spoonacular? I can't find any related endpoint for that in docs
@AleksPopovic
3 жыл бұрын
Hello Javed and welcome to the channel! I think there isn't an inbuilt functionality for that, but you can still make it work. You could use the same meal planner API endpoint I used in the video and you would set timeFrame to "week" instead of "day". This will generate a 7-day meal plan which you would then need to manually assign to different dates in your app, starting from today, or from a selected date in a calendar picker, or something similar. That's actually a really cool idea for extending this app. Hope that helps!
@Javedboqo1
3 жыл бұрын
Thanks @Aleks Popovic for replying back.. I tried to generate weekly plan and i get success response but when i try to get that previously generated weekly plan then i get nothing in response...Please find below links and i will be highly appreciate if you can find an issue (if any) in my request api.spoonacular.com/mealplanner/generate?apiKey=MYAPI_KEY&timeFrame=week&targetCalories=2000&username=***&hash=***&diet=vegetarian { "week": { "monday": { "meals": [ { "id": 677058, "imageType": "jpg", "title": "Savory Pesto Quinoa Breakfast Bowls", "readyInMinutes": 10, "servings": 2, "sourceUrl": "www.simplyquinoa.com/savory-pesto-quinoa-breakfast-bowls/" }, { "id": 256993, "imageType": "jpg", "title": "Eggs Baked in Yogurt with Spinach, Tomatoes & Watercress", "readyInMinutes": 30, "servings": 4, "sourceUrl": "www.sippitysup.com/recipe/eggs-baked-in-yogurt-with-spinach-tomatoes-watercress/" }, { "id": 62436, "imageType": "jpg", "title": "Lemon Curd-Topped Cheesecake", "readyInMinutes": 305, "servings": 5, "sourceUrl": "www.Kraftrecipes.com/recipes/lemon-curd-topped-cheesecake-109217.aspx" } ], "nutrients": { "calories": 1999.92, "protein": 64.65, "fat": 141.66, "carbohydrates": 127.54 } }, ...... But when i tried to get above weekly plan data using below API then got nothing api.spoonacular.com/mealplanner/username/week/2021-05-24?hash=***&apiKey=MYAP_KEY Response: { "days": [] }
@AleksPopovic
3 жыл бұрын
@@Javedboqo1 I think there is a step missing there. You first need to generate a plan, then you add it to the user, and then you can get user's meal plans. Check out the "Add to Meal Plan" section in the docs, I think it should solve your problem. It looks like you can't generate a meal plan for a user directly, so the user and hash that you are passing into the generate meal plan endpoint in your first call don't do anything. I hope this helps!
@Javedboqo1
3 жыл бұрын
@@AleksPopovic Thanks yeah i follow it and it worked for me
@AleksPopovic
3 жыл бұрын
@@Javedboqo1 That's awesome! I'm glad I was able to help you out!
@eduardorosado3674
2 жыл бұрын
Would be interested to know how to add a favorite button to those cards and have them appear on another page
@AleksPopovic
2 жыл бұрын
Hi Eduardo and welcome to the channel! You would need to have some state that handles that. You would have a list of favourite items which would update when you click a button on a card.
@eduardorosado3674
2 жыл бұрын
@@AleksPopovic thank u and thank u for ur tutorials. So would I place a onClick for that favorite button? And a function to handle that onClick ? Sorry still trying to wrap my head around it all. I'm fairly new to react
@AleksPopovic
2 жыл бұрын
@@eduardorosado3674 No problem at all! Yes, you would do exactly that. An on click event which calls a function that adds that card into the list and save the list in state. On your other page you would just call that same list and display all cards from it.
@eduardorosado3674
2 жыл бұрын
@@AleksPopovic this is harder than I thought 😅
@AleksPopovic
2 жыл бұрын
@@eduardorosado3674 You know what they say - no pain, no gain. :) If you are having troubles setting it up you can take a look at my tutorial for a Task Management Productivity app which has a similar use case. You click on a button to add a new task card to a list which is stored in state (and also in browser's internal memory) and when you restart the page we pull that list from the browser's memory and use it to render all task cards. It's very similar to what you are trying to accomplish. It is a bit more complicated, but it will give you an idea about what needs to be done. Here is the link to that video: kzitem.info/news/bejne/o5p5qaR3gnWJiZg
@jeepneygang
3 жыл бұрын
I want to use .ajax({}) while making my API key in a separate js
@aj-boatchannel7997
Жыл бұрын
awesome video @AleksPopovic can i use typescript for this app?
@AleksPopovic
Жыл бұрын
Thanks AJ, and welcome to the channel! For sure, switching to Typescript after you're done shouldn't be a big issue.
@bankolemichael6244
2 жыл бұрын
Good evening, thanks for the tutorials, it really helped, I generate my api key last week, I was doing some editing on my css file afer some while it came up with status error 402, which means I have to pay to continue to use it
@AleksPopovic
2 жыл бұрын
Hello Michael, welcome to the channel! I'm glad my tutorials helped you. :) As for the error 402, the Spoonacular API has a daily quota that is free. If you go over it you are done for the day, but it resets the next day. They have a point system that you can check in your dashboard to make sure your daily calls don't go over the limit. When I was building this I accidentally made a component which continuosly refreshed itself and ate all of my daily API limit, so that's definitely something you need to look out for. :)
@bankolemichael6244
2 жыл бұрын
@@AleksPopovic ohhh, thanks very much, I was trying to use react-bootstrap instead of plain css, so anytime I make changes, I check visit the Web page or check Google console for corrections
@sabybaouni727
3 жыл бұрын
Thank u so.much 💓
@AleksPopovic
3 жыл бұрын
You are welcome! Glad you liked it!
@mobhamjee786
2 жыл бұрын
Can I use this for a diet app in android studio
@AleksPopovic
2 жыл бұрын
Hello Mohammad! You would need to switch to React Native which should be fairly similar, but the API should work pretty much in the same way.
@mobhamjee786
2 жыл бұрын
@@AleksPopovic and would it also work with Java Android studio
@AleksPopovic
2 жыл бұрын
@@mobhamjee786 Yeah, check out this link on how to set up React Native with Android Studio: reactnative.dev/docs/environment-setup
@mobhamjee786
2 жыл бұрын
@@AleksPopovic will I first need to install react Native on my desktop
@AleksPopovic
2 жыл бұрын
@@mobhamjee786 It would be preferable to first install Android Studio and then follow the instructions from the link I posted earlier.
Пікірлер: 47