This is a simple UI for managing user roles and permissions in a system. It is built using React and shadcn.
- Clone the repository
- Run
npm install --legacy-peer-deps(used --legacy-peer-deps as most libraries do not support React 19 as of yet) to install the dependencies. - Run
npm run devto start the development server.
- Home Page: Simple landing page with a login option.
- Login Page: Login page with a form to enter email and password.
- Dashboard Page: The main dashboard page which shows the overview of the roles and users in the system.
- Users Page: A page to manage users in the system. You can add, edit and delete users. Has options to add users from a CSV file. Also, lets you filter users based on roles and status.(Accessible to only admin and editor role)
- Permissions Page: Lets you manage permissions. You can add permissions based on roles or assign permissions to users directly. (Accessible to only admin role)
- /api/login: Mock API for login. Accepts email and password and returns user details.
- /api/all-users: Mock API for getting list of all users.
- /api/update-user: Mock API for updating user info. If user is not found, it creates a new user.
- /api/upload-csv: Mock API for uploading a CSV file to add users.
- /api/permissions: Mock API for getting permissions.
- /api/get-numbers: Mock API for getting the number of users by roles, status and permissions in the system.
- React: Frontend library for building user interfaces.
- Nextjs: React framework for building server-side rendered applications.
- Shadcn: A simple UI library for React.
- Next Serverless Functions: Used for creatign mock API requests.
- Admin:
- Email: admin@email.com
- Password: admin
- Editor:
- Email: editor1@email.com
- Password: editor1
- User:
- Email: user1@email.com
- Password: user1