Introduction
The Storage API provides a comprehensive set of functions for managing all persistent data in the Rippler workout tracker. Built on top of React Native’s AsyncStorage, it handles exercises, logged workouts, target overrides, goal weights, and program progression.Architecture
All storage operations are asynchronous and handle errors gracefully, returning default values when data retrieval fails. The API uses a centralized key management system to ensure consistent data access across the application.Storage Keys
The following AsyncStorage keys are used throughout the application:Stores the array of user exercises with their IDs, names, and optional notes
Contains all completed workout sessions with exercise logs and timestamps
Tracks the user’s current week in the Rippler program (1-16)
Stores custom weight/rep/set targets that override program defaults
Maps exercise names to user-defined goal weights
Data Flow
Core Functionality
The Storage API is organized into five main categories:Exercise Management
Create, read, update, and delete exercises from your workout library. Each exercise has a unique ID, name, and optional notes. Learn more →Workout Logging
Persist completed workouts with detailed set-by-set tracking, including weights, reps, and completion status for each exercise. Learn more →Goal Setting
Define and track target weights for each exercise to measure progress throughout the program. Learn more →Target Overrides
Customize specific workout targets for any day in the program, allowing flexibility while maintaining structure. Learn more →Error Handling
All storage functions implement try-catch error handling:Data Types
The Storage API works with these core TypeScript types:Best Practices
Always await storage operations
Always await storage operations
Storage functions are asynchronous. Always use
await or .then() to ensure data is persisted before proceeding.Use getter functions for defaults
Use getter functions for defaults
Getter functions like
getExercises() automatically initialize data with sensible defaults if nothing exists.Batch updates when possible
Batch updates when possible
For multiple changes, modify the array in memory and save once rather than saving after each change.
Import
Next Steps
Exercise Storage
Manage your exercise library
Workout Storage
Log and retrieve workout sessions
Goal Storage
Set and track goal weights
Override Storage
Customize workout targets