Skip to content

web: build a full analytics dashboard page at /devcard/analytics #28

@ShantKhatri

Description

@ShantKhatri

Summary

Product doc section 5.5 specifies an Analytics Dashboard. Implement the web frontend for card owners to view their card view counts and platform link click counts.

Context

The backend analytics routes in apps/backend/src/routes/analytics.ts already exist. The web app (apps/web) lacks a dedicated analytics UI. The route should live at apps/web/src/routes/devcard/ since the existing devcard directory is structurally appropriate for authenticated sections.

Tasks

  • create apps/web/src/routes/devcard/analytics/+page.svelte.
  • add a +page.server.ts loader that fetches analytics data from the backend API using session cookie.
  • render a summary section: total views (all time), total link clicks, most-clicked platform.
  • render a line or bar chart for daily views over 30 days using a lightweight charting lib (e.g. Chart.js via svelte-chartjs or native SVG).
  • render a ranked list of platform clicks (GitHub N times, LinkedIn N times, etc.).
  • add a 'Download CSV' button wired to the export endpoint.
  • handle empty state when user has no data yet.
  • ensure the page is only accessible to authenticated users (redirect to / otherwise).

Acceptance Criteria

  • page loads and shows data from backend.
  • chart renders correctly and is responsive.
  • empty state is handled gracefully.
  • unauthenticated access redirects to home.

Difficulty

medium-advanced — requires full-stack integration: SvelteKit server loaders, API calls, charting, and auth guard.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions