Skip to content

A skeleton of Role Based Access Control using Nodejs, Express, Mongoose, Passport Js, & Tailwind. [Used in Arclight project]

Notifications You must be signed in to change notification settings

S4nfs/RBAC_NodeJS_App

Repository files navigation

Role-Based-Access-Control NodeJS Application ( ◕▿◕ )

using Node.JS, Express, Mongoose, Passport, Ejs and Tailwind CSS





Features

  • Easy to Implement in your existing Projects
  • Passport Js Local Authentication
  • Express Validation for User Registration and Login
  • Sessions and Cookies based Authentication
  • Only admins can change the role of others but not himself without other admin's approval
  • Persistent Session after server reboots using connect-mongo package
  • Take the user back to exact route which he requested for before login using connect-ensure-login package
  • Error Handling using Error-handler package

Get Started

  1. Ensure MongoDB is running on your machine
  2. Install Dependencies:
    npm install
    
  3. Run the Server:
    npm start
    

    or

    npm run dev
    
  4. Open the Browser and go to http://localhost:3000/
  5. Register with your .env admin email to get admin access

  6. Environment Variables

    Set the environment variables in the .env file in the root directory of the project.

    PORT=3000
    MONGO_URI=mongodb://localhost:27017/mydatabase
    SESSION_SECRET=MySuperSecretSession
    ADMIN_EMAIL=admin@gmail.com
    

    さよなら 👋

About

A skeleton of Role Based Access Control using Nodejs, Express, Mongoose, Passport Js, & Tailwind. [Used in Arclight project]

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published