Cards Content Service
Component Detail
Service Layer
low complexity
mobile
1
Dependencies
1
Dependents
0
Entities
0
Integrations
Description
Handles fetching, versioning, and offline caching of talking card content from the backend. Manages cache invalidation when new card sets are published and serves cards from the local Drift database when the device is offline.
cards-content-service
Responsibilities
- Fetch card sets from backend REST endpoint and store in local Drift database
- Perform version checks to detect new card sets and invalidate stale cache
- Serve cards from local cache when offline, falling back to backend when online
- Parse structured card JSON with title, body, and optional follow-up prompts
Interfaces
getCardsByCategory(categoryId: String): Future<List<TalkingCard>>
getAllCategories(): Future<List<CardCategory>>
refreshCardContent(): Future<void>
getCachedVersion(): Future<String?>