This project is a refactoring of the full-stack-project created for the Full-stack Nano Degree. The original project found in the previous link, was built using Angular.
This project was bootstrapped with Create React App.
This frontend is part of a full-stack project (see here). You will need to either setup a backend api or use the one provided in the previous link.
In the project directory, you can run:
yarn start
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
-
yarn test
-
yarn build
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
This project depends on Nodejs and Node Package Manager (NPM). Before continuing, you must download and install Node (the download includes NPM) from https://nodejs.com/en/download.
This project uses NPM to manage software dependencies. NPM Relies on the package.json file located in the root
directory of this repository. After cloning, open your terminal and run:
npm install
tip: npm i is shorthand for npm install
The authentication system used for this project is Auth0. ./src/services/isAuthorized.js
contains the logic to check if the user is authorized to perform CRUD operations. After logging in through Auth0, the application manages the JWT token upon successful callback. This token is then consumed by our DrinkService (./src/services/apiService.js
) and passed as an Authorization header when making requests to our backend.
The Auth0 JWT includes claims for permissions based on the user's role within the Auth0 system. This project makes use of these claims using the token.contains('permission')
which checks if particular permissions exist within the JWT permissions claim of the currently logged in user. This logic is defined in ./src/services/isAuthorized.js
and is then used to enable and disable buttons, form submissions, and perform CRUD operations in the /lattes
route.
Henry Valbuena