Skip to content

[FE-54] Build Audit Log viewer — searchable, filterable timeline of all system changes #1042

Description

@yusuftomilola

Overview

Admins need visibility into every change made across the system — who did what and when. The backend audit log endpoint (BE-67) provides this data. This issue builds the frontend viewer with search, filters, and a human-readable diff display.

Context

  • Route: frontend/app/(dashboard)/audit-log/page.tsx (needs to be created)
  • API endpoint: GET /audit-logs with query params: entityType, actorId, action, from, to, page, limit
  • Visible to ADMIN users only — gate the page with a role check in middleware or the component
  • Add "Audit Log" to the sidebar under Settings/Admin section

Acceptance Criteria

  • Create frontend/app/(dashboard)/audit-log/page.tsx (ADMIN only)
  • Timeline/table view with columns: Timestamp, Actor (name + avatar), Entity Type, Entity ID (linked to the relevant detail page), Action (coloured badge: green=CREATED, blue=UPDATED, red=DELETED), summary of change
  • Filter bar: entity type dropdown, action dropdown, actor user selector, date range picker (from/to)
  • Search input to filter by entity ID or actor name
  • Clicking a row expands a diff view showing previous and new JSON values side-by-side (highlight changed fields)
  • Pagination with "Load More" or numbered pages
  • Create React Query hook: useAuditLogs(filters)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions