Course Content
Full Stack E-Commerce App (+8 hours free tutorial)
What technologies are used? Backend Server: Node.js Express Framework, JWT Database: MongoDB Payment Method: Stripe API Front-End Framework: React.js with hooks UI library: Styled Components State Management Library: Redux
0/3
Social Media App Using MERN Stack
If you want to be a full-stack web developer and stuck at just beginner projects, here is the chance to improve your skills and create something real. We are going to create a social media application from scratch. And this project is not going to include just a basic couple of methods and an unpleasant design, it's going to include a complete web API, impressive React components, and chat functionality. Let's dive into it!
0/3
React Instant Chat App Using Node.js and Socket.io
0/1
Full Stack Netflix App (7 hours free tutorial)
For this project I used Express API, MongoDB, React functional components, hooks with context API. I hope you will enjoy.
0/2
Full Stack Youtube Clone (5 hours free tutorial)
What technologies are used? Backend: Node.js Express Framework Database: MongoDB, Firebase Auth: JWT, Cookies, Firebase Google Auth Front-End Framework: React.js with hooks UI library: Styled Components State Management Library: Redux File Storage: Firebase Storage
0/2
Full Stack Development Projects
About Lesson

In this part of the video, I’ve created an API using Node.js Express server with a MongoDB connection. Then created necessary models, routes and controllers in order to handle CRUD operations.

  • root
    • models
      • User.model.js
      • Video.model.js
      • Comment.model.js
    • routes
      • auth.js
      • users.js
      • videos.js
      • comments.js
    • controllers
      • auth.controller.js
      • user.controller.js
      • video.controller.js
      • comment.controller.js

As you realize, there is an additional route and controller to take care of user authentication. To provide a security I’ve used bcryptjs and JWT library with cookies in the auth controller.

 

export const signin = async (req, res, next) => {
  try {
    const user = await User.findOne({ name: req.body.name });
    if (!user) return next(createError(404, "User not found!"));

    const isCorrect = await bcrypt.compare(req.body.password, user.password);

    if (!isCorrect) return next(createError(400, "Wrong Credentials!"));

    const token = jwt.sign({ id: user._id }, process.env.JWT);
    const { password, ...others } = user._doc;

    res
      .cookie("access_token", token, {
        httpOnly: true,
      })
      .status(200)
      .json(others);
  } catch (err) {
    next(err);
  }
};


And finally, I've combined the API with the UI Design in order to make the application dynamic. To fetch data and make other API requests axios was used and to handle state management, I preferred using redux-toolkit.