How infantajayvenus/gymbooku works
Main Application Architecture
a. Presentation Layer (UI Components)
• Use a container at the top level representing the React application
• Divide into main pages/screens:
• Home/WorkoutTrackerScreen
• WeightTracker
• WorkoutList
• WorkoutPlanner
b. State Management Layer
• Reducers (PlanReducer, WeightReducer, WorkoutReducer, WorkoutTrackReducer)
• To custom hooks that manage state persistence
c. Data Storage Layer
• IndexedDB storage
• Local data models (Plan, Workout, WorkoutRecord, WeightCollection, StreakData)
Component Structure
• Main App component
• Reusable components (SetTrackCard, WorkoutTrackCard, StreakCard)
• Form components (PlanForm, WorkoutForm)
• Utility components (SortableList, TabPanel)
Data Flow
• User interactions → Components
• Components → Reducers
• Reducers → IndexedDB
• Custom hooks → Components
Specific Implementation Details
• Custom hooks (useStreakData, useLatestTrackData, useWeeklyWeightTrackedData)
• Utility functions (getAverage, getWeek, isTimestampToday)
• Blue: UI Components
• Green: Data Storage
• Orange: State Management
• Purple: Utility Functions
• Yellow: Custom Hooks
[User Interface Layer]
• ↕
[Component Layer]
• ↕
[Custom Hooks Layer]
• ↕
[State Management Layer]
• ↕
[Data Storage Layer]
Important elements to emphasize:
The feature modules (workout tracking, weight tracking, planning)
• Component types
• State management flow
Keep the abstraction level focused on the architectural decisions while showing the main features (workout tracking, planning, and streak monitoring) as they are core to the application's purpose.
Remember to highlight the offline-capable nature of the application and how data persistence is handled through the custom hooks and reducers to IndexedDB storage.