Install @tanstack/react-query, create a fetch-based API client with typed functions for all endpoints, and add query/mutation hooks for games, pokemon, runs, and encounters. Includes Vite dev proxy for /api and QueryClientProvider setup. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.1 KiB
1.1 KiB
title, status, type, priority, created_at, updated_at, parent, blocking
| title | status | type | priority | created_at | updated_at | parent | blocking | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Frontend API Integration | completed | task | normal | 2026-02-04T15:44:42Z | 2026-02-05T13:55:52Z | nuzlocke-tracker-f5ob |
|
Implement frontend services to communicate with the backend API.
Checklist
- Create API client/service layer
- Implement API calls for:
- Fetch available games
- Fetch routes for a game
- Fetch Pokémon data
- Create/update/delete Nuzlocke runs
- Create/update encounters
- Update Pokémon status
- Add loading states and error handling
- Add retry logic for failed requests
Technical Notes
- Using native
fetchviasrc/api/client.tswrapper - Using TanStack Query for caching, loading states, and retry
- All API responses typed with TypeScript
- Vite dev proxy configured for
/api→ backend - Query hooks in
src/hooks/for each domain (games, pokemon, runs, encounters) - Mutations auto-invalidate relevant query caches