farhan2106 / microservice-user-management

User Management Microservice.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Micro Service: User Management

Build Status Coverage Status

Development:

Install the following packages:

  • npm install -g standard
  • npm install -g npm-check-updates
  • npm install -g nodemon

Rename .env.sample to .env with your configurations.

Testing

Testing is conducted using using jasmine with istanbul for code coverage.

  • npm install -g istanbul
  • npm install -g jasmine

Features

Available defined tasks:

  • npm run dev - Starts development server.
  • npm run lint - Runs standard.
  • npm test - Runs api testing.

Database

It is using mongodb with mongoose.

Login & Logout

  • User can login with username or email.
  • After successful login, a jwt token will be generated.
  • After logout, logged out token in stored in blacklisted_tokens table until the expiredAt value is less than the current unix time. There is a timer that will run every 24h.

Registration

  • Username type can be configured with a regex.
  • Password strength can be configured with a regex.
  • Required fields are username, email, and password.
  • username and email is unique.
  • After registration, a secret will be given for user activation.
  • Register user from social login by submitting a social user id and a social source eg. facebook, twitter etc.

Reset Password

  • A secret will be given when user wants to reset password. User will also be deactivated.
  • Use this secret when submitting a new password.

View Profile

  • User data can be retrieved by id, username, and email.

About

User Management Microservice.

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%