Тёмный

MERN Starter Tutorial for Beginners 

Raddy
Подписаться 34 тыс.
Просмотров 11 тыс.
50% 1

Опубликовано:

 

25 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 76   
@RaddyDev
@RaddyDev Год назад
I hope that you enjoy the tutorial. I might make a shorter version without the images. *** Update: I forgot to check if the data was created successfully on the server. The book data could be null, so I'll add a simple if statement to check for this. I'll add it to the Github repo.
@rizwanmohammad1624
@rizwanmohammad1624 Год назад
Please make a small cart functionality for this project. It will be very helpful. Mini book selling application. Thank you so much for the amazing videos❤😊
@elmokhtar8576
@elmokhtar8576 Год назад
This is my first video discovering the MERN stack, till now 30 minutes of watching and so far everything is clear. Thank you so much Raddy
@RaddyDev
@RaddyDev Год назад
The thumbnail bit can be confusing, but I hope that you make it work. This is why I made a new video, without it 😀
@inspirationalquotes5840
@inspirationalquotes5840 2 месяца назад
Thank you Raddy
@govindr3004
@govindr3004 7 месяцев назад
I just completed the recipe blog project.. I enjoyed... But i wanted learn the process in developing a whole project... I never expected ill get that here in this channel, your are so greatful❤.. I'm going to start this but small doubt.. should i know react before this?
@RaddyDev
@RaddyDev 7 месяцев назад
This should help you get started with React. Don't need to know it, just get started and learn as you go
@eloytekila
@eloytekila 10 месяцев назад
Very good tutorial man, I had finished now and I need to say that I had learn a lot, Tks for the video
@SoftwareScience
@SoftwareScience 10 месяцев назад
Thanks so much. The best mern crud tutorial! You might show us how to add authentication to this?
@williamyanney6071
@williamyanney6071 5 месяцев назад
Thanks for the Tutorial, u made me understanding on MERN Stack good. Hope to find more great content..Bro.
@blue_berry_pie64
@blue_berry_pie64 Год назад
Thank you for your full tutorial to build book app! I am happy to learn!
@vividmilan9175
@vividmilan9175 10 месяцев назад
This is a great tutorial man, Plz don't stop making Tutorials 💯♥
@RaddyDev
@RaddyDev 9 месяцев назад
Thank you! I am hoping to make a lot more this year 🙂
@abd9641
@abd9641 Год назад
Thank you so much my first mern app😊
@RaddyDev
@RaddyDev Год назад
My pleasure 😊
@mehrdad1068
@mehrdad1068 Год назад
Thank you for sharing this awesome tutorial 💛💚
@mehrdad1068
@mehrdad1068 9 месяцев назад
Thank you for this awesome tutorial🙏
@RaddyDev
@RaddyDev 9 месяцев назад
My pleasure 😊
@mehrdad1068
@mehrdad1068 9 месяцев назад
@@RaddyDev 🌺🌺
@anasyoussef2022
@anasyoussef2022 Год назад
Thank you brother ❤
@cshark1990
@cshark1990 Год назад
Love the video man. Thanks so much for posting (Net Ninja brought me here). One question, I'm only getting 3 books to display. I have all the books in Mongodb, all images, and everything looks good. Am I missing something?
@cshark1990
@cshark1990 Год назад
import {useState, useEffect } from 'react' import { Link } from 'react-router-dom' function Book() { const baseURL = 'localhost:8000/api/books'; const [data, setData] = useState([]); useEffect(() => { const fetchData = async () => { try { const response = await fetch(baseURL) if(!response.ok) { throw new Error('Failed to fetch Data') } const jsonData = await response.json() setData(jsonData) } catch (error) { console.log(error) } } fetchData() }, []) return ( Book Page Fetch Example {data.map((item) => ( {item.title} ))} ) } export default Book
@RaddyDev
@RaddyDev Год назад
Glad that you like it! 🐱‍👤🔥 NetNinja What you can do is to console log your Book data object in Nodejs. The one where you query the Books in the GET route: const data = await Book.find(filter); console.log(data); Do that and see if you get all the data in the console. If you do then start debugging in React. You can do the same thing there, and double check your loop {data.map((item) => ( {item.title} ))}
@cshark1990
@cshark1990 Год назад
Hey, thanks so much for the reply. As soon as you said 'Check Node', I released I had Book.find({).limt(3). Problem solved. Thanks a again and love your content @@RaddyDev
@MsAlokranjan
@MsAlokranjan Год назад
awesome. Sir 👌
@MightyKingKala
@MightyKingKala Год назад
Thank you brother
@blurrywaters
@blurrywaters 10 месяцев назад
finally finished my project, having trouble deploying on vercel tho, the backend/server deployed fine but the client side is giving me errors
@RaddyDev
@RaddyDev 10 месяцев назад
Have a look at the server logs when you deploy and that will tell you what the problem is. Hopefully it will be something small
@blurrywaters
@blurrywaters 10 месяцев назад
@@RaddyDev yes the error logs when I try to deploy are "npm run build" exited with 1, Ive tried googling this issue but so far no luck. Still searching to see what i can do.
@blurrywaters
@blurrywaters 9 месяцев назад
@@RaddyDev So I checked the error logs when deploying my front end and it said, Could not resolve "./components/Header.jsx" from "src/App.jsx". Ive checked locally in my header component and i see no issue there or the app.jsx Ive tried stack overflow but no one seems to understand my issue either.
@adenugbamicheal2140
@adenugbamicheal2140 Год назад
What do i do if am to deploy for production?
@RaddyDev
@RaddyDev Год назад
Video coming out today :)
@andraspoljak
@andraspoljak Год назад
Hello. Great tutorial. However there is a problem I could not solve. It throws server error if I am not attaching an image with adding a new book! It works with image, but not without one. What could cause that and where to look?
@RaddyDev
@RaddyDev Год назад
It could be the POST a book route. You could add a default thumbnail or an empty one: Add Default thumbnail const: const defaultThumbnailPath = "path/to/default_thumbnail.jpg"; and then for the thumbnail you could check if the file is empty and add the default one (or empty): `thumbnail: req.file ? req.file.filename : defaultThumbnailPath,` New book code would look like this: const newBook = new Book({ title: req.body.title, slug: req.body.slug, stars: req.body.stars, description: req.body.description, category: req.body.category, thumbnail: req.file ? req.file.filename : defaultThumbnailPath, });
@patrap4625
@patrap4625 Год назад
Hi Raddy,I have a question. How come I can’t use your dummy JSON data. I copied it in my mongodb but when I fetch the api. The only response on localhost is [ ] empty array.Thanks for the tutorial.
@RaddyDev
@RaddyDev Год назад
Two things to check. Did you invoke the fetch data function? And if you console.log(jsonData), after you do await response.json() do you get the data in the console?
@HasbiRadifanL
@HasbiRadifanL Месяц назад
sorry sir I can't use the following code so it's not sideways the column is down, the col-1, col-2 functions don't work Back To Books 1 2
@RaddyDev
@RaddyDev Месяц назад
Some of this doesn't match the code on the video. FaAngleDoubleLeft I don't have. Did you import that icon? The bookDetails class should be bookdetails. If you remove the icon and change the class name it should start working
@MCAAARULMishra
@MCAAARULMishra Год назад
Hi raddy, I wasnt able to find the Books as collection my DataBase even after I added /Books in env file as well as imported Books.js model
@RaddyDev
@RaddyDev Год назад
I'll be happy to take a look if you don't mind uploading your code on GitHub. As long as you connect to the database successfully, you have the model exported and then imported into the main file, it should work
@manuelgoncalves4026
@manuelgoncalves4026 Год назад
Hey. What's the extension to use the emoji icons???
@RaddyDev
@RaddyDev Год назад
It's the standard Emoji keyboard from Windows. Mac also has it: For Mac keyboards: Use CTRL + CMD + Space Windows + ; (semi-colon) or Windows + . (period) It works when you type somewhere
@smeetcoder9021
@smeetcoder9021 Год назад
I am setting error when submit the data and its giving 500 server error and loging Data failed to add I have checked all endpoints its working fine in Thunderclient but not in Client
@RaddyDev
@RaddyDev Год назад
That's a strange one... Have you got your project uploaded on GitHub? I'll be happy to have a look
@animentalproducts5228
@animentalproducts5228 Год назад
There is an issue when editing a book's category, as the updated category does not seem to appear in bulleted form.
@RaddyDev
@RaddyDev Год назад
Interesting, I need to check it out. Have you got a public Github repo with the project?
@chaitanyakarthikbasva
@chaitanyakarthikbasva Год назад
hello @RaddyDev, I am stuck in small issue, in the client part, after Fetching the data when I try to console.log it, first it prints me an empty array and after some moments it is fetching me the data, due to this , I cannot even render my data content to the boooks, please help me with it!!
@RaddyDev
@RaddyDev Год назад
I would have to look at your code. Do you get any other errors?
@chaitanyakarthikbasva
@chaitanyakarthikbasva Год назад
@@RaddyDev after careful scrutiny, I found that it is because of the asynchronous nature of the fetch that we are using in here, since the fetch is asyncronous,by the time our flow reaches the printing part, the fetch function has'nt fetched the data, after some time when the fetch function is done with the fetching we are getting the array as the output, we could mitigate this issue by using some conditionals to it,Thanks
@enikoszebenyi3750
@enikoszebenyi3750 Год назад
@user-fl1km1jq1d Hello!I have the same issue. Could you share your solution with us?(the conditionals part).Thank you
@RaddyDev
@RaddyDev Год назад
@@enikoszebenyi3750 Hello, I don't know if they will reply so I will try to help 🙂 Reading back at the original comment, the Async function is most likely working correctly. The problem could be that they are trying to console log the data before it has been fetched. After setting the data setData(jsonData); you can do a check like this: if (jsonData.length > 0) { console.log(jsonData); } Do you ever get the data back from the server? Have you tested the API endpoint in the browser or thunder client? I would be interested to know what is causing the problem
@chaitanyakarthikbasva
@chaitanyakarthikbasva Год назад
@@RaddyDev You are wrong raddy! I do reply😂😂
@blurrywaters
@blurrywaters 11 месяцев назад
my json data shows as a huge paragraph on the browser instead of json format, is it fine to leave it this way?
@RaddyDev
@RaddyDev 11 месяцев назад
Yeah that's absolutely fine. Your browser probably doesn't have a JSON Formatter that's all. You can install them as a browser extension. On chrome there is one literally called "JSON Formatter".
@blurrywaters
@blurrywaters 11 месяцев назад
@@RaddyDev thank you! Ill try this out
@blurrywaters
@blurrywaters 11 месяцев назад
it worked, appreciate that again.
@blurrywaters
@blurrywaters 10 месяцев назад
@@RaddyDev hey i keep receiving a 404 not found error for my delete button, idk why i made sure the http URL is correct.
@blurrywaters
@blurrywaters 11 месяцев назад
my app.post route for api/books keeps giving me an error on thundercloud, I made sure the route in the server is correct.
@blurrywaters
@blurrywaters 11 месяцев назад
nevermind i fixed it, i had to type node index.js again in the terminal again for the server
@blurrywaters
@blurrywaters 11 месяцев назад
Hey, back again. for some reason I keep receiving an error in thundercloud when i try testing my app.post route i made in the server.
@blurrywaters
@blurrywaters 11 месяцев назад
man idk what it is, i did the same thing as last time and it worked this time. typed node index.js again and the route worked lol
@jumbo999614
@jumbo999614 Год назад
Any tutorial for uploading to the server so everyone in the world can see you website? I've learned some MERN tutorial before but I still don't understand how my MERN work on the server. I followed the tutorial about hosting the website without knowing anything about it. I use Netlify for my website and Heroku for storing backend which use MongoDB. It worked for a few months then Heroku stopped its free hosting. So now my website is not functioning. One way I can think of now is to use DDNS like noip but I have to use my own PC as server and have to leave it on 24hr.
@RaddyDev
@RaddyDev Год назад
I'll create a follow-up video soon. We can use Render to build two projects: a Web Service (Server - Node.js) and a Static Site (Client - React). Publish them on GitHub and connect the Static Site to the React repo and the Web Service to the Node.js repo. Render handles the build process, so you don't have to do much. The only thing that we'll need to configure is the URL's since I hardcoded them. Normally you would add them in a .env file to make it easy to update. I will cover all that
@MCAAARULMishra
@MCAAARULMishra Год назад
@@RaddyDev when can we expect the follow-up video?
@RaddyDev
@RaddyDev Год назад
@@MCAAARULMishra just finished recording it. It should be done by Monday
@bilal5488
@bilal5488 Год назад
am begginer in mern recently see your blog project playlist on net ninja then comes the already subscribe or also click the bell and hope to clone this and waiting for many your thankew❤
@RaddyDev
@RaddyDev Год назад
I appreciate you being here!
@bilal5488
@bilal5488 Год назад
@@RaddyDev 😌yeah just want content from you full support from my side😂😂
@bilal5488
@bilal5488 Год назад
please also create on project with JWT auth and cookieparser mern project please
@RaddyDev
@RaddyDev Год назад
I am defiantly looking into doing stuff like that. I appreciate the suggestion
@bilal5488
@bilal5488 Год назад
@@RaddyDev thankew waiting for that❤️
@CristianoRonaldo-vv6sv
@CristianoRonaldo-vv6sv Год назад
22:00
@mehrdad1068
@mehrdad1068 3 месяца назад
❤🎉
Далее