Data Layer medium complexity mobile
0
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

Provides encrypted local persistence for user preference data using the Drift database, abstracting all read and write operations behind a typed interface. It handles serialisation and deserialisation of preference entries and ensures the local store is initialised with sensible defaults on first access. The repository is the single point of contact for any code that needs to read or write preferences from local storage.

Feature: App Settings & Preferences

preferences-repository

Sources & reasoning

The source explicitly lists Settings as a named screen type and specifies hamburger menu access as the entry point. The design token system requirement at line 305 confirms the settings surface must honour accessibility constraints. Blueprint marks this MVP and all workshop organizations expect standard app configurability from launch. Fase 1 core mobile scope implies MVP delivery with no later phase evidence.

Responsibilities

  • Store and retrieve user preferences as typed key-value entries in the encrypted Drift database
  • Initialise default preference values when a key is accessed for the first time
  • Expose transactional write operations to ensure atomic preference updates
  • Provide a stream or observable for reactive UI updates when preferences change

Interfaces

get(key: string): Promise<unknown>
set(key: string, value: unknown): Promise<void>
getAll(): Promise<UserPreferences>
watch(key: string): Stream<unknown>
clear(): Promise<void>

Related Data Entities (1)

Data entities managed by this component