Yuussef / jwt-express-react

A demo which includes frontend and backend based on json-web-token.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jwt-express-react

A demo shows the interaction between frontend(react) and backend(express) based on JWT.

Get Started

Both of client and server. The server will run on port 3000, and client will run on port 3002.

$ npm run start

Features:

  • Login and register based on JWT authorization of user
  • Separate frontend and backend based on RESTful API
  • Permission assignment

Contains

Pattern

Add the field of header named authorization to store JWT token after login of frontend.

Backend receives the JWT token and this API needs some permissions.

Details

A model named "Role" which is designed to store different identity of user to distinguish different authorities.

You can change some configs at "config" dir. The premise is that you have already install the database environment.

Any suggestiton and criticism generally be made welcome.

About

A demo which includes frontend and backend based on json-web-token.


Languages

Language:JavaScript 98.3%Language:HTML 1.7%