feat: implement API client module for frontend

- Create TypeScript interfaces (Role, RoleWithVoice, RolesResponse, GenerateRequest)
- Implement detectRoles() function for role detection
- Implement generateAudiobook() function for audio generation
- Implement checkHealth() function for backend health checks
- Add comprehensive error handling for network failures
- Use VITE_API_BASE_URL environment variable for configuration
- Add ApiError class for structured error handling

Requirements: 9.6, 9.7
This commit is contained in:
2025-12-09 01:31:01 +00:00
parent 1f759c36dc
commit 50d657f501
2 changed files with 212 additions and 1 deletions

View File

@@ -137,7 +137,7 @@
- Configure environment variables (.env file with VITE_API_BASE_URL)
- _Requirements: 9.6, 12.3_
- [ ] 8. Implement API client module
- [x] 8. Implement API client module
- Create src/api/tts.ts with TypeScript interfaces (Role, RoleWithVoice, RolesResponse, GenerateRequest)
- Implement detectRoles() function
- Implement generateAudiobook() function