Code Monkey home page Code Monkey logo

mernauth-backend's Introduction

🎯 Login and Registration System Using MERN Stack - Backend

Node.js CI

This project is a backend Login and Registration System. It encompasses key functionalities such as registration, login, input validation, JWT authentication, refresh tokens, password reset, and OTP support. This backend solution ensures secure and efficient user authentication for web applications built with the MERN stack.

πŸ”° Features

  • βœ… Registration
  • βœ… Login
  • βœ… Input Validation
  • βœ… JWT Auth Token
  • βœ… Refresh Token
  • βœ… Password Reset
  • βœ… OTP Support
  • βœ… Api Access Limit
  • ⏳ Β Google Auth (coming soon)

βš™ Used Tools and Technologies

  • NodeJS
  • ExpressJS
  • MongoDB
  • Json Web Token
  • Nodemailer

πŸš€ How to Deploy locally

1. Install NodeJS on your System

2. Clone Repository to your local machine

git clone https://github.com/hirushaph/MernAuth-Backend.git

3. Go to MernAuth Directory

cd MernAuth-backend

4. Install required node modules

npm install

5. Create .env File inn root directory

After creating .env file, your folder structer look like this

πŸ“‚ MernAuth-Backend
    πŸ“‚ node-modules
    πŸ“‚ src
       πŸ“‚ Controllers
       πŸ“‚ Models
       πŸ“‚ Router
       πŸ“‚ and others
       πŸ“„ app.js
    πŸ“„.env  <------This is the file you need to create
    πŸ“„.gitignore
    πŸ“„ package.json
    πŸ“„ README.md

Important

Copy the code below to the .env file and fill in all required variables. πŸ‘‡

# define development or production ( default is development )
# If you are deploying for production, set this to production
STATUS=
# Default port is 3000.
# Define the port here if you want to change that.
PORT=
MONGODB_URL=

# Enter your frontend application url here (only if you have frontend)
FRONTEND_URL=

# You can generate a secret by running this command in the terminal:
# "node -e "console.log(require('crypto').randomBytes(32).toString('hex'))".
JWT_ACCESS_SECRET=
JWT_REFRESH_SECRET=

# Smtp Details for email features
HOST=
EPORT=
USER=
PASSWORD=

6. Start the server

npm start

πŸ“Œ TODO

  • Document Api Endpoints
  • Add integration Tests
  • User Roles
  • OAuth
  • Add better comments

mernauth-backend's People

Contributors

dependabot[bot] avatar hirushaph avatar

Stargazers

 avatar  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.