A boilerplate shows the interaction between frontend(react) and backend(express) based on JWT.
The server will run on port 3000, and client will run on port 8080.
$ cd client
$ npm install
$ npm run start
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
- Login and register based on JWT authorization of user
- Separate frontend and backend based on RESTful API
- Permission assignment
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.
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.