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

Поделиться
HTML-код
  • Опубликовано: 22 окт 2024

Комментарии • 88

  • @huxnwebdev
    @huxnwebdev  Год назад +7

    Complete Project Playlist👇
    ruclips.net/video/PRpTY5LS95M/видео.html&pp=gAQBiAQB
    Source Code 👇
    github.com/HuXn-WebDev/MERN-E-Commerce-Store

    • @Manoj11ish
      @Manoj11ish 8 месяцев назад

      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"

  • @SimpleHak
    @SimpleHak 9 месяцев назад +9

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

    • @huxnwebdev
      @huxnwebdev  9 месяцев назад +3

      Thank you so much buddy for your amazing comment🥂

  • @madeiragoddess
    @madeiragoddess Год назад +12

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

  • @yacinezine8647
    @yacinezine8647 Год назад +10

    The biggest project in RUclips

  • @rakeshkumarparida98
    @rakeshkumarparida98 3 месяца назад +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.

  • @tuannguyenthai
    @tuannguyenthai Год назад +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  Год назад +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 Год назад

      @@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 11 месяцев назад +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  11 месяцев назад +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.

  • @naitiksinghd.b5793
    @naitiksinghd.b5793 3 месяца назад

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

  • @marethegeek
    @marethegeek 4 месяца назад

    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!

  • @niteshprajapat7918
    @niteshprajapat7918 Год назад +3

    You are an Insane Developer 🔥❤✨

  • @buzz_404
    @buzz_404 10 месяцев назад

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

  • @Curiousdev01
    @Curiousdev01 8 месяцев назад

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

  • @alisher9442
    @alisher9442 11 месяцев назад +2

    Good course 👍👍

    • @huxnwebdev
      @huxnwebdev  11 месяцев назад +1

      Thanks buddy ❤️

  • @harryken2511
    @harryken2511 8 месяцев назад +2

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

    • @huxnwebdev
      @huxnwebdev  8 месяцев назад

      Thank you so much buddy 🤝

  • @sahamahmed-iz8mg
    @sahamahmed-iz8mg 6 месяцев назад

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

  • @vaibhavsingh9382
    @vaibhavsingh9382 2 месяца назад

    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 ?

  • @waheed21savage
    @waheed21savage Год назад +1

    hello sir, We really appreciate you

    • @huxnwebdev
      @huxnwebdev  Год назад +1

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

  • @Eric-vs2he
    @Eric-vs2he 6 месяцев назад +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?

  • @Crafter360
    @Crafter360 Год назад +3

    Awesome work man⚡

  • @tuannguyenthai
    @tuannguyenthai Год назад +1

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

    • @huxnwebdev
      @huxnwebdev  Год назад +1

      Thanks buddy, means a lot 🥂

  • @vaibhavsingh9382
    @vaibhavsingh9382 2 месяца назад

    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)

  • @matiasdelarosa6523
    @matiasdelarosa6523 3 месяца назад

    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 3 месяца назад

      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 3 месяца назад

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

  • @waheedullah
    @waheedullah 11 месяцев назад +1

    Appreciate it 🎉

  • @irumidisara9547
    @irumidisara9547 7 месяцев назад +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  7 месяцев назад +1

      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 7 месяцев назад

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

    • @kapalabintang
      @kapalabintang 2 месяца назад

      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

  • @garvtech2002
    @garvtech2002 Месяц назад

    can someone tell which font he is using in vscode.

  • @rohith3261
    @rohith3261 11 месяцев назад +1

    My brother ❤

    • @huxnwebdev
      @huxnwebdev  11 месяцев назад +1

      My Brother 🥂

  • @amalmurikkoli7629
    @amalmurikkoli7629 8 месяцев назад

    Hi sir, which browser are you using?

  • @huxkiriye
    @huxkiriye 10 месяцев назад

    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....?

  • @bayemekonnen6224
    @bayemekonnen6224 2 месяца назад

    .js file when import to .jsx error happen

  • @vedpandere898
    @vedpandere898 7 месяцев назад

    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 7 месяцев назад

      same problem

    • @vedpandere898
      @vedpandere898 7 месяцев назад

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

    • @markovnikov5264
      @markovnikov5264 5 месяцев назад

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

    • @joemasu7956
      @joemasu7956 4 месяца назад

      @@vedpandere898 how did you do???

    • @joemasu7956
      @joemasu7956 4 месяца назад

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

  • @getHiredWithMe
    @getHiredWithMe 4 месяца назад

    Alex is so cool 😂😂

  • @Cmunx
    @Cmunx 2 месяца назад

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

  • @AzharKhan-fv5hn
    @AzharKhan-fv5hn 8 месяцев назад

    i am getting undefined in jwt cookie authorize

    • @huxnwebdev
      @huxnwebdev  8 месяцев назад

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

  • @KhiêmTrần-h6z
    @KhiêmTrần-h6z 11 месяцев назад +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  11 месяцев назад +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.

  • @burmesedragon8851
    @burmesedragon8851 9 месяцев назад +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  9 месяцев назад +1

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

    • @burmesedragon8851
      @burmesedragon8851 9 месяцев назад

      @@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  9 месяцев назад +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 9 месяцев назад

      @@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 9 месяцев назад +1

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

  • @michealdrink4188
    @michealdrink4188 5 месяцев назад +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 3 месяца назад

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