Feature/admin dashboard user management analytics#230
Conversation
|
@Madhavi1108 is attempting to deploy a commit to the Bhuvansh's projects Team on Vercel. A member of the Team first needs to authorize it. |
BHUVANSH855
left a comment
There was a problem hiding this comment.
-
adminRoutes.jsimports and usesauthorizeRoles("admin"), but the provided auth middleware only exportsauthMiddleware. This will cause route registration/runtime errors unlessauthorizeRolesis implemented and exported. -
admin.service.jsdoes not verifyaffectedRowsafter user status updates. Updating a non-existent user can still return success. -
frontend/scripts/admin.jsdepends onAppUtils.debounce(...). Please verify thatdebounceexists inAppUtils; otherwise this will throwTypeError: AppUtils.debounce is not a functionand break the user management page. -
Please move SQL files into a dedicated backend SQL/database folder (e.g.
backend/sql/orbackend/database/) instead of placing schema files insidebackend/scripts/. Database schemas and migration files should be separated from application scripts for better project organization and maintainability.
…oard-user-management-analytics
|
Hi @BHUVANSH855 , |
BHUVANSH855
left a comment
There was a problem hiding this comment.
-
In
backend/routes/adminRoutes.js,authorizeRolesis imported fromauthMiddleware, butauthMiddleware.jsonly exports the authentication middleware. Please importauthorizeRolesfromrbacMiddleware.jsinstead, otherwise the admin routes will fail at runtime. -
In
frontend/scripts/admin.js,AppUtils.getToken()is used, but nogetToken()helper is defined/exported inutils.jsand this PR does not add one. This may cause the admin page to fail during initialization.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Hi @BHUVANSH855 , |
Kindly solve merge time conflicts |
|
Hi @BHUVANSH855 , |
Description
This PR introduces a comprehensive Admin Dashboard featuring real-time analytics, user management, and administrative audit logging. The implementation provides administrators with centralized visibility into platform activity while enabling secure user administration through protected backend APIs and an interactive frontend interface.
The solution combines dashboard analytics, server-side pagination, search and filtering, bulk user operations, Chart.js visualizations, and audit logging to deliver a scalable and production-ready administration system.
Closes #189
Type of Change
Checklist
What Was Implemented
Administrative Audit Logging
Introduced a dedicated audit logging mechanism for tracking administrator actions performed through the dashboard.
New Database Script
backend/scripts/admin_dashboard_schema.sqlThe schema creates a new table:
user_audit_logsEach audit record stores:
This provides complete traceability for administrative user management actions such as blocking and unblocking accounts.
Backend Administration Service
Implemented a dedicated service layer responsible for dashboard analytics and user management operations.
New Service
backend/services/admin.service.jsThe service handles:
Business logic remains centralized and reusable across controller endpoints.
Administrative API Endpoints
Added secure backend APIs to power the administration interface.
Dashboard Analytics
The endpoint provides aggregated platform metrics including:
User Management
Supports:
User Status Updates
Allows administrators to:
Bulk User Operations
Enables batch processing for:
Authorization and Access Control
Protected all administration endpoints using the existing authentication and role-based authorization middleware.
Access is restricted through:
authMiddlewareauthorizeRoles("admin")Regular users cannot access administrative resources or management operations.
Frontend Dashboard Integration
Extended the administration interface with a modular dashboard experience.
Updated View
admin.htmlEnhancements include:
data-taborganizationSections switch dynamically without requiring full page reloads.
Analytics Visualization
Integrated Chart.js to provide graphical representations of platform metrics.
Dashboard visualizations include:
The charts present aggregated backend data in an interactive and easily understandable format.
User Management Interface
Added a comprehensive user administration panel within the dashboard.
Features include:
The interface is designed to efficiently manage large user bases.
Client-Side Dashboard Logic
Implemented frontend controller logic responsible for rendering dashboard analytics.
Updated Script
scripts/admin.jsThe implementation:
User Management Client Logic
Implemented dynamic client-side functionality for administrative user operations.
Capabilities include:
The interface remains responsive while minimizing unnecessary server requests.
Modular Dashboard Navigation
Organized the administration interface into independently accessible sections.
Available modules include:
Navigation occurs seamlessly without full-page refreshes, creating a smoother administrative experience.
Benefits
Acceptance Criteria
Technical Notes