Skip to content

[FEATURE] Frontend Integration — Connect web UI to real API replacing mock data #263

@gelluisaac

Description

@gelluisaac

Description

Update the web frontend to call the real backend API instead of using in-memory mock data.
This is the final integration step that makes the dashboard fully functional.

Tasks

  • Update web/src/api/loyalty.ts to make real HTTP calls to /api/v1/loyalty/*
  • Update web/src/api/transactions.ts to make real HTTP calls to /api/v1/transactions/*
  • Add API client module web/src/api/client.ts with:
    • Base URL configuration
    • Auth token management (JWT storage, auto-refresh)
    • Error handling and retry logic
    • Request/response type matching lib/types.ts
  • Update FraudDetectionPanel.tsx to fetch from /api/v1/fraud/*
  • Update ModelMonitoringDashboard.tsx to fetch from /api/v1/monitoring/*
  • Add WebSocket client hook useWebSocket.ts for real-time data
  • Handle loading, error, and empty states throughout
  • Add environment variable VITE_API_BASE_URL for configurable API URL
  • Update tests to use mock API responses

Acceptance Criteria

  • All dashboard components render with real data from the API
  • Loading states show appropriate spinners/placeholders
  • Error states show meaningful messages with retry options
  • Authentication flow works (login page to token to API calls)
  • Tests pass with mocked API calls

Labels

enhancement, frontend, integration

Metadata

Metadata

Assignees

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