Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saka015/role-based-auth-vr
https://github.com/saka015/role-based-auth-vr
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/saka015/role-based-auth-vr
- Owner: saka015
- Created: 2024-11-19T15:38:32.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-19T19:34:30.000Z (about 1 month ago)
- Last Synced: 2024-11-19T20:28:58.978Z (about 1 month ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Role-Based Authentication System
## Overview
This project is a full-stack application providing secure user management with role-based access control (RBAC). It allows for user registration, login, and the management of users and roles by authorized administrators.
## .env configuration - Backend
- MONGO_URI=
- JWT_SECRET=
- SESSION_SECRET=### mailer data
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=465
- SMTP_SERVICE=gmail
- SMTP_MAIL={put your gmail here}
- SMTP_PASSWORD={password you get from 'application password' from google account section}## Features
### Authentication
- User registration with email verification (optional).
- Secure login with password hashing (bcrypt).
- Password reset functionality via email.
- JWT (JSON Web Tokens) for secure session management.### User Management
- CRUD (Create, Read, Update, Delete) operations for users.
- User profile management (update personal information).
- Role assignment to users.### Role & Permission Management
- CRUD operations for roles.
- Define permissions associated with each role.
- Granular control over access to specific features based on assigned permissions.### Admin Panel
- Dedicated admin interface for managing users and roles.
- Comprehensive logging of user actions (audit trail).
- Send Emails to new users## Technologies Used
### Frontend
- React.js
- Vite (build tool)
- React Router DOM for navigation
- Ant Design for UI components
- Axios for API calls
- SweetAlert2 for user alerts### Backend
- Node.js with Express.js framework
- MongoDB (database)
- Mongoose (MongoDB ODM)
- bcrypt (password hashing)
- jsonwebtoken (JWT)
- multer (file uploads - if applicable)
- nodemailer (email sending - if applicable)
- body-parser (for parsing request bodies)
- cors (for handling Cross-Origin Resource Sharing)
- dotenv (for environment variables)
- express-validator (input validation)## Setup
### Prerequisites
- Node.js and npm (or yarn) installed.
- MongoDB instance running (or configured for connection).### Installation
1. **Clone the repository:**
```
git clone
Use code with caution.
Markdown
Navigate to the client directory:
```## frontend
cd client
### Install client-side dependencies:
npm install
## Navigate to the server directory:
cd ../server
### Install server-side dependencies:
npm install
# Start the development servers:
Backend: nodemon index.js (or npm run start if you have a start script)
Frontend: npm run dev