Skip to main content

Command Palette

Search for a command to run...

Day 19 (30 Days of Code)

Updated
2 min read
Day 19 (30 Days of Code)
N

I am Nirbhay Singh , I am starting this blog to document my coding journey of becoming a software developer and to get my first $ 100k offer .

21 July 2023

So the project I started is a Fullstack project. I'll be making a login system using MERN. I have previously made a login system so I have a pretty good idea of how things will work in the backend. The main focus of this project is to learn how to connect the server with the client.

Packages I used in the backend:

Working:

  1. I'll be getting data from the client in JSON format.

  2. If the user is new then he will be using the 'register' route but if the user has already registered then he will use the 'login' route.

  3. We will do some validation before storing the data.

  4. If everything is all right then we will Hash the password using bcryptjs to increase the security of our database.

  5. Just before storing the data, we will create a jwt token which we will send using a cookie to authenticate the user.

  6. A token will be created every time the user register or login.

  7. We will authenticate the user using middleware in the routes it is necessary to authenticate.

  8. Whenever the 'logout' route is called we will delete the cookie from the browser and also delete the token generated by the browser.

  1. Login system using MERN

  2. Login system using NodeJS

30 Days of Code

Part 10 of 28

I created this series to document my regressive learning of 30 days of my summer breaks of 2023. Contents of this series will not follow any pattern. It will a mixture of DSA and web dev.

Up next

Day 18 (30 Days of Code)

20 July 2023 Solved more questions on Dynamic Programming. Loot House A thief wants to loot houses. He knows the amount of money in each house. He cannot loot two consecutive houses. Find the maximum amount of money he can loot. Input Format: The ...

More from this blog

Daily Code by Nirbhay

74 posts

Hey, this is Nirbhay. I started this blog to document my journey of learning to code and get my first $100k offer. I'll be sharing the things related to DSA, backend development, devops and many more.