Skip to content

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

Notifications You must be signed in to change notification settings

dcalsky/jwt-express-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jwt-express-react

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

Get Started

The server will run on port 3000, and client will run on port 8080.

Client

$ cd client
$ npm install
$ npm run start

Server

Create your postgresql database firstly, and initialize relational tables. Or you can use sequelize-cli to migrate.

$ cd server
$ npm install
... initialize database and tables.
$ 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 bolierplate which includes frontend and backend based on json-web-token.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published