Skip to content

A MERN stack User Authentication (Login & Registration) app built with React, Express, Node.js, and MongoDB Atlas. It demonstrates client–server API communication, request validation with Joi, secure password hashing using bcrypt, JWT-based authentication, environment management with dotenv, and complete data flow from client to database.

Notifications You must be signed in to change notification settings

yashn2903/User-Authentication-Login-Registration-MERN-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

User Authentication(Login-Registration) App

A User Authentication (Login & Registration) application built using the MERN stack (React, Express, Node.js, MongoDB Atlas).

This project demonstrates how client-side and server-side APIs work together, including:

  • Sending data from React frontend to Express backend
  • Validating requests using Joi
  • Secure password hashing with bcrypt
  • Authentication using JWT (jsonwebtoken)
  • Storing and retrieving user data from MongoDB Atlas
  • Managing environment variables with dotenv
  • Handling CORS and request parsing

The goal of this project is to understand the complete data flow from client → server → database → client, and to practice building secure REST APIs.

Install Dependencies for Frontend & Backend

Frontend:

  npm install
  npm install react-router-dom react-toastify

Backend:

  npm install
  npm i express cors dotenv bcrypt body-parser joi jsonwebtoken mongoose

Environment Variables

  • Create a .env file in the backend directory.
  • Add the following variables with appropriate values
PORT = "-------- Any Port --------"

MONGO_CONN = "-------- Paste Your Mongo URI Here --------"

JWT_SECRET = "-------- Anything --------"

About

A MERN stack User Authentication (Login & Registration) app built with React, Express, Node.js, and MongoDB Atlas. It demonstrates client–server API communication, request validation with Joi, secure password hashing using bcrypt, JWT-based authentication, environment management with dotenv, and complete data flow from client to database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors