[P2] Add React Query (TanStack Query) for server state management #99

Open
opened 2026-07-07 16:21:59 +12:00 by fastie81 · 0 comments
Owner

Problem

Frontend uses Axios + React Context only - no caching, deduplication, or background refetching.

Expected Behavior

  • Install @tanstack/react-query
  • Wrap app with QueryClientProvider
  • Replace manual useEffect + axios calls with useQuery/useMutation
  • Add stale-while-revalidate caching
  • Automatic refetch on window focus

Benefits

  • Eliminate duplicate requests
  • Background updates
  • Optimistic updates for mutations
  • Devtools for debugging
  • frontend/src/api/ (axios client)
  • frontend/src/contexts/ (AuthContext, ClubContext)
  • frontend/src/pages/ (all data-fetching components)
  • frontend/package.json
### Problem Frontend uses Axios + React Context only - no caching, deduplication, or background refetching. ### Expected Behavior - Install `@tanstack/react-query` - Wrap app with `QueryClientProvider` - Replace manual `useEffect` + axios calls with `useQuery`/`useMutation` - Add stale-while-revalidate caching - Automatic refetch on window focus ### Benefits - Eliminate duplicate requests - Background updates - Optimistic updates for mutations - Devtools for debugging ### Related Files - `frontend/src/api/` (axios client) - `frontend/src/contexts/` (AuthContext, ClubContext) - `frontend/src/pages/` (all data-fetching components) - `frontend/package.json`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
fastie81/honbu-manager#99
No description provided.