How forkerer/renphogarminsync-cli works
Main Components
a. Core Application Layer:
• Console Application (Entry Point)
• Command Handlers (Sync, Garmin Auth, Renpho Auth)
• FIT File Generator
• Configuration Management
b. Renpho Integration:
• Renpho API Client
• Renpho Authentication Service
• Renpho Data Models
c. Garmin Integration:
• Garmin API Client
• Garmin Authentication Service
• Garmin Data Models
d. Persistence Layer:
• Measurement History Repository
• Auth Token Caches
• FIT File Storage
┌─────────────────────────────────────────────────────────────┐
• Console Application │
• ┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Command Handlers │
• ┬─────────────────────┬───────────────────┤
• Sync Handler │ Garmin Auth Handler│ Renpho Auth Handler│
• ┴─────────────────────┴───────────────────┘
• ↓ ↓ ↓
┌─────────────────┐ ┌─────────────────┐ ┌───────────────────┐
• Renpho API │ │ Garmin API │ │ FIT Generator │
• Integration │←→│ Integration │←→│ & Converter │
• ┘ └─────────────────┘ └───────────────────┘
• ↓ ↓ ↓
┌─────────────────────────────────────────────────────────────┐
• Persistence Layer │
• ┬─────────────────────┬───────────────────┤
• Auth Caches │ Measurement History │ FIT Files │
• ┴─────────────────────┴───────────────────┘
Important Relationships to Highlight
• Bidirectional flow between the Command Handlers and their respective API integrations
• Data flow from Renpho API → FIT Generator → Garmin API
• Relationship between authentication services and their respective caches
• Demonstrate how the measurement history repository tracks synced data
Additional Elements
• External System Boundaries (Renpho and Garmin services)
• Security Components (AES encryption for stored credentials)
• Configuration Management
• Error Handling Flow
Technical Details to Note
• Authentication Flows (including MFA support for Garmin)
• Data Transformation Process (Renpho measurements → FIT format)
• Caching Mechanisms
• File Storage Structure
Implementation Notes
• Clear separation between Renpho and Garmin integrations
• The central role of the sync command handler
• The importance of the persistence layer in preventing duplicate syncs
• The modular nature of the authentication systems
Remember to:
• Use consistent notation throughout
• Notes for important implementation details (e.g., encryption, MFA handling)
This system design should provide a clear understanding of how the application coordinates data flow between Renpho and Garmin while maintaining security and preventing duplicate syncs.