You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Configure API service layer with Axios, interceptors, and error handling #17
Set up a robust HTTP client layer to standardize calls to apps/api and error behavior.
Scope correction: apps/api has no auth awareness (no endpoint currently requires a token — see docs/architecture-decisions.md). This layer does not inject any auth header. Session/token handling for Firebase-backed features is entirely delegated to the Firebase SDK (see #65), never routed through this Axios layer.
Centralized Axios instance for all apps/api calls. Auth token comes from Firebase SDK and is attached via an interceptor — no login or refresh routes exist in apps/api. All feature work is built against a typed mock layer until backend integration in week 7.
Mocked endpoints to define
GET
/v1/zones/at-risk?bbox=&limit=&offset=
map + risk list
GET
/v1/zones/{zone_id}?from=&to=
detail + history
GET
/v1/dashboard/kpis?bbox=&period=
dashboard
GET
/v1/zones/compare?zone_ids=&indicators=&period=
analysis
POST
/v1/zones/export/pdf
export
✅ Acceptance Criteria
Axios instance is centralized.
Response interceptor handles common API error formats.
Error normalization strategy is documented.
Axios instance reads base URL from VITE_API_URL
Request interceptor attaches Firebase JWT (getIdToken()) to every request
The detail page design shows NDVI (0.61), Humidité des sols, Artificialisation, and named species (Grande Alose, Vison d'Europe with IUCN status). These come from score-breakdown (V3, unconfirmed in Notion) and species_features_by_zone — neither is in the confirmed MVP API. For the 6-week draft, build VS-14 with the confirmed data (score + 5 sub-scores + history) and add placeholder cards for "Indices satellite" and "Biodiversité" marked as coming from a future endpoint.
Activity
CherryClairette commentedon Oct 4, 2026
One design gap to flag now (not blocking):
The detail page design shows NDVI (0.61), Humidité des sols, Artificialisation, and named species (Grande Alose, Vison d'Europe with IUCN status). These come from score-breakdown (V3, unconfirmed in Notion) and species_features_by_zone — neither is in the confirmed MVP API. For the 6-week draft, build VS-14 with the confirmed data (score + 5 sub-scores + history) and add placeholder cards for "Indices satellite" and "Biodiversité" marked as coming from a future endpoint.