🚀 Quick Start: The system automatically creates dummy data (roles, permissions, and users) when the server starts if the database is empty. No manual setup required!
Admin
- Email:
[email protected]
- Password:
admin
- Permissions: Can read, write, and delete.
Dev
- Email:
[email protected]
- Password:
dev
- Permissions: Can read and write.
Viewer
- Email:
[email protected]
- Password:
viewer
- Permissions: Can only read.
This component allows the admin to view, add, edit, or remove users.
Functionality
- Add new user to the list
- Edit exisiting user details
- Delete user from the list
User Model
const UserModel = {
name: String,
email: { type: String, unique: true },
role: String,
permissions: [String],
provider: String, //where did the user data come from
// password: { // Password field not required as it is being handled by passport-local-mongoose
// type: String,
// required: true
// },
data: Schema.Types.Mixed
}
API Endpoint
Method: GET
Description: Retrieves a list of all users in the system.
Method: POST
Description: Adds a new user to the system with specified details.
Method: PUT
Description: Updates the details of an existing user based on their email.
Method: DELETE
Description: Deletes a user from the system based on their email.
Method: GET
Description: Retrieves the details of the currently authenticated user.

Allows defining and managing roles with varying permissions, including viewing, adding, editing, or removing roles.
Functionality
- Add new role to the list
- Edit exisiting role details
- Delete user role the list
Role Model
const RoleModel = {
name: String, // Unique role name
description: String, // Description of the role
permissions: [String] // List of permissions assigned to the role
};
API Endpoint
Method: GET
Description: Retrieves a list of all roles in the system.
Method: POST
Description: Adds a new role to the system with specified details.
Method: PUT
Description: Updates the details of an existing role based on its name.
Method: DELETE
Description: Deletes a role from the system based on its name.

Displays the user's profile information, including personal details and settings.
Allows the admin to assign or revoke permissions and to view, add, edit, or remove roles.
Functionality
- Add new permissions to the list
- Edit exisiting permissions
- Delete permission from the list
Permission Model
const PermissionModel = {
name: String, // Unique permission name
description: String // Description of the permission
};
API Endpoint
Method: GET
Description: Retrieves a list of all permissions in the system.
Method: POST
Description: Adds a new permission to the system with specified details.
Method: PUT
Description: Updates the details of an existing permission based on its name.
Method: DELETE
Description: Deletes a permission from the system based on its name.

Displays logs to track user actions and maintain system accountability.
Functionality
- View logs of change in admin panel
- store any edit, add and delete changes made to admin Control Panel
Log Model
const LogModel = {
name: String, // User's name
email: String, // User's email
role: String, // User's role
timestamp: String, // Timestamp of the action
action: String // Description of the action performed
};
API Endpoint
Method: GET
Description: Retrieves a list of all logs for auditing purposes.

Provides a summary of the system's current state, including user statistics and role assignments.
The application automatically seeds the database with dummy data when the server starts if the collections are empty:
- read: Permission to view and read data
- write: Permission to create and edit data
- delete: Permission to delete data
- Admin: Full access with read, write, and delete permissions
- Dev: Developer access with read and write permissions
- Viewer: View-only access with read permission
Three test users are automatically created with the credentials listed above. This allows you to:
- Start testing immediately without manual setup
- Understand the RBAC system with pre-configured examples
- Sign up new users with existing roles and permissions
Note: The seeding only happens once when collections are empty. Existing data is never overwritten.