MERN Starter Tutorial for Beginners

  Рет қаралды 9,834

Raddy

Raddy

Күн бұрын

Learn the MERN stack by creating a simple CRUD book application. I will cover NodeJs, MongoDB (Mongoose), Express and React.
☕ BuyMeACoffee: www.buymeacoffee.com/RaddyThe...
Download Files:
github.com/RaddyTheBrand/30.M...
Discounts:
⚡ Hostinger: www.hostg.xyz/aff_c?offer_id=...
⚡ Elementor: be.elementor.com/visit/?bta=2...
Recording Equipment:
◾ Microphone: amzn.to/3uX0yvP
◾ Shotgun Mic: amzn.to/3aRsSJb
◾ Camera: amzn.to/3IMumkx
◾ Lens: amzn.to/3ARxvh8
◾ Lighting: amzn.to/3PBetj2
Computer Gear:
◾ Keyboard: amzn.to/3RCXRcC
◾ Headphones: amzn.to/3aIvskX
◾ Mouse: amzn.to/3VfVuxO
Connect with me:
◾ Website: www.raddy.dev
◾ Newsletter: www.raddy.co.uk/newsletter
Chapters:
◾ 0:00 Introduction:
◾ 0:35 Server
◾ 9:39 Database Setup
◾ 22:34 Dymmy Data
◾ 23:19 Get Books Route
◾ 25:16 Client
◾ 38:49 Books + Filters
◾ 59:39 Single Book
◾ 1:12:59 Add Book
◾ 1:42:45 Update Book
◾ 1:56:50 Delete Book
#nodejs #react #mernstack

