Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sandeepkv93/node-user-auth-starterkit

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. 🚀🔑💻
https://github.com/sandeepkv93/node-user-auth-starterkit

authentication authorization expressjs jwt-authentication middlewares mongodb nodejs routing

Last synced: 10 days ago
JSON representation

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. 🚀🔑💻

Awesome Lists containing this project

README

        

# 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
```shell
git clone https://github.com/sandeepkv93/node-user-auth-starterkit.git
```

2. Install dependencies
```shell
npm install
```

3. Start the server
```shell
npm start
```

4. 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