https://github.com/apal21/express-jwt-auth-server
Express.js JWT Auth Server with Babel and ESLint Airbnb, MongoDB and Redis.
https://github.com/apal21/express-jwt-auth-server
babel eslint express expressjs mongodb mongoose nodejs redis redis-client redis-server
Last synced: 2 months ago
JSON representation
Express.js JWT Auth Server with Babel and ESLint Airbnb, MongoDB and Redis.
- Host: GitHub
- URL: https://github.com/apal21/express-jwt-auth-server
- Owner: apal21
- License: mit
- Created: 2019-03-07T18:13:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-03T08:32:58.000Z (about 6 years ago)
- Last Synced: 2025-04-14T20:09:31.357Z (2 months ago)
- Topics: babel, eslint, express, expressjs, mongodb, mongoose, nodejs, redis, redis-client, redis-server
- Language: JavaScript
- Size: 237 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Express JWT Auth Server
JWT Auth Server implementation in Express.js using _Babel_ and _ESLint Airbnb_.**Database:**
* MongoDB
* Redis**Note:** _This server is not meant to connect directly with the frontend as you can set the configurations from the API call and this returns all the server errors(if any) in the response._
## Usage
* First copy/rename `.env.sample` to `.env`
* Generate one `RS256` key-pair and paste the content in the respective fields of `.env` file. Refer [this gist](https://gist.github.com/ygotthilf/baa58da5c3dd1f69fae9)
* Setup MongoDB and Redis on your machine.
* Install all the NPM dependencies: `npm i`
* To watch all the changes in development: `npm start`
* To deploy this in production: `npm run production`## Features
* Multiple User Roles and Verification
* Sign tokens using Public Key encryption
* Verify tokens using Whitelisting strategy
* Written in modern JavaScript
* ESLint pre-commit hook
* Set dynamic expiration time and subject in the token## Routes
1. [User CRUD routes for admins](https://github.com/apal21/express-jwt-auth-server/wiki/User-CRUD-Routes):
* `GET` `/users`
* `POST` `/users`
* `GET` `/users/:id`
* `PUT` `/users/:id`
* `DELETE` `/users/:id`
2. [Auth Routes](https://github.com/apal21/express-jwt-auth-server/wiki/Auth-Routes):
* `POST` `/auth/login`
* `POST` `/auth/register`
* `POST` `/auth/forgot`
* `POST` `/auth/reset/:id`
* `POST` `/auth/logout`
* `POST` `/auth/verify`