Skip to content

Latest commit

 

History

History
 
 

JWT-Authenticator-With-Roles

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

💥 JWT-Authenticator-With-Roles 💥

Nodemon

Express.js

NodeJS

MongoDB

Line

Description 📃

This api helps user to get a modern starting project for production use. This is a standard setup for any production level project. The different files are used to handle different functions. You can clone it to get started on your project quickly.

This readme file provides all the details you need to run and use this project.

How to run it? 🕹️

  • Clone the repository
  • Run npm install
  • Create a .env file and add the following variables
    • PORT
    • ACCESS_TOKEN_SECRET
    • REFRESH_TOKEN_SECRET
    • ACCESS_TOKEN_EXPIRY
    • REFRESH_TOKEN_EXPIRY
    • BCRYPT_SALT
    • MONGODB_URI
    • CORS_ORIGIN
  • Run npm run dev or npm start

Features

  • User Authentication

    • Register
    • Login
    • Logout
    • Refresh Token
  • User Roles

    • Admin
    • User

Screenshots of Endpoints

POST api/v1/user/register

alt text

POST api/v1/user/register-admin

alt text

POST api/v1/user/login

alt text

POST api/v1/user/logout

alt text

POST api/v1/user/refresh-token

alt text

GET api/v1/user/i-am-user

alt text

GET api/v1/user/i-am-admin

alt text

Line

Developed By PULKIT GUPTA 👦

Happy Coding 🧑‍💻

Show some  ❤️  by  🌟  this repository!