User Management in MERN: Create, Authenticate, and Administer Your MERN E-Commerce Store

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • In this pivotal episode of our MERN e-commerce development course, we delve deep into the world of user management. Master the art of user authentication, authorization as an admin, and gain the skills to create, read, update, and delete users on both the frontend and backend of your project.
    🚀 What You'll Master:
    User Authentication: Learn to implement secure user authentication, ensuring only authorized individuals access your e-commerce platform.
    Admin Privileges: Gain insights into user role management, giving you the power to oversee and control your empire.
    Create, Read, Update, Delete (CRUD): Discover how to perform CRUD operations, empowering you to manage user data seamlessly.
    Frontend Magic: We'll guide you through crafting an intuitive and visually appealing user interface for your website, enhancing the user experience.
    Backend Brilliance: Dive into backend development, where you'll create the logic to handle user data and maintain your empire's integrity.
    By the end of this video, you'll have the knowledge and skills needed to take complete control of user management for your e-commerce project, all while ensuring your platform is secure and user-friendly.
    Don't miss this opportunity to enhance your development skills and take a step closer to building a successful e-commerce empire. Join us and embark on this thrilling journey through MERN stack user management!
    Follow Me On 👇
    TH-cam: / @huxnwebdev
    GitHub: github.com/hux...
    Twitter: / huxnwebdev
    Instagram: ❌

