Tarsier LabsTarsier Labs
🐡
Home
Categories
Tags
Bookmarks
About
Back to tags

HTTP Client

0 articles

API Client Layer: 30+ Typed Module Pattern

API Client Layer: 30+ Typed Module Pattern

The admin dashboard communicates with the NestJS backend through a typed API client layer defined in `api/index.ts` (1,145 lines), exporting 19 API modules. It utilizes a shared HTTP client and centralized type definitions to form a three-file API layer covering 30+ backend endpoints.

00
Management Backend
HttpClient β€” 401 Auto Refresh + Request Deduplication + Exponential Backoff Retry

HttpClient β€” 401 Auto Refresh + Request Deduplication + Exponential Backoff Retry

The admin panel's HttpClient wraps Axios with declarative features: single-flight token refresh, request deduplication (GET + non-GET), exponential backoff retry (max 3), business code validation, and Sentry tracing β€” all in one 519-line class.

00
Management Backend