Example using react, nodeJS, mySQL with JWT(Json web token) to create login and register system
JSON Web Token is an open industry standard used to share information between two entities, usually a client (like your app’s frontend) and a server (your app’s backend).
They contain JSON objects which have the information that needs to be shared. Each JWT is also signed using cryptography (hashing) to ensure that the JSON contents (also known as JWT claims) cannot be altered by the client or a malicious party.
For example, when you sign in with Google, Google issues a JWT which contains the following claims / JSON payload:
JWT.IO allows you to decode, verify and generate JWT.
- Install XAMPP web server
- Any Editor (Preferably VS Code or Sublime Text)
- Any web browser with latest version
- HTML5/CSS3
- ReactJS
- Material-UI
- XAMPP
- Nodejs express nodemon
- MySQL
- import sql script into mysql ( mydb.sql )
Field Type Null Key Default Extra Comment id int(11) NO PRI NULL auto_increment primary key email varchar(50) NO UNI NULL user's email password text NO NULL user's password fname varchar(50) NO NULL first name lname varchar(50) NO NULL last name -
Open http://localhost:3333 to view it in the browser.
cd server npm install nodemon app.js
-
Open http://localhost:5173/ to view it in the browser.
cd client npm install npm run dev
- JWT-nodejs : identify an authenticated user
- Express API with JWT
- Bcrypt : A library to help you hash passwords.
- Ajax : send and receive (HTTPS request)information in various formats
- Cors : access the api from different domain