Git Product home page Git Product logo

usermanagementdemo-nodejs's Introduction

usermanagementdemo-nodejs

NodeJS project to demonstrate basic user authentication/authorization with JSON Web Tokens (jwt)

Keywords

  1. NodeJS
  2. JavaScript
  3. Express
  4. RESTful API
  5. JWT
  6. Authentication
  7. Authorization
  8. MySQL
  9. SQL
  10. Middleware
  11. CORS
  12. Pagination
  13. ORM
  14. File Upload

Brief description

There are 3 roles. Guests can login or register. Newly registered accounts can't login, an admin has to activate their accounts first so they can login. Users can login, view their profiles, edit their profiles or delete their accounts. Users can also upload a profile image or delete it. Admins can do anything guests and users can do. They can also view a list of all users, activate new accounts or remove anyones account. They can also delete profile images from users. If someone tries to login many times in a short period with wrong password his account get temporarily locked for a short period before user can try to login again.

RESTful API by User Role

1. Guests can:

  • Login -> post request @ http://localhost:3000/login ({ "username": "username", "password": "password" })
  • Register -> post request @ http://localhost:3000/users ({ "username": "username", "password": "password", "firstName": "firstName", "lastName": "lastName", "email": "email", "phone": "phone?", "country": "country?", "city": "city?", "address": "address?" })

2. Users can (those who have already logged in):

3. Admins, can do anything normal users can do plus:

Other info

fields with ? are optional
seeder/db_seeder.js is a simple JavaScript file you can execute to seed the database with some random users and an admin account with username and password admin for testing.

Versions used

  • MySQL v8.0.26
  • NodeJS v14.17.3

usermanagementdemo-nodejs's People

Contributors

spyrosalertas avatar

Watchers

 avatar

Forkers

nexgentech

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.