Card Catalog Sync Service
Component Detail
Service Layer
low complexity
mobile
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
A lightweight Flutter service that fetches the versioned talking-cards catalogue from the backend REST endpoint and upserts new or updated cards into the local Drift table. Uses a stored catalogue version token to avoid redundant downloads and operates as a background read-only sync with no user-generated writes.
card-catalog-sync-service
Sources & reasoning
The implementation notes specify a versioned backend endpoint that syncs the catalogue to clients without requiring an app release. This service encapsulates that versioned pull-sync logic, keeping the UI component free of network concerns and making the sync independently testable.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Fetch versioned card catalogue from backend endpoint on app start and periodic refresh
- Compare local catalogue version token against server version before downloading
- Upsert received cards into the local Drift talking_cards table
- Expose sync status to Riverpod providers so the UI can indicate a stale cache
Interfaces
syncCatalog()
getCatalogVersion() -> String
getLastSyncedAt() -> DateTime