https://github.com/bezkoder/react-typescript-authentication-example
React Typescript JWT authentication and authorization example with Hooks, React router, Axios - Role based authentication example
https://github.com/bezkoder/react-typescript-authentication-example
authentication authorization axios hooks login react react-hooks react-router react-typescript registration token-authorization token-based-authentication typescript
Last synced: 15 days ago
JSON representation
React Typescript JWT authentication and authorization example with Hooks, React router, Axios - Role based authentication example
- Host: GitHub
- URL: https://github.com/bezkoder/react-typescript-authentication-example
- Owner: bezkoder
- Created: 2021-10-09T05:01:20.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-30T03:26:39.000Z (over 2 years ago)
- Last Synced: 2025-03-28T10:47:35.647Z (about 1 month ago)
- Topics: authentication, authorization, axios, hooks, login, react, react-hooks, react-router, react-typescript, registration, token-authorization, token-based-authentication, typescript
- Language: TypeScript
- Homepage:
- Size: 584 KB
- Stars: 81
- Watchers: 2
- Forks: 31
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Typescript Authentication example with Hooks, Axios and Rest API
Build React Typescript Authentication and Authorization example using React Hooks, React Router, Axios and Bootstrap (without Redux):
- JWT Authentication Flow for User Signup & User Login
- Project Structure for React Typescript Authentication (without Redux) with React Router & Axios
- Creating React Components with Form Validation using Formik and Yup
- React Typescript Components for accessing protected Resources (Authorization)
- Dynamic Navigation Bar in React Typescript AppFor instruction, please visit:
> [React Typescript Authentication example with Hooks, Axios and Rest API](https://www.bezkoder.com/react-typescript-authentication-example/)Signup Page:

Form Validation:

Login Page:

Profile Page:

This React Client works well with following back-end Server:
> [Spring Boot: JWT Authentication & Authorization with MySQL](https://www.bezkoder.com/spring-boot-jwt-authentication/)> [Spring Boot: JWT Authentication & Authorization with PostgreSQL](https://www.bezkoder.com/spring-boot-security-postgresql-jwt-authentication/)
> [Spring Boot: JWT Authentication & Authorization with MongoDB](https://www.bezkoder.com/spring-boot-jwt-auth-mongodb/)
> [Node Express: JWT Authentication & Authorization with MySQL](https://www.bezkoder.com/node-js-jwt-authentication-mysql/)
> [Node Express: JWT Authentication & Authorization with PostgreSQL](https://www.bezkoder.com/node-js-jwt-authentication-postgresql/)
> [Node Express: WT Authentication & Authorization with MongoDB](https://www.bezkoder.com/node-js-mongodb-auth-jwt/)
Related Posts:
> [React Hooks Typescript example Project with Axios and Web API](https://www.bezkoder.com/react-typescript-api-call/)> [React (Javascript) CRUD example to consume Web API](https://www.bezkoder.com/react-crud-web-api/)
> [React Redux CRUD App example with Rest API](https://www.bezkoder.com/react-redux-crud-example/)
> [React (Hooks) CRUD example to consume Web API](https://www.bezkoder.com/react-hooks-crud-axios-api/)
> [React Table example: CRUD App with react-table v7](https://www.bezkoder.com/react-table-example-hooks-crud/)
Using Material UI instead of Bootstrap:
> [React Material UI examples with a CRUD Application](https://www.bezkoder.com/react-material-ui-examples-crud/)More Practice:
> [React Pagination example](https://www.bezkoder.com/react-pagination-material-ui/)> [React File Upload example](https://www.bezkoder.com/react-file-upload-axios/)
> [React JWT Authentication & Authorization example](https://www.bezkoder.com/react-jwt-auth/)
> [React + Redux: JWT Authentication & Authorization example](https://www.bezkoder.com/react-redux-jwt-auth/)
Fullstack with Node Express:
> [React + Node Express + MySQL](https://www.bezkoder.com/react-node-express-mysql/)> [React + Node Express + PostgreSQL](https://www.bezkoder.com/react-node-express-postgresql/)
> [React + Node Express + MongoDB](https://www.bezkoder.com/react-node-express-mongodb-mern-stack/)
Fullstack with Spring Boot:
> [React + Spring Boot + MySQL](https://www.bezkoder.com/react-spring-boot-crud/)> [React + Spring Boot + PostgreSQL](https://www.bezkoder.com/spring-boot-react-postgresql/)
> [React + Spring Boot + MongoDB](https://www.bezkoder.com/react-spring-boot-mongodb/)
Fullstack with Django:
> [React + Django Rest Framework](https://www.bezkoder.com/django-react-axios-rest-framework/)
Serverless:
> [React Firebase CRUD App with Realtime Database](https://www.bezkoder.com/react-firebase-crud/)> [React Firestore CRUD App example | Firebase Cloud Firestore](https://www.bezkoder.com/react-firestore-crud/)
Integration (run back-end & front-end on same server/port)
> [Integrate React with Spring Boot](https://www.bezkoder.com/integrate-reactjs-spring-boot/)> [Integrate React with Node Express](https://www.bezkoder.com/integrate-react-express-same-server-port/)
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
### Set port
.env
```
PORT=8081
```## Project setup
In the project directory, you can run:
```
npm install
# or
yarn install
```or
### Compiles and hot-reloads for development
```
npm start
# or
yarn start
```Open [http://localhost:8081](http://localhost:8081) to view it in the browser.
The page will reload if you make edits.