Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

User Management using NodeJs

A robust application with user authentication, role-based access control, and secure API endpoints using jwt for authentication, and bcrypt for secure password storage.

Table of Contents

User Management

πŸ‘‰ Signup

Collect basic details (email, phone number, name, profile image, password) during the signup process. Ensure at least one of the phone numbers or email is provided during signup. Implement encryption for passwords using bycrpt library.

signup-1

signup-2

πŸ‘‰ Login

Allow users to log in using email/phone and password.
Using JSON web token to generate a unique token for the user

login-1

πŸ‘‰ Get User by ID

Users can view their details using userId

getUserById

πŸ‘‰ Modify User Details

Users can only modify their own name and profile image. Phone number and email, once entered, cannot be changed.

updateUser

updateUser-1

πŸ‘‰ Delete User

Users can delete their accounts.

deleteUser

Roles and Access Control

Roles

There are two roles defined Admin and User.

πŸ‘‰ Admin Access

Admins can view, modify, and delete all user details.

Admin-getAllUser Admin-updateUser Admin-deleteUser

πŸ‘‰ User Access

Users can only view, modify, and delete their details.

Admin Management

Create Admin

To create admin accounts.

createAdmin createAdmin-1

Authentication and Security

Authentication

Implemented an authentication system using JSON Web Tokens (JWT).

Password Encryption

Used bcrypt to securely encrypt user passwords.

Image Storage

Profile Image

Saves the profile images in the local system.

uploadImage uploadImage-1 getUserImage

Database and Framework

Framework

Used Express.js for API development.

Database

Used MongoDB for the database.

Getting Started

  1. Clone the repository:

    git clone https://github.com/Ritish134/User-Management.git
    
  2. Install dependencies:

    cd your-project
    npm install
    
  3. Set up environment variables:
    Create a .env file and add the configuration variables MONGO_URI, JWT_SECRET

  4. Run the application:

    node index

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages