This project was bootstrapped with Create React App.
Before running the project, please make sure you have the following:
- Node.js LTS version which can be found here. The course is upto date using this version at all times.
- Please refer to the help section below to resolve most common questions.
Yes, feel free to use your own IDE for the course.
To check your current Node.js version, open your terminal and type the command below to see your current Node.js version.
node -v
If you do not have the Node.js LTS version on your machine, you can download using either of the following:
-
Please go here and download the LTS version of Node.js installable file for your operating system.
-
Alternatively, you can use Node Version Manager (
nvm
) to install LTS version of Node.js in case you do not want to delete the existing Node version on your machine.
NVM
allows you to use multiple Node versions on your machine and prevent disrupting other projects you may be running with differentNode
versions.
Click on this link and follow the instructions provided in their README.md file to install nvm on your machine depending on your platform.
No, npm
comes with Node.js
No matter what approach you use to install Node.js, npm will always come with it.
Open your terminal and type the command below to get your npm version.
npm -v
Click on this click and the npm
version should be mentioned under the title Downloads.
You must ensure that the npm version and node version should match with what is mentioned on this official page.
This course uses v4.0.0 of Material-UI library
We are using react
>=16.8.0 and react-dom
>= 16.8.0 at all times. All the dependecies needed to run this project will be available in package.json
file. You do not have to worry about finding the peer dependencies to run the project.
All you need are the 2 following commands to get started as long as you have the right version of Node.
npm install
npm start
Alternatively, you can also use yarn
command.
yarn install
yarn start
No, You don’t need to install or configure tools. You just need the LTS version of Node.js and the npm version that comes with it. They are preconfigured and hidden so that you can focus on the code.
We shall be using the latest version of Chrome as of today. Be sure to install/update Chrome on your computer.
- To open Chrome in Mobile view mode using Mac, press
Command+Option+i
To run the app in the development mode, Open http://localhost:3000 to view it in the browser. We are using Chrome Developer console in this course.
Your server is will run at port 5000 and the URL for server APIs is http://localhost:5000.
No, feel free to use simple CSS for styling or any other styling library you like. The focus of this course is to understand the use of JSON Web Token to secure the backend APIs and the front end styling is just an extra beautification layer.
Install Postman on your machine and start creating the collections where you can keep track of the API end points currently under testing. They have extensive documentation on how to use the tool. in case your are interested.
Install bcrypt
from npm
using the commands below.
Note that node-gyp
should be installed globally for the most recent Operating System on Mac which is Catalina.
npm install -g node-gyp
npm install --save bcrypt
Below are the credentials you may want to use when logging to the app as member or admin.
Member
deeksha30
kdje89#$%
Admin
zenmade23
728193kfej**(
Go inside the server/
directory and run teh command below.
node server.js
Note: Make sure you restart your server each time you checkout a new branch for every module and for every code change in the server side code.
Checkout the branches listed below as you progress through different modules.
module02_jwt_security
module03_jwt_security
There are 2 git branches used in this module.
To send JWT in a Cookie, checkout module04_jwt_security_cookies
To send JWT in Auth Header Bearer Token, checkout module04_jwt_security_bearer_token
Below are the contents of variables.env
file.
SECRET=")x2f-l-opsnd)w!!z2m7ykvony99pt@6@6m+=q2uk3%w8*7$ow"
ALGORITHM="HS256"
ISSUER="BOOKIE_ORG"
EXPIRY="1h"
module05_jwt_security_bearer_token_client
- Proxying API Requests in React Development
- JWT Debugger
- RFC 7519 - JSON Web Token (JWT) - IETF Tools
- Using HTTP cookies
- Decode JWT on the client using with jwt-decode
- GitHub code samples for usage of JWT by Auth0
Below are some good questions and answers by the community on StackOverflow.