diff --git a/docs/feature-brainstorm.md b/docs/feature-brainstorm.md new file mode 100644 index 0000000..950a2fc --- /dev/null +++ b/docs/feature-brainstorm.md @@ -0,0 +1,400 @@ +# Next Features Brainstorm for Dropped AI Cycling App + +## Executive Summary +This document outlines the next generation of features for the Dropped cycling app, building on the current foundation of AI-powered workout generation and user-friendly training plans. The features are organized by priority and implementation complexity to guide development roadmap decisions. + +## Current State Analysis + +### Existing Features ✅ +- User onboarding with personal metrics (weight, FTP, training hours/week, goals) +- Static weekly training plan generation based on user profile +- AI workout generator framework (OpenAI integration structure in place) +- Workout detail views with power graphs and interval breakdowns +- Basic workout types (endurance, threshold, VO2 max, sprint, recovery) +- Local data storage using UserDefaults and in-memory managers +- SwiftUI-based iOS interface with accessibility support + +### Current Limitations 🔍 +- AI workout generation requires manual API key configuration +- No user authentication or cloud data persistence +- Limited workout export/sharing capabilities +- Static training plans lack adaptability +- No integration with cycling hardware/platforms +- iOS-only availability + +## Proposed Features by Category + +### 🚀 Core AI & Workout Generation (HIGH PRIORITY) + +#### 1. Production-Ready AI Workout Generation +**Status:** Mentioned in issue requirements +**Description:** Make the OpenAI integration fully functional for real users +- Secure API key management (environment variables, backend proxy) +- Enhanced prompt engineering for better workout quality +- Fallback mechanisms when AI service is unavailable +- Rate limiting and cost management +- User feedback loop to improve AI prompts over time + +**Implementation Effort:** Medium +**User Value:** High + +#### 2. Adaptive Training Plans +**Description:** Dynamic training plans that adjust based on performance and feedback +- Weekly plan adjustments based on completed workout data +- Recovery recommendations based on training load +- Periodization support (base, build, peak, recovery phases) +- Goal-specific plan templates (century ride, race prep, weight loss) +- Progressive overload automation + +**Implementation Effort:** High +**User Value:** Very High + +#### 3. Smart Workout Scheduling +**Description:** AI-powered workout timing and sequencing +- Weather-aware scheduling for outdoor vs. indoor sessions +- Calendar integration for automatic rest day placement +- Travel mode with hotel/gym-friendly workouts +- Time-constrained workout alternatives (15, 30, 45, 60+ minute options) +- Optimal spacing of hard/easy sessions + +**Implementation Effort:** Medium +**User Value:** High + +### 🔗 Integration & Data Platform (HIGH PRIORITY) + +#### 4. Supabase Authentication & Cloud Storage +**Status:** Mentioned in issue requirements +**Description:** Move from local storage to cloud-based user management +- User authentication (email/password, social login) +- Cloud storage of user profiles, workouts, and progress +- Cross-device synchronization +- Data backup and recovery +- Privacy controls and data export + +**Implementation Effort:** Medium +**User Value:** High + +#### 5. Trainer-Compatible Workout Export +**Status:** Mentioned in issue requirements +**Description:** Generate workouts in formats compatible with cycling trainers and apps +- .zwo file export (Zwift workout format) +- .erg file export (TrainerRoad/general trainer format) +- .mrc file export (generic trainer format) +- Direct integration with popular platforms (Zwift, TrainerRoad, Sufferfest) +- QR code sharing for quick workout import + +**Implementation Effort:** Medium +**User Value:** Very High + +#### 6. Cycling Hardware Integration +**Description:** Connect with popular cycling devices and platforms +- Power meter data import (Garmin, Wahoo, etc.) +- Smart trainer connectivity (real-time power control) +- Heart rate monitor integration +- Strava integration for automatic workout upload +- Garmin Connect IQ app for on-device workout display + +**Implementation Effort:** High +**User Value:** Very High + +### 🌐 Platform Expansion (MEDIUM PRIORITY) + +#### 7. Web Application Version +**Status:** Mentioned in issue requirements +**Description:** Browser-based version for wider accessibility +- Responsive web design for desktop and tablet use +- Progressive Web App (PWA) capabilities +- Shared codebase considerations (React Native Web or separate development) +- Coach/trainer dashboard features +- Workout planning on larger screens + +**Implementation Effort:** High +**User Value:** Medium + +#### 8. Cross-Platform Mobile Support +**Description:** Android version of the app +- Native Android development or React Native port +- Platform-specific UI/UX optimizations +- Android-specific integrations (Google Fit, etc.) +- Consistent feature parity with iOS version + +**Implementation Effort:** Very High +**User Value:** High + +### 📊 Analytics & Performance Tracking (MEDIUM PRIORITY) + +#### 9. Advanced Performance Analytics +**Description:** Deep insights into training progress and performance +- Power curve analysis and FTP tracking over time +- Training Stress Score (TSS) calculation and tracking +- Chronic Training Load (CTL) and Acute Training Load (ATL) monitoring +- Performance Management Chart (PMC) +- Predictive performance modeling +- Plateau detection and breakthrough recommendations + +**Implementation Effort:** High +**User Value:** High + +#### 10. AI-Powered Form Analysis +**Description:** Video analysis for cycling technique improvement +- Camera-based pedal stroke analysis +- Posture and bike fit recommendations +- Efficiency metrics and improvement suggestions +- Integration with bike fitting guidelines +- Comparison with professional cyclist biomechanics + +**Implementation Effort:** Very High +**User Value:** Medium + +#### 11. Recovery & Wellness Tracking +**Description:** Holistic approach to training optimization +- Sleep quality integration (HealthKit, sleep trackers) +- Stress level monitoring +- Nutrition tracking and recommendations +- Recovery score calculation +- Automated rest day recommendations +- Integration with wearable devices (Apple Watch, etc.) + +**Implementation Effort:** Medium-High +**User Value:** High + +### 👥 Social & Community Features (LOW-MEDIUM PRIORITY) + +#### 12. Social Training Features +**Description:** Community aspects to increase engagement +- Workout sharing and community library +- Training partner matching +- Virtual group workouts +- Challenge and competition features +- Coach-athlete relationship management +- Training group creation and management + +**Implementation Effort:** High +**User Value:** Medium + +#### 13. AI Coaching Assistant +**Description:** Personalized coaching through AI +- Natural language interaction for training questions +- Motivational messaging and encouragement +- Race strategy development +- Nutrition and hydration recommendations +- Mental training and race preparation guidance + +**Implementation Effort:** Very High +**User Value:** High + +### 🎯 Specialized Training Modes (LOW PRIORITY) + +#### 14. Race-Specific Training Programs +**Description:** Targeted training for specific cycling disciplines +- Road racing preparation +- Time trial optimization +- Gran fondo/century ride training +- Mountain biking specific workouts +- Track cycling programs +- Triathlon bike leg preparation + +**Implementation Effort:** Medium +**User Value:** Medium + +#### 15. Rehabilitation & Return-to-Sport Programs +**Description:** Specialized programs for injury recovery +- Physical therapy integration +- Gradual return-to-activity protocols +- Injury prevention exercises +- Low-impact training alternatives +- Progress tracking for recovery goals + +**Implementation Effort:** High +**User Value:** Medium + +#### 16. Virtual Reality Training Experience +**Description:** Immersive cycling training environments +- VR headset integration +- Virtual cycling environments and routes +- Gamified workout experiences +- Real-world route simulation +- Multiplayer VR group rides + +**Implementation Effort:** Very High +**User Value:** Low-Medium + +## User Personas & Feature Alignment + +### 🏃‍♂️ Beginner Cyclist +**Primary Needs:** Simple, guided training with education +**Key Features:** Adaptive training plans, AI coaching assistant, form analysis +**Priority Features:** #2, #13, #10 + +### 🚴‍♀️ Enthusiast Cyclist +**Primary Needs:** Performance improvement and variety +**Key Features:** Advanced analytics, hardware integration, trainer compatibility +**Priority Features:** #5, #6, #9 + +### 🏆 Competitive Cyclist +**Primary Needs:** Data-driven optimization and peak performance +**Key Features:** Performance analytics, race-specific training, recovery tracking +**Priority Features:** #9, #11, #14 + +### 👩‍🏫 Cycling Coach +**Primary Needs:** Athlete management and program customization +**Key Features:** Web platform, social features, analytics dashboard +**Priority Features:** #7, #12, #9 + +## Implementation Roadmap Recommendation + +### Phase 1: Foundation (Q1-Q2) +1. Production-ready AI workout generation (#1) +2. Supabase authentication & cloud storage (#4) +3. Trainer-compatible workout export (#5) + +### Phase 2: Enhancement (Q3-Q4) +4. Adaptive training plans (#2) +5. Cycling hardware integration (#6) +6. Advanced performance analytics (#9) + +### Phase 3: Expansion (Year 2) +7. Web application version (#7) +8. Recovery & wellness tracking (#11) +9. Smart workout scheduling (#3) + +### Phase 4: Advanced Features (Year 2+) +10. AI coaching assistant (#13) +11. Cross-platform mobile support (#8) +12. Social training features (#12) + +## Technical Considerations + +### Architecture Recommendations +- Microservices architecture for scalability +- GraphQL API for flexible data querying +- Real-time capabilities for live workout features +- Machine learning pipeline for AI improvements +- CDN for global workout library distribution + +### Security & Privacy +- End-to-end encryption for sensitive health data +- GDPR/CCPA compliance for user data +- OAuth 2.0 for third-party integrations +- Regular security audits and penetration testing + +### Performance & Scalability +- Caching strategies for workout generation +- Offline capability for core features +- Progressive loading for large datasets +- Auto-scaling infrastructure for peak usage + +## Success Metrics + +### User Engagement +- Daily/weekly active users +- Workout completion rates +- Feature adoption rates +- User retention over time + +### Performance Outcomes +- User FTP improvements over time +- Training plan adherence rates +- User satisfaction scores +- Customer lifetime value + +### Technical Metrics +- API response times +- AI generation success rates +- Platform uptime and reliability +- Data sync success rates + +## Technical Implementation Appendix + +### High-Priority Feature Implementation Details + +#### Production-Ready AI Workout Generation +```swift +// Enhanced AIWorkoutGenerator with secure configuration +class AIWorkoutGenerator { + private let configuration: AIConfiguration + private let rateLimiter: RateLimiter + private let fallbackProvider: FallbackWorkoutProvider + + // Secure API key management through backend proxy + // Enhanced prompt engineering with workout templates + // Error handling and retry logic + // User feedback collection for prompt improvement +} +``` + +#### Supabase Integration Architecture +```swift +// Authentication service +class AuthenticationService { + private let supabaseClient: SupabaseClient + + func signIn(email: String, password: String) async throws -> User + func signUp(email: String, password: String) async throws -> User + func signOut() async throws +} + +// Cloud data synchronization +class CloudDataManager { + func syncUserData() async throws + func syncWorkouts() async throws + func handleOfflineChanges() async throws +} +``` + +#### Workout Export Formats +```swift +// Export service supporting multiple formats +class WorkoutExportService { + func exportToZwo(workout: Workout) -> String // Zwift format + func exportToErg(workout: Workout) -> String // ERG format + func exportToMrc(workout: Workout) -> String // MRC format + func generateQRCode(workout: Workout) -> UIImage +} +``` + +### Database Schema Considerations +```sql +-- User profiles with extended metrics +CREATE TABLE user_profiles ( + id UUID PRIMARY KEY, + email TEXT UNIQUE NOT NULL, + ftp INTEGER NOT NULL, + weight DECIMAL, + training_hours_per_week INTEGER, + goals TEXT[], + created_at TIMESTAMP DEFAULT NOW(), + updated_at TIMESTAMP DEFAULT NOW() +); + +-- Workout library with AI metadata +CREATE TABLE workouts ( + id UUID PRIMARY KEY, + user_id UUID REFERENCES user_profiles(id), + title TEXT NOT NULL, + workout_type TEXT NOT NULL, + intervals JSONB NOT NULL, + ai_generated BOOLEAN DEFAULT FALSE, + ai_prompt_version TEXT, + created_at TIMESTAMP DEFAULT NOW() +); + +-- Performance tracking +CREATE TABLE workout_completions ( + id UUID PRIMARY KEY, + user_id UUID REFERENCES user_profiles(id), + workout_id UUID REFERENCES workouts(id), + completed_at TIMESTAMP NOT NULL, + average_power INTEGER, + duration INTERVAL, + notes TEXT +); +``` + +## Conclusion + +The Dropped cycling app has a solid foundation with its AI-powered workout generation and user-friendly interface. The proposed features build upon this foundation to create a comprehensive cycling training ecosystem that serves users from beginners to competitive athletes. + +The recommended implementation roadmap prioritizes features that provide immediate user value while building the technical infrastructure needed for long-term growth and scalability. The focus on AI enhancement, platform integration, and data-driven insights positions Dropped to compete effectively in the cycling training app market. + +Success will depend on maintaining the app's core simplicity while adding powerful features that enhance rather than complicate the user experience. Regular user feedback and iterative development will be crucial for achieving product-market fit and sustainable growth. \ No newline at end of file diff --git a/docs/issue-13-summary.md b/docs/issue-13-summary.md new file mode 100644 index 0000000..8a7195a --- /dev/null +++ b/docs/issue-13-summary.md @@ -0,0 +1,87 @@ +# Quick Feature Summary for Issue #13 + +Based on the comprehensive analysis in `docs/feature-brainstorm.md`, here are the immediate next features to prioritize: + +## 🎯 Immediate Priorities (Addressing Issue Requirements) + +### 1. Make workout generation 'actually work' with OpenAI APIs ✅ +**Current Status:** Framework exists but needs production readiness +**Action Items:** +- Secure API key management (environment variables or backend proxy) +- Enhanced prompt engineering for consistent, high-quality workouts +- Error handling and fallback mechanisms +- Rate limiting and cost management +- User feedback loop for continuous improvement + +### 2. Integration with Supabase for auth and data storage ✅ +**Current Status:** Using local storage only +**Action Items:** +- User authentication (email/password, social login) +- Cloud storage for user profiles, workouts, and progress +- Cross-device synchronization +- Data backup and recovery +- Migration from local UserDefaults to cloud database + +### 3. Generate workouts in a trainer-compatible format ✅ +**Current Status:** Workouts only displayable in app +**Action Items:** +- .zwo file export (Zwift workout format) +- .erg file export (TrainerRoad/general trainer format) +- .mrc file export (generic trainer format) +- QR code sharing for quick workout import +- Direct integration APIs with popular platforms + +### 4. Add a web version ✅ +**Current Status:** iOS only +**Action Items:** +- Responsive web application +- Progressive Web App (PWA) capabilities +- Coach/trainer dashboard features +- Shared authentication with mobile app +- Workout planning on larger screens + +## 🚀 Recommended Implementation Order + +### Phase 1 (3-4 months) +1. **Production AI Integration** - Make the core value proposition work reliably +2. **Supabase Authentication** - Enable user accounts and data persistence +3. **Workout Export** - Immediate value for existing cyclists with trainers + +### Phase 2 (3-4 months) +4. **Web Platform** - Expand user base and enable coach features +5. **Hardware Integration** - Connect with cycling devices (Strava, power meters) +6. **Adaptive Training Plans** - AI-powered plan adjustments based on performance + +## 💡 Additional High-Value Features (Beyond Original Requirements) + +### Smart Workout Scheduling +- Weather-aware indoor/outdoor recommendations +- Calendar integration +- Time-constrained workout alternatives + +### Advanced Performance Analytics +- FTP tracking over time +- Training load monitoring +- Performance prediction modeling + +### Recovery & Wellness Integration +- Sleep quality tracking (HealthKit) +- Automated rest day recommendations +- Stress level monitoring + +## 🎯 Success Metrics to Track + +- **AI Generation Success Rate**: >95% successful workout generations +- **User Retention**: 30-day retention >60% +- **Export Usage**: >40% of generated workouts exported to trainers +- **Cross-Platform Adoption**: Web users complement mobile users + +## 📋 Next Steps + +1. Prioritize and scope Phase 1 features +2. Set up Supabase project and authentication +3. Implement secure OpenAI API integration +4. Design workout export file formats +5. Plan web application architecture + +See `docs/feature-brainstorm.md` for complete feature analysis and technical details. \ No newline at end of file diff --git a/docs/memory.md b/docs/memory.md index e9058b1..931c6eb 100644 --- a/docs/memory.md +++ b/docs/memory.md @@ -9,11 +9,14 @@ This project is a SwiftUI-based iOS application structured as follows: - **idea.md**: Project ideas and brainstorming notes. - **memory.md**: (This file) Documentation of project architecture and file purposes. - **research.md**: Research notes and references for the project. +- **feature-brainstorm.md**: Comprehensive brainstorming document for next features to add to the AI cycling app. Includes 16 prioritized feature categories ranging from core AI improvements to advanced VR training experiences, organized by implementation effort and user value. - **openai.md**: Guide for calling OpenAI APIs in Swift without SDKs. - **specs/**: Folder containing feature specifications. - **workout-detail-view.md**: Specification for the workout detail view feature. + - **ai-training-plan.md**: Specification for the AI-powered cycling training plan generator feature. - **plans/**: Folder containing implementation plans. - **workout-detail-view-plan.md**: Implementation plan for the workout detail view feature. + - **ai-training-plan.md**: Implementation plan for the AI-powered cycling training plan generator feature. ### Dropped/ - **ContentView.swift**: The main SwiftUI view for the app's content. Now includes navigation to the AI Workout Generator via a prominent navigation link.