Skip to content

A basic web app that demonstrates the creation and use of Java Web Tokens written in Node.JS and React

Notifications You must be signed in to change notification settings

LinuxUser255/JWT_ReactApp

Repository files navigation

Login page: NodeJS React & JWTs

Built With

(back to top)

Overview

  • Set up authentication so that only a request with a JWT can access the dashboard
  • After a user signs up they log in and are given a signed JWT
  • Only registered users should be able to obtain a JWT

(back to top)

How the app works

When logging in, the app looks for the username and password. If both the username and password exist, then it will create a new signed JWT. Otherwise, an error is returned. Upon successful creation of the JWT, the user will be notified.

The main endpoints, and correct URL with correct paths are:

 http://localhost:3000/api/v1/dashboard
 http://localhost:3000/api/v1/login

(back to top)

Getting Started

  1. Check that the package versions in package.json are the most recent
  2. Edit the package.json file accordingly before running the npm install command
  3. Once all that is done, run the following commands
  • Install the packages and Express for API development
 npm install --save express 
  • Install nodemon it's a development package. It auto runs the server.
npm install --save-dev nodemon
  • Edit package.json to make running the server easier. Add this to the package.json file
"start": "nodemon.js"
  • Install a parser to parse incoming request bodies
 npm install --save body-parser

Usage

Run the commands listed above in the console of your IDE, (I used Jet Brains WebStorm). Then open a browser and navigate to http://localhost:3000

For more information, please refer to the WebStorm Documentation

(back to top)

About

A basic web app that demonstrates the creation and use of Java Web Tokens written in Node.JS and React

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published