https://mern-auth-roles.onrender.com
MERN-auth-roles a full-stack MERN (MongoDB Express React Node) boilerplate starter application with React, Recoil, authentication, roles, JWT, protected api
We have two parts in the application
✓ User with roles (Admin, Manager, user)
✓ NodeJS server
✓ Token and refresh token
✓ async/await syntax
✓ Server side validation
✓ .env file configuration
✓ Profile image upload with Multer (delete old image and replace it with the new image),
✓ Cross-origin resource sharing (CORS)
✓ Limit repeated requests such as password reset.
✓ Cookies
✓ Password Hashing
✓ Real-time notifications using Socket.io
run this command
cd backend
npm install
npm run dev
✓ React DevTools desabled in production
✓ Axios with Interceptors to manage fetchs
✓ Token persist only in memory and cookies
✓ Refresh Token (in memory) and access token (in cookies)
✓ Hookform: to manage form inputs
✓ YUP: to validate inputs
✓ react-multi-select-component
✓ Recoil and Recoil-persist: to manage states
✓ react-icons and @uiball/loaders to give a nice look to the UI
✓ Protected routes with Higher order components
✓ Layout component, it will be very easy to navigation and footer
✓ Profile image upload
✓ Real-time notifications using Socket.io client
you can run the code by executing this command
cd frontend
npm install
npm start