Skip to content

feat: add admin activity log viewer with filters and pagination #8

Description

@Jidnyasa-P

Description

The backend already records user login activity in the ActivityLog collection, but administrators currently have no frontend interface to view or investigate these records.

Add an Activity Logs section to the admin dashboard where administrators can inspect recent account activity without directly accessing MongoDB.

Proposed Features

  • Add a new Activity Logs tab or section to the admin dashboard.

  • Display activity records in a responsive table.

  • Show:

    • User name or email
    • User role
    • Activity type
    • Login timestamp
    • IP address, when available
    • User agent or device information, when available
  • Add filtering by:

    • User email
    • Role
    • Activity type
    • Date range
  • Add newest/oldest sorting.

  • Add pagination or a “Load more” option.

  • Show loading, empty, and error states.

  • Restrict the endpoint and page to administrators.

  • Avoid exposing sensitive authentication data.

Backend Work

  • Add or verify an admin-only endpoint for retrieving activity logs.

  • Support query parameters such as:

    • page
    • limit
    • role
    • activity
    • startDate
    • endDate
    • search
  • Return pagination metadata.

  • Validate query values.

  • Ensure the admin authentication middleware protects the route.

Frontend Work

  • Add an ActivityLogs admin component.
  • Add a navigation entry in the admin dashboard.
  • Create responsive desktop and mobile views.
  • Add filters with a clear/reset action.
  • Add readable date formatting.
  • Add loading skeletons and an empty state.

Acceptance Criteria

  • Only administrators can access activity logs.
  • Activity records are loaded from the backend.
  • Records can be filtered by user, role, activity, and date.
  • Results can be sorted by time.
  • Large result sets are paginated.
  • Loading, empty, and error states are implemented.
  • Sensitive tokens, passwords, and credentials are never displayed.
  • The interface works on mobile and desktop.
  • Existing admin functionality remains unchanged.

@udaycodespace Kindly assign me this issue under ECSOC26

Metadata

Metadata

Assignees

Labels

ECSoC26Required label for a PR to be eligible for Sentinel scoringenhancementNew feature or improvement request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions