- Registration Form that creates new user in mongodb database (via api to backend)
- Login Form (authentication)
- Protected Routes (with react-router-v6) that are dependent on logged user roles (for example only user with admin role can view admin component)
- Providing secure access to protected resources (Users component in this exact example) using JSON Web Tokens.
- Fetching data with axios interceptors
- Persistent user login (remember this device functionality - user being logged out after refresh token expires)
- Form and toggle input saved in local storage (custom hooks)
goal of this project is to create good practices, react, authentication code reference that can be used in future projects.
Vite.+.React.+.TS.-.5.March.2023.mp4
-
clone this repo url
-
npm install npm run dev
-
clone this repo
-
create .env file in root folder with
DATABASE_URI = "<your mongodb connection link>" ACCESS_TOKEN_SECRET= <token>
-
npm install npm start // (server should start on localhost:3500 and thats the url we are fetching in our client aplication)
Project was created during React Login, Registration and Authentication Course ❤️