GithubHelp home page GithubHelp logo

theartifulprogrammer / mern-authentication Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 612 KB

Full MERN Authentication Implementation - User Activation, Forgot Password, Refresh Tokens, Access Tokens.

JavaScript 82.61% SCSS 16.39% HTML 0.91% CSS 0.09%

mern-authentication's Introduction

MERN Authentication

MERN Stack

Full MERN Authentication Implementation - User Activation, Forgot Password, Refresh Tokens, Access Tokens.

Table of Contents

Introduction

This project demonstrates a complete authentication system built using the MERN stack (MongoDB, Express.js, React.js, Node.js). It includes user registration, activation via email, password reset, and the use of access and refresh tokens for secure authentication.

Features

  • User Registration
  • Email Activation
  • Login/Logout
  • Forgot Password
  • Password Reset
  • Access Tokens
  • Refresh Tokens
  • Protected Routes

Prerequisites

Before you begin, ensure you have the following installed on your machine:

Installation

  1. Clone the repository:

    git clone https://github.com/TheArtifulProgrammer/mern-authentication.git
  2. Navigate to the project directory:

    cd mern-authentication
  3. Install server dependencies:

    cd server
    npm install
  4. Install client dependencies:

    cd ../client
    npm install

Usage

  1. Create a .env file in the server directory with the following environment variables:

    MONGO_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret
    EMAIL_SERVICE=your_email_service
    EMAIL_USER=your_email_user
    EMAIL_PASS=your_email_password
    CLIENT_URL=http://localhost:3000
  2. Start the development server:

    cd server
    npm run dev
  3. Start the React development server:

    cd ../client
    npm start
  4. Open your browser and navigate to http://localhost:3000

Project Structure

mern-authentication/
├── client/         # React frontend
│   ├── public/
│   └── src/
│       ├── components/
│       ├── pages/
│       ├── utils/
│       └── App.js
├── server/         # Express backend
│   ├── config/
│   ├── controllers/
│   ├── middlewares/
│   ├── models/
│   ├── routes/
│   └── server.js
└── README.md

mern-authentication's People

Contributors

theartifulprogrammer avatar probaz avatar

Stargazers

 avatar Rakinzi Silver avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.