Sharing platform independent(~almost) middleware code for JWT Authentication and Role based Authorization.
YouTube Video Tutorial
Middleware: Node JS, Express, GraphQL, JWT, CORS, SEQUELIZE
front-end: React, Vue JS, Angular 6.0 or Plain HTML/CSS/JS
back-end: SQL AND/OR NO-SQL database (MYSQL & MongoDB used in example)