Files
audiobook/frontend
Paul Bailey 50d657f501 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
2025-12-09 01:31:01 +00:00
..

Text to Audiobook Frontend

React TypeScript frontend for the Text to Audiobook application.

Setup

Prerequisites

  • Node.js 20.19+ or 22.12+
  • npm or yarn

Installation

  1. Install dependencies:
npm install
  1. Create environment file:
cp .env.example .env
  1. Update .env with your backend URL (default: http://localhost:8000)

Development

Start the development server:

npm run dev

The application will be available at http://localhost:5173

Build

Build for production:

npm run build

Preview production build:

npm run preview

Project Structure

src/
├── api/          # API client modules
├── components/   # React components
├── App.tsx       # Main application component
├── main.tsx      # Application entry point
└── index.css     # Global styles (Tailwind)

Environment Variables