ความคิดเห็น • 87

  • @huxnwebdev
    @huxnwebdev  10 หลายเดือนก่อน +7

    Complete Project Playlist👇
    th-cam.com/video/PRpTY5LS95M/w-d-xo.html&pp=gAQBiAQB
    Source Code 👇
    github.com/HuXn-WebDev/MERN-E-Commerce-Store

    • @Manoj11ish
      @Manoj11ish 7 หลายเดือนก่อน

      Hi great learning thnks, And I am facing issue in getUsers ---- UserList.jsx:16 Error: No data found at `state.api`. Did you forget to add the reducer to the store?
      Below details e.apiR. DidDevToolget to add the reducer to the store? from redux toolkit "getUsers(undefined)"
      reducerPath:"(state, action) => combinedReducer(resetApiState.match(action) ? void 0 : state, action)"
      status:"rejected"

  • @madeiragoddess
    @madeiragoddess 10 หลายเดือนก่อน +12

    Insane🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
    00:01 back end
    1:18:24 frontend navbar
    1:35:20 rtk query

    • @huxnwebdev
      @huxnwebdev  10 หลายเดือนก่อน +1

      🤜

  • @SimpleHak
    @SimpleHak 7 หลายเดือนก่อน +8

    Bro you are special one in this TH-cam community
    pls continue this humbleness and support to the community.
    And your work is extra ordinary thank you.
    Big respect

    • @huxnwebdev
      @huxnwebdev  7 หลายเดือนก่อน +3

      Thank you so much buddy for your amazing comment🥂

  • @yacinezine8647
    @yacinezine8647 10 หลายเดือนก่อน +10

    The biggest project in TH-cam

    • @huxnwebdev
      @huxnwebdev  10 หลายเดือนก่อน +2

      My bro 🤝

  • @rakeshkumarparida98
    @rakeshkumarparida98 หลายเดือนก่อน +1

    While building the frontend if you could keep the original website in another tab for for reference it would be helpful. Like you can tell that I am currently making this sidebar or navbar to achieve certain features or something , for that we have to write this block of code. Thank you.

  • @naitiksinghd.b5793
    @naitiksinghd.b5793 หลายเดือนก่อน

    Brother I just started your playlist, so far it's really good

  • @tuannguyenthai
    @tuannguyenthai 10 หลายเดือนก่อน +1

    I think the user deletion feature should be changed to hide the user instead. As I understand it, that's a soft-delete technique, and we shouldn't completely delete a user. Thank you for providing such great content. Wish you happy weekend

    • @huxnwebdev
      @huxnwebdev  10 หลายเดือนก่อน +2

      I appericate your suggestion but can you also tell what we're gonna do with the user info when we specificly wanna delete the account entirely? ( happy weekend )

    • @tuannguyenthai
      @tuannguyenthai 10 หลายเดือนก่อน

      @@huxnwebdev I haven't fully grasped the entire project yet. I simply think that if a user wants to recover their account, we can restore it for them. Additionally, this can help prevent issues such as viewing order details related to deleted users, which may occasionally lead to errors. That's what I think.

    • @iamjabeed
      @iamjabeed 10 หลายเดือนก่อน +1

      @@huxnwebdev You can use express-async-handler instead of custom handler? can you explain the reason behind using custom middleware over package?

    • @huxnwebdev
      @huxnwebdev  10 หลายเดือนก่อน +4

      @@iamjabeed I did install the express-async-handler package in the video (just in case) but then i decided to use custom error handler, creating a custom middleware gives you more control over the error-handling process. You can customize the error handling logic to fit your specific needs, You can integrate other error-handling mechanisms and logging as per your project's requirements, and all n all it helps you understand how error handling in Express works, making it a valuable learning experience.
      On the other hand, using (express-async-handler) can save time and make your code more concise, especially for smaller projects or when you prefer a quick and easy way to handle asynchronous errors.

  • @harryken2511
    @harryken2511 7 หลายเดือนก่อน +2

    your content is awesome brother huge welcome and keep doing this all the best bro

    • @huxnwebdev
      @huxnwebdev  7 หลายเดือนก่อน

      Thank you so much buddy 🤝

  • @Cmunx
    @Cmunx 21 วันที่ผ่านมา

    Let me finish this before this playlist gets paid only 🗿☝️

  • @niteshprajapat7918
    @niteshprajapat7918 10 หลายเดือนก่อน +2

    You are an Insane Developer 🔥❤✨

    • @huxnwebdev
      @huxnwebdev  10 หลายเดือนก่อน +2

      haha Thank you 🤝

  • @tuannguyenthai
    @tuannguyenthai 10 หลายเดือนก่อน +1

    😍😍😍The content you provide is really good, I love it.

    • @huxnwebdev
      @huxnwebdev  10 หลายเดือนก่อน +1

      Thanks buddy, means a lot 🥂

  • @vaibhavsingh9382
    @vaibhavsingh9382 16 วันที่ผ่านมา

    can we not update the username and email of the current admin like if i have signed in as a admin and i am trying to edit my name than it is giving me error this is the error (syntaxError: Unexpected token 'N', "Not author"... is not valid JSON)

  • @Eric-vs2he
    @Eric-vs2he 4 หลายเดือนก่อน +1

    2:31:52 For some reason whenever I click the arrow instead of it showing up next to the username, it shows up on top of the sidebar, any fixes?

  • @vaibhavsingh9382
    @vaibhavsingh9382 16 วันที่ผ่านมา

    bro i am facing dificulties with flowbite like it is showing that cannot find module but i have installed it will it be okay if i do not use it ?

  • @marethegeek
    @marethegeek 3 หลายเดือนก่อน

    I haven't finished the entire video yet but the loginUser controller does not have a try catch block or any error handling in the case of user logging in that doesn't exist or wrong password. Maybe you get to that later. Great videos bro!

  • @alisher9442
    @alisher9442 9 หลายเดือนก่อน +2

    Good course 👍👍

    • @huxnwebdev
      @huxnwebdev  9 หลายเดือนก่อน +1

      Thanks buddy ❤️

  • @Crafter360
    @Crafter360 10 หลายเดือนก่อน +3

    Awesome work man⚡

    • @huxnwebdev
      @huxnwebdev  10 หลายเดือนก่อน +2

      Thank you very much! 🤝

  • @waheed21savage
    @waheed21savage 10 หลายเดือนก่อน +1

    hello sir, We really appreciate you

    • @huxnwebdev
      @huxnwebdev  10 หลายเดือนก่อน +1

      I'm glad my content was helpful for you buddy 🤝

  • @garvtech2002
    @garvtech2002 11 วันที่ผ่านมา

    can someone tell which font he is using in vscode.

  • @sahamahmed-iz8mg
    @sahamahmed-iz8mg 4 หลายเดือนก่อน

    any specific reason for not using axios? would have been simpler in my opinion

  • @waheedullah
    @waheedullah 10 หลายเดือนก่อน +1

    Appreciate it 🎉

    • @huxnwebdev
      @huxnwebdev  10 หลายเดือนก่อน

      🤜🤜

  • @user-ht6pp2oq5s
    @user-ht6pp2oq5s 8 หลายเดือนก่อน

    are you using a dark mode extension for the whole website or you've provided dark colour to the body

  • @bayemekonnen6224
    @bayemekonnen6224 หลายเดือนก่อน

    .js file when import to .jsx error happen

  • @irumidisara9547
    @irumidisara9547 5 หลายเดือนก่อน +1

    I got an error with "not authorized, no token" instead of "not authorized as an admin" at 48:55. I did exactly the same thing like you did in coding. But it doesn't work when it comes to get all users. Can anyone please help?

    • @huxnwebdev
      @huxnwebdev  5 หลายเดือนก่อน

      Hi, I've made specific code commits for each video in my GitHub repository for this project. You can find the commit related to "User Management" and compare it to your code to identify any discrepancies in the backend.
      I wish i could help but unfortunately i can't ask you to send me your repo link because of many reasons which i can't discuss.

    • @ubermensch_1111
      @ubermensch_1111 5 หลายเดือนก่อน

      Hey I am having the same problem and also my IsAdmin is not changing to true.....Is it working for you now ???

    • @kapalabintang
      @kapalabintang 23 วันที่ผ่านมา

      the problem is
      secure: process.env.NODE_ENV != "development" inside generateToken function in createToken.js
      that's because cookies can only be sent when the request is secure and safe which is HTTPS and outside of that will not work. so the solution is removing that

  • @rohith3261
    @rohith3261 10 หลายเดือนก่อน +1

    My brother ❤

    • @huxnwebdev
      @huxnwebdev  10 หลายเดือนก่อน +1

      My Brother 🥂

  • @huxkiriye
    @huxkiriye 8 หลายเดือนก่อน

    Amazing thanks #Huxn WebDev kindly do also a full course Flutter and Dart plus real world projects...and how to setUp machine(computer) min requirement for Flutter and Dart dev....?

  • @matiasdelarosa6523
    @matiasdelarosa6523 หลายเดือนก่อน

    Hello, awesome tutorial, im loveing it. I have a problem with the login, i can login but the page dont redirect lo the home page, i have to refresh the page and then im inside the user logged

    • @matiasdelarosa6523
      @matiasdelarosa6523 หลายเดือนก่อน

      useEffect(() =>{
      if (userInfo) {
      navigate('/');
      }
      }, [navigate, redirect, userInfo]);
      const submitHandler = async (e) => {
      e.preventDefault();

      try {
      const res = await login({email, password}).unwrap();
      dispatch(setCredentials({...res}));

      } catch (error) {
      toast.error(error?.data?.message || error.message)
      }
      };
      i also tried this but it doesnt work
      useEffect(() =>{
      if (userInfo) {
      navigate(redirect);
      }
      }, [navigate, redirect, userInfo]);

    • @matiasdelarosa6523
      @matiasdelarosa6523 หลายเดือนก่อน

      the page throw this error :
      (intermediate value).getItem is not a function

  • @Curiousdev01
    @Curiousdev01 6 หลายเดือนก่อน

    What is total time you have taken to complete this project bro?

  • @getHiredWithMe
    @getHiredWithMe 2 หลายเดือนก่อน

    Alex is so cool 😂😂

  • @Portal-Solve
    @Portal-Solve 5 หลายเดือนก่อน

    Brother you can do this in a much simpler way.But why you make it difficult like for api redux thunk is most used

  • @vedpandere898
    @vedpandere898 5 หลายเดือนก่อน

    hi huxn i followed every step but at 2:22:41 when you click on sign-in i am getting userinfo on console-log but my page is not redirecting at all and tried to match my code with your github code everthing was fine infact there no error in my console log please help

    • @nezuko7517
      @nezuko7517 5 หลายเดือนก่อน

      same problem

    • @vedpandere898
      @vedpandere898 5 หลายเดือนก่อน

      @@nezuko7517 actually I solved it there was a typo error which was not so easy to discover

    • @markovnikov5264
      @markovnikov5264 3 หลายเดือนก่อน

      I'm encountering error Typo error in safe buffer ,can you help me please ​@@vedpandere898

    • @joemasu7956
      @joemasu7956 3 หลายเดือนก่อน

      @@vedpandere898 how did you do???

    • @joemasu7956
      @joemasu7956 3 หลายเดือนก่อน

      @@nezuko7517 have got where the error is...

  • @user-gx5so3yu5r
    @user-gx5so3yu5r 9 หลายเดือนก่อน +2

    I stuck in 3 hours just because I didn't know that I have to install mongoDB, I though that this playlist already say all setups we need

    • @huxnwebdev
      @huxnwebdev  9 หลายเดือนก่อน +1

      You said you didn't have MongoDB installed, which suggests you might not be ready for this project because if you were you would've already installed mongoDB in your machine. If you don't know MongoDB yet, it's better to finish my whole MERN course before trying this project. That way, you'll be better prepared.

  • @amalmurikkoli7629
    @amalmurikkoli7629 7 หลายเดือนก่อน

    Hi sir, which browser are you using?

  • @AzharKhan-fv5hn
    @AzharKhan-fv5hn 6 หลายเดือนก่อน

    i am getting undefined in jwt cookie authorize

    • @huxnwebdev
      @huxnwebdev  6 หลายเดือนก่อน

      Push your code to GitHub and send me the link on any of my socials.

  • @burmesedragon8851
    @burmesedragon8851 8 หลายเดือนก่อน +1

    I can't proceed beyond 49:05 because postman replied "not authorized as an admin" when I pushed 'send' button after logging in with my admin account.

    • @huxnwebdev
      @huxnwebdev  8 หลายเดือนก่อน +1

      Push your code to github and send me the link on any of my socials.

    • @burmesedragon8851
      @burmesedragon8851 8 หลายเดือนก่อน

      @@huxnwebdevActually, I coded along with you. All of my codes are the same as your code, Sir. I think authorizeAdmin is the problem because both req.user and req.user.isAdmin are false.

    • @huxnwebdev
      @huxnwebdev  8 หลายเดือนก่อน +1

      You just made me clone my repo and install all the dependecies, I just checked and everything is working on my side, idk what's wrong with your code, as i said push your code to github and send me the link so that i can see what you did wrong.

    • @burmesedragon8851
      @burmesedragon8851 8 หลายเดือนก่อน

      @@huxnwebdev const authorizeAdmin = asyncHandler(async (req, res, next) => {
      const adminUser = await User.findOne(req.isAdmin);
      if (adminUser === true) {
      next();
      } else {
      res.status(401).send("Not authorized as an admin.");
      }
      }); I changed this and I can finally get all users passing through authorizeAdmin. I keep coding with you! Thank you so much. If I have some problems, I will keep asking you. Thank you again.

    • @burmesedragon8851
      @burmesedragon8851 8 หลายเดือนก่อน +1

      @@huxnwebdevThank you for your support. Your videos and tutorials help me understand MERN stack so much.

  • @michealdrink4188
    @michealdrink4188 3 หลายเดือนก่อน +1

    hi @huxnwebdev
    I have problem i am login as an Orange and when i click update i see SyntaxError: Unexpected token 'N', "Not author"... is not valid JSON and when i check console shows me this:
    Failed to load resource: the server responded with a status of 401 (Unauthorized) Not authorized as an admin.
    Please help!

    • @Iamfavur
      @Iamfavur 2 หลายเดือนก่อน

      probably because the user account that is logged in is not an admin