Пікірлер: 74
@RaddyDev
@RaddyDev 11 ай бұрын
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 10 ай бұрын
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 10 ай бұрын
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 10 ай бұрын
The thumbnail bit can be confusing, but I hope that you make it work. This is why I made a new video, without it 😀
@blue_berry_pie64
@blue_berry_pie64 11 ай бұрын
Thank you for your full tutorial to build book app! I am happy to learn!
@mehrdad1068
@mehrdad1068 8 ай бұрын
Thank you for sharing this awesome tutorial 💛💚
@eloytekila
@eloytekila 5 ай бұрын
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 5 ай бұрын
Thanks so much. The best mern crud tutorial! You might show us how to add authentication to this?
@anasyoussef2022
@anasyoussef2022 11 ай бұрын
Thank you brother ❤
@williamyanney6071
@williamyanney6071 24 күн бұрын
Thanks for the Tutorial, u made me understanding on MERN Stack good. Hope to find more great content..Bro.
@abd9641
@abd9641 8 ай бұрын
Thank you so much my first mern app😊
@RaddyDev
@RaddyDev 8 ай бұрын
My pleasure 😊
@mehrdad1068
@mehrdad1068 4 ай бұрын
Thank you for this awesome tutorial🙏
@RaddyDev
@RaddyDev 4 ай бұрын
My pleasure 😊
@mehrdad1068
@mehrdad1068 4 ай бұрын
@@RaddyDev 🌺🌺
@vividmilan9175
@vividmilan9175 5 ай бұрын
This is a great tutorial man, Plz don't stop making Tutorials 💯♥
@RaddyDev
@RaddyDev 5 ай бұрын
Thank you! I am hoping to make a lot more this year 🙂
@MsAlokranjan
@MsAlokranjan 11 ай бұрын
awesome. Sir 👌
@MightyKingKala
@MightyKingKala 11 ай бұрын
Thank you brother
@govindr3004
@govindr3004 3 ай бұрын
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 2 ай бұрын
This should help you get started with React. Don't need to know it, just get started and learn as you go
@patrap4625
@patrap4625 11 ай бұрын
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 11 ай бұрын
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?
@MCAAARULMishra
@MCAAARULMishra 11 ай бұрын
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 11 ай бұрын
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
@cshark1990
@cshark1990 8 ай бұрын
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 8 ай бұрын
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 8 ай бұрын
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 8 ай бұрын
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
@andraspoljak
@andraspoljak 10 ай бұрын
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 10 ай бұрын
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, });
@adenugbamicheal2140
@adenugbamicheal2140 11 ай бұрын
What do i do if am to deploy for production?
@RaddyDev
@RaddyDev 10 ай бұрын
Video coming out today :)
@manuelgoncalves4026
@manuelgoncalves4026 9 ай бұрын
Hey. What's the extension to use the emoji icons???
@RaddyDev
@RaddyDev 9 ай бұрын
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
@nitish394
@nitish394 9 ай бұрын
@RaddyDev, Sir in backened server my api link showing empty array, why?
@RaddyDev
@RaddyDev 9 ай бұрын
Double check the collection name. Could be something silly like a typo
@viewsbyblur
@viewsbyblur 5 ай бұрын
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 5 ай бұрын
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
@viewsbyblur
@viewsbyblur 5 ай бұрын
@@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.
@viewsbyblur
@viewsbyblur 5 ай бұрын
@@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.
@animentalproducts5228
@animentalproducts5228 10 ай бұрын
There is an issue when editing a book's category, as the updated category does not seem to appear in bulleted form.
@RaddyDev
@RaddyDev 10 ай бұрын
Interesting, I need to check it out. Have you got a public Github repo with the project?
@bilal5488
@bilal5488 10 ай бұрын
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 10 ай бұрын
I appreciate you being here!
@bilal5488
@bilal5488 10 ай бұрын
@@RaddyDev 😌yeah just want content from you full support from my side😂😂
@viewsbyblur
@viewsbyblur 7 ай бұрын
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 7 ай бұрын
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".
@viewsbyblur
@viewsbyblur 7 ай бұрын
@@RaddyDev thank you! Ill try this out
@viewsbyblur
@viewsbyblur 7 ай бұрын
it worked, appreciate that again.
@viewsbyblur
@viewsbyblur 6 ай бұрын
@@RaddyDev hey i keep receiving a 404 not found error for my delete button, idk why i made sure the http URL is correct.
@jumbo999614
@jumbo999614 11 ай бұрын
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 11 ай бұрын
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 11 ай бұрын
@@RaddyDev when can we expect the follow-up video?
@RaddyDev
@RaddyDev 11 ай бұрын
@@MCAAARULMishra just finished recording it. It should be done by Monday
@smeetcoder9021
@smeetcoder9021 9 ай бұрын
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 9 ай бұрын
That's a strange one... Have you got your project uploaded on GitHub? I'll be happy to have a look
@user-fl1km1jq1d
@user-fl1km1jq1d 8 ай бұрын
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 8 ай бұрын
I would have to look at your code. Do you get any other errors?
@user-fl1km1jq1d
@user-fl1km1jq1d 8 ай бұрын
@@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 7 ай бұрын
@user-fl1km1jq1d Hello!I have the same issue. Could you share your solution with us?(the conditionals part).Thank you
@RaddyDev
@RaddyDev 7 ай бұрын
@@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
@user-fl1km1jq1d
@user-fl1km1jq1d 7 ай бұрын
@@RaddyDev You are wrong raddy! I do reply😂😂
@CristianoRonaldo-vv6sv
@CristianoRonaldo-vv6sv 9 ай бұрын
22:00
@bilal5488
@bilal5488 10 ай бұрын
please also create on project with JWT auth and cookieparser mern project please
@RaddyDev
@RaddyDev 10 ай бұрын
I am defiantly looking into doing stuff like that. I appreciate the suggestion
@bilal5488
@bilal5488 10 ай бұрын
@@RaddyDev thankew waiting for that❤️
@viewsbyblur
@viewsbyblur 6 ай бұрын
my app.post route for api/books keeps giving me an error on thundercloud, I made sure the route in the server is correct.
@viewsbyblur
@viewsbyblur 6 ай бұрын
nevermind i fixed it, i had to type node index.js again in the terminal again for the server
@viewsbyblur
@viewsbyblur 6 ай бұрын
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.
@viewsbyblur
@viewsbyblur 6 ай бұрын
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
Learn Docker in 1 Hour | Full Docker Course for Beginners
1:27:53
JavaScript Mastery
Рет қаралды 270 М.
ONE MORE SUBSCRIBER FOR 6 MILLION!
00:38
Horror Skunx
Рет қаралды 15 МЛН
Fastest way to become a Web Developer in 2024
9:47
Sahil & Sarra
Рет қаралды 505 М.
I Stopped Using Express.js: Because Bun and Hono 🔥
10:23
Sam Meech-Ward
Рет қаралды 102 М.
How to Read Emails Using Node IMAP
7:07
Simple Coding Tutorials
Рет қаралды 26
Host MERN Stack for FREE - Render + Domain Name Setup
21:10
Full Stack CRUD Operations | React, Node, Express & MongoDB
1:00:43
The Brave Coders
Рет қаралды 40 М.
Learn Bootstrap: Easy Step-by-Step Tutorial v5.3
42:30
Raddy
Рет қаралды 5 М.
Next.js 14 Deployment to VPS with GitHub Actions CI/CD
52:31
Learn MongoDB in 1 Hour 🍃 (2023)
1:00:00
Bro Code
Рет қаралды 909 М.
Build a Fullstack Blog App using MERN (mongo, express, react, node)
3:32:10
Coding With Dawid
Рет қаралды 332 М.
ONE MORE SUBSCRIBER FOR 6 MILLION!
00:38
Horror Skunx
Рет қаралды 15 МЛН