Skip to content

shivamvijaywargi/mern-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MERN Authentication system Basic

This is a basic mern authentication system which has 4 routes

  1. Login
  2. Register
  3. Logout
  4. Dashboard
  • The dashboard is only accesible if the user is logged in otherwise the user is redirected to login page.

  • Once user registers/logs in the token is saved in the local storage which is sent into headers with every request and the backend checks for it and if valid the user is allowed to view the dashboard page.

  • If the token is invalid/expired user is not allowed to view the dashboard page.

  • After log in if the user tries to visit the login page again they are redirected back to the dashboard

Steps to run the app locally

  1. Clone the repository git clone https://github.com/shivamvijaywargi/mern-auth.git
  2. cd client and run yarn
  3. cd server and run yarn
  4. In the server folder add your environment variables in .env file (For reference check .env.example)
  5. To start the backend run yarn dev from server folder and to start the frontend run yarn dev from the client folder.

Screnshots

Login Page Register Page Dashboard Page

Note: This is not a perfect auth app there might be many bad practices and many performance issues. This is just a dummy project I have built to test my knowledge.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages