Debugging
API requests
The API client logs normal request/response details only when import.meta.env.MODE === 'development' and the API module containing logging interceptors is initialized. The logged request object includes method, URL, data, and params; avoid using real sensitive inputs while debugging.
The shared client logs token refresh activity and service methods commonly log caught failures to the browser console. Never copy tokens, passwords, or production credentials into issue reports or documentation.
front/src/services/api/api.ts also exports an apiErrorHandler helper that classifies network, timeout, 401/403, 5xx, and other 4xx errors and provides user-facing messages. No active page/service call site for that helper was found in the source search, so it should not be assumed to be the global error policy.
UI failures
- Check the page's explicit loading/error state and retry behavior.
- Some service methods convert failures to empty arrays,
null,false, or zero-valued summaries; distinguish these fallbacks from genuine empty backend data. - Other service methods rethrow and depend on their caller to render feedback.
Build and tests
cd front
npm run lint
npm run test
npm run buildInspect TypeScript test failures and compare calculation behavior to existing cases before updating expected results.
Source locations
- Axios interceptors:
front/src/services/api/client.ts - Development logging utilities:
front/src/services/api/api.ts - Frontend environment configuration:
front/src/config/environment.ts - Calculation tests:
front/src/utils/__tests__/calculations.test.ts