Skip to content

[FE-15] Build /dashboard page — stats cards, recent documents table, risk distribution chart #827

Description

@mftee

Overview

The dashboard is the central landing page after login. It should give users an at-a-glance view of their document portfolio health, recent activity, and any outstanding actions (documents needing verification, documents with high risk scores).

Background

File to create: frontend/app/(protected)/dashboard/page.tsx

Content sections:

Stats row (top):

  • Total documents uploaded
  • Average risk score (colour-coded: green ≤ 30, yellow 31–60, red > 60)
  • Documents pending verification
  • Verified documents count

Risk distribution chart:

  • A horizontal bar chart showing distribution of documents across PENDING / VERIFIED / FLAGGED / REJECTED statuses
  • Use a lightweight charting library (Recharts, already installed, or Chart.js)

Recent documents table:

  • Latest 5–10 documents with: name, status badge, risk score, uploaded date, quick-action link to detail page
  • "View all" link to /documents

Action items card:

  • List of documents with FLAGGED status that have not been reviewed (link to their detail page)

Acceptance Criteria

  • Stats fetched from GET /api/documents (calculate counts/averages client-side or use GET /api/admin/stats if available)
  • Risk distribution chart renders correctly with real data
  • Recent documents table is sortable by date
  • Empty state shown when user has no documents (with CTA to upload)
  • Dashboard refreshes automatically when a WebSocket documentStatus event is received (FE-06)

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

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