Skip to content

feat: add sync statistics to dashboard #5

@furch-services

Description

@furch-services

What problem does this solve?

The dashboard shows only the outcome of the most recent sync. There is no visibility into trends — whether errors are increasing, how many documents are being synced per week, or whether the scheduler is running reliably over time.

Proposed solution

Add a statistics section to the dashboard with a 14-day activity chart and aggregate counters. Data is served from a new /api/stats endpoint and rendered with Chart.js via CDN.

  • Bar chart: daily upload count for the last 14 days
  • Stat cards: total uploaded (all-time), total skipped, total errors, permanently failed
  • /api/stats returns JSON, derived from existing sync_log data — no new tables
  • Chart updates without full reload via HTMX (depends on feat/htmx-ui)

Acceptance criteria:

  • /api/stats endpoint returns daily counts for the last 14 days
  • Chart.js bar chart rendered from that data (CDN, no build step)
  • Aggregate stat cards displayed on the dashboard
  • Chart is responsive on narrow viewports
  • No additional database tables required

Alternatives considered

Server-side SVG chart generation (without Chart.js) was considered to avoid any JS dependency, but Chart.js via CDN is a single script tag with no build step and produces much better output.

Architecture fit

  • Does not require Redis, RabbitMQ, Celery, PostgreSQL, React, Vue, or Node.js
  • Runs inside the single application container (no separate worker or sidecar)

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions