Problem
The mobile frontend currently performs API requests using repeated raw fetch() calls across multiple screens and contexts.
Authorization headers, request setup, and error handling are manually duplicated in several places such as:
- AuthContext
- CardsScreen
- ConnectPlatformsScreen
- DevCardViewScreen
- other mobile screens
This creates several maintainability and scalability issues:
- duplicated Authorization header logic
- inconsistent API error handling
- no centralized handling for 401/403 responses
- repeated request boilerplate
- difficult future API maintenance
- inconsistent session expiration behavior
Currently, expired or invalid tokens may not be handled globally, which can lead to stale sessions or repeated failed requests across the app.
Suggested Improvement
Introduce a centralized API request abstraction layer for the frontend.
Possible implementation ideas:
- shared fetch wrapper / API client
- centralized Authorization token injection
- global 401/403 handling
- standardized response parsing
- unified error handling strategy
This would improve maintainability, consistency, and future scalability of the mobile frontend networking layer.
Problem
The mobile frontend currently performs API requests using repeated raw
fetch()calls across multiple screens and contexts.Authorization headers, request setup, and error handling are manually duplicated in several places such as:
This creates several maintainability and scalability issues:
Currently, expired or invalid tokens may not be handled globally, which can lead to stale sessions or repeated failed requests across the app.
Suggested Improvement
Introduce a centralized API request abstraction layer for the frontend.
Possible implementation ideas:
This would improve maintainability, consistency, and future scalability of the mobile frontend networking layer.