Skip to content

Add analytics API client (frontend) #571

Description

@phertyameen

Description

Add a typed fetch client wrapping calls to the backend's /analytics/* endpoints, using NEXT_PUBLIC_API_URL the same way other frontend API calls do, with a shared DateRange type mirroring the backend DTO.

Why this matters

Every dashboard widget needs a consistent, typed way to call the analytics API instead of ad-hoc fetch calls scattered across components.

Files to touch

  • frontend/src/lib/analytics/analytics-client.ts

Acceptance Criteria

  • Client exposes one typed function per backend endpoint
  • Errors are surfaced in a consistent shape for components to handle

Notes

This issue is part of the new analytics module effort (tracking, aggregation,
and reporting on player/game activity). Please keep new code inside
backend/src/analytics/ following the same module/controller/service/provider
layout used by existing modules (e.g. progress, streak, quests).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions