Service Layer high complexity Shared Component mobile
2
Dependencies
3
Dependents
0
Entities
0
Integrations

Description

Centralized HTTP client for the Flutter mobile app that handles all communication with the Next.js backend. Provides a typed, unified interface for every domain operation and manages authentication headers, base URL configuration, and response deserialization across the entire app.

Feature: REST API Backend

rest-api-client

Responsibilities

  • Send authenticated HTTP requests to /api/v1/... endpoints
  • Attach Bearer token from secure storage to outgoing requests
  • Deserialize JSON envelope responses into typed Dart models
  • Expose domain-scoped API methods for each feature area
  • Manage base URL and environment configuration

Interfaces

get(path, {queryParams})
post(path, body)
put(path, body)
patch(path, body)
delete(path)
setBaseUrl(url)
setAuthToken(token)
clearAuthToken()
handleResponse<T>(response)
buildHeaders()
getAuthenticatedClient()