Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/n-bhasin/rolebased-auth-nodejs-mongodb
https://github.com/n-bhasin/rolebased-auth-nodejs-mongodb
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/n-bhasin/rolebased-auth-nodejs-mongodb
- Owner: n-bhasin
- Created: 2020-07-21T18:23:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-22T17:43:08.000Z (about 2 years ago)
- Last Synced: 2023-03-08T00:45:55.320Z (almost 2 years ago)
- Language: JavaScript
- Size: 1.48 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RoleBased-Auth-Nodejs-MongoDB
# Introduction
This is a backend template for Role based authentication which is created by using nodejs, epxress, jwt and mongoDB.
It is perfect fit for creating a Customer management system using nodejs-backend or reactjs-frontend.# Created By
---
Name: Bhasin Neeraj
Email: [email protected]---
# Project File Structure
| File | Details(contains) |
| -------------------------- | :-------------------------------------: |
| congif.json | mongoDB Url, JWT private key |
| helpers/db.js | contains the monogoDB connection |
| helpers/errorHandler.js | global errors |
| helpers/jwt.js | authenticates the token and role. |
| helpers/role.js | contains the roles(Admin, User) |
| services/user.services.js | all methods that perform crud operation |
| routes/user.controllers.js | routes to all crud operations |# Project Images Using Postman
#### Register new User
![alt text][logo]
[logo]: https://github.com/n-bhasin/RoleBased-Auth-Nodejs-MongoDB/blob/master/documents/register.png "Register new user"
#### Authenticate user
[![Authenticate user](/documents/authenticate/authenticate.png)
#### Current user
[![Current user](/documents/current.png)
#### Unauthorized Access
[![Unauthorized Access](/documents/unauthorized.png)
# Instructions
1. clone the repo
2. install npm packages-> npm install
3. run the app.js-> node app.js
4. use the postman to test the app