Skip to content

A complete toolkit for developers aiming to swiftly implement a user authentication system using Node.js, React.js, MongoDB, and Mongoose. It offers secure, efficient login solutions, integrates best practices, and demonstrates the synergy of Node.js for robust server-client setups. Perfect for building secure user interfaces with ease. ๐Ÿš€๐Ÿ”‘๐Ÿ’ป

License

Notifications You must be signed in to change notification settings

sandeepkv93/node-user-auth-starterkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Node User Authentication Starter Kit

This repository provides a starter kit for building user authentication and authorization features in a Node.js application. It includes a sample login and registration flow, as well as an example of how to protect routes and manage user roles and permissions.

Features

  • User registration and login
  • Hashing and salting of passwords
  • JWT-based authentication
  • Route protection and user role management
  • Example implementation of user roles and permissions

Getting Started

  1. Clone the repository
git clone https://github.com/sandeepkv93/node-user-auth-starterkit.git
  1. Install dependencies
npm install
  1. Start the server
npm start
  1. Test the endpoints using a tool like Postman or Insomnia. The following routes are available:
  • POST /register for user registration
  • POST /login for user login
  • GET /protected for a protected route example

Customization

  1. Update the config.js file with your own JWT secret and database configuration
  2. Add more roles and permissions in the config.js file as per your requirements
  3. Update the User model in models directory with any additional fields you need
  4. Update the auth middleware in middlewares directory as per your requirements
  5. Add more routes and update the existing routes as per your requirements

Built With

  • Node.js
  • Express.js
  • MongoDB (with Mongoose)
  • jsonwebtoken
  • bcrypt

About

A complete toolkit for developers aiming to swiftly implement a user authentication system using Node.js, React.js, MongoDB, and Mongoose. It offers secure, efficient login solutions, integrates best practices, and demonstrates the synergy of Node.js for robust server-client setups. Perfect for building secure user interfaces with ease. ๐Ÿš€๐Ÿ”‘๐Ÿ’ป

Topics

Resources

License

Stars

Watchers

Forks