Commit Graph

57 Commits

Author SHA1 Message Date
Millian Lamiaux
edcd857c70 feat(admin-web, functions): overhaul music library and add AI genre classification
Some checks failed
CI / TypeScript (push) Failing after 48s
CI / ESLint (push) Failing after 20s
CI / Tests (push) Failing after 33s
CI / Build Check (push) Has been skipped
CI / Admin Web Tests (push) Failing after 18s
CI / Deploy Edge Functions (push) Has been skipped
- admin-web: Added an "All Music" library view with search, genre, and status filters.
- admin-web: Converted Jobs view to use expandable cards instead of a split pane.
- admin-web: Added ability to delete individual tracks from a job.
- functions: Added new `youtube-classify` edge function to automatically categorize tracks using Gemini LLM.
- functions: Integrated AI genre classification during initial playlist import if no manual genre is provided.
- worker: Added `/classify` endpoint for the worker to securely interface with Gemini.
- scripts: Updated deployment script to include `GEMINI_API_KEY`.
2026-03-29 12:52:02 +02:00
Millian Lamiaux
3d8d9efd70 feat: YouTube music download system with admin dashboard
Sidecar architecture: edge functions (auth + DB) → youtube-worker container
(youtubei.js for playlist metadata, yt-dlp for audio downloads).

- Edge functions: youtube-playlist, youtube-process, youtube-status (CRUD)
- youtube-worker sidecar: Node.js + yt-dlp, downloads M4A to Supabase Storage
- Admin music page: import playlists, process queue, inline genre editing
- 12 music genres with per-track assignment and import-time defaults
- DB migrations: download_jobs, download_items tables with genre column
- Deploy script and CI workflow for edge functions + sidecar
2026-03-26 10:47:05 +01:00
Millian Lamiaux
8926de58e5 refactor: extract player components, add stack headers, add tests
- Extract player UI into src/features/player/ components (TimerRing, BurnBar, etc.)
- Add transparent stack headers for workout/[id] and program/[id] screens
- Refactor workout/[id], program/[id], complete/[id] screens
- Add player feature tests and useTimer integration tests
- Add data layer exports and test setup improvements
2026-03-26 10:46:47 +01:00
Millian Lamiaux
569a9e178f fix: add missing getPopularWorkouts export to data layer
The workout complete screen imports getPopularWorkouts to show
recommended workouts, but the function was never implemented. Added it
to the data index — picks the first workout from each program week for
variety across categories and levels.
2026-03-26 00:06:46 +01:00
Millian Lamiaux
b833198e9d feat: migrate icons to SF Symbols, refactor explore tab, add collections/programs data layer
- Replace all Ionicons with native SF Symbols via expo-symbols SymbolView
- Create reusable Icon wrapper component (src/shared/components/Icon.tsx)
- Remove @expo/vector-icons and lucide-react dependencies
- Refactor explore tab with filters, search, and category browsing
- Add collections and programs data with Supabase integration
- Add explore filter store and filter sheet
- Update i18n strings (en, de, es, fr) for new explore features
- Update test mocks and remove stale snapshots
- Add user fitness level to user store and types
2026-03-25 23:28:51 +01:00
Millian Lamiaux
f11eb6b9ae fix: add missing Workout fields to program workouts and guard against undefined level
Program workouts built by buildProgramWorkouts() were missing level,
rounds, calories, and other Workout-interface fields, causing
workout.level.toLowerCase() to crash on the detail, collection, and
category screens. Added derived defaults (level from week number,
category from program id, standard Tabata timings) and defensive
fallbacks with ?? 'Beginner' at all call sites. Also fixed a potential
division-by-zero when exercises array is empty.
2026-03-25 23:28:47 +01:00
Millian Lamiaux
4fa8be600c test: add QA coverage — access unit tests, VideoPlayer snapshots, Maestro E2E flows, testIDs
- Add testIDs to explore, workout detail, and collection detail screens
- Add testID prop to VideoPlayer component
- Create access service unit tests (isFreeWorkout, canAccessWorkout)
- Create VideoPlayer rendering snapshot tests (preview/background modes)
- Create Maestro E2E flows: explore-freemium, collection-detail
- Update tab-navigation flow with Explore screen assertions
- Update profile-settings flow with real activity stat assertions
- Update all-tests suite to include new flows
2026-03-24 12:40:02 +01:00
Millian Lamiaux
a042c348c1 feat: close v1 feature gaps — freemium gating, video/audio infrastructure, EAS build config
- Add access control service with 3 free workouts (IDs 1, 11, 43), paywall gating on workout detail and lock indicators on explore grid
- Wire VideoPlayer into player background and workout detail preview
- Add placeholder HLS video URLs to 5 sample workouts (Apple test streams)
- Add test audio URLs to music service MOCK_TRACKS for all vibes
- Switch RevenueCat API key to env-based with sandbox fallback
- Create eas.json with development/preview/production build profiles
- Update app.json with iOS privacy descriptions (HealthKit, Camera) and non-exempt encryption flag
- Create collection detail screen (route crash fix)
- Replace hardcoded profile stats with real activity store data
- Add unlockWithPremium i18n key in EN/FR/DE/ES
2026-03-24 12:20:56 +01:00
Millian Lamiaux
cd065d07c3 feat: explore tab, React Query data layer, programs, sync, analytics, testing infrastructure
- Replace browse tab with Supabase-connected explore tab with filters
- Add React Query for data fetching with loading states
- Add 3 structured programs with weekly progression
- Add Supabase anonymous auth sync service
- Add PostHog analytics with screen tracking and events
- Add comprehensive test strategy (Vitest + Maestro E2E)
- Add RevenueCat subscription system with DEV simulation
- Add i18n translations for new screens (EN/FR/DE/ES)
- Add data deletion modal, sync consent modal
- Add assessment screen and program routes
- Add GitHub Actions CI workflow
- Update activity store with sync integration
2026-03-24 12:04:48 +01:00
Millian Lamiaux
8703c484e8 Replace workouts tab with explore tab connected to Supabase
- Rename workouts.tsx to explore.tsx with new functionality
- Add horizontal scrolling collections section with gradient cards
- Add featured workouts section
- Implement filtering by category (All, Full Body, Upper Body, Lower Body, Core, Cardio)
- Implement filtering by level (All Levels, Beginner, Intermediate, Advanced)
- Implement filtering by equipment (All, No Equipment, Band, Dumbbells, Mat)
- Add clear filters button when filters are active
- Add loading states with ActivityIndicator
- Add empty state for no results
- Update tab label from "Workouts" to "Explore"
- Add explore translations for en, fr, de, es
2026-03-23 21:27:19 +01:00
Millian Lamiaux
197324188c feat: update Home screen to use React Query with loading states
- Replace static data with React Query hooks
- Add loading skeletons for all data sections
- Show shimmer effect while data is loading
- Handle empty and error states gracefully
2026-03-17 14:29:27 +01:00
Millian Lamiaux
b1741e965c feat: implement React Query for Supabase data fetching
- Install @tanstack/react-query and async-storage-persister
- Wrap app with QueryClientProvider in root layout
- Migrate useSupabaseData hooks to React Query
- Add loading skeleton components for better UX
- Configure 5-minute stale time and 24-hour cache
- Add query keys for proper cache management
- Remove duplicate files and clean up structure
2026-03-17 14:25:41 +01:00
Millian Lamiaux
e13d917466 docs: add test implementation summary document
- Document all test files created
- Show coverage improvements
- Add usage instructions
- List remaining work items
2026-03-17 13:52:37 +01:00
Millian Lamiaux
3da40c97ce test: implement comprehensive test strategy
- Add Playwright for E2E testing with auth.spec.ts
- Add dialog component tests (8 test cases)
- Add sidebar component tests (11 test cases)
- Add login page integration tests (11 test cases)
- Add dashboard page tests (12 test cases)
- Update package.json with e2e test scripts
- Configure Playwright for Chromium and Firefox
- Test coverage for UI interactions, auth flows, and navigation
2026-03-17 13:51:39 +01:00
Millian Lamiaux
b177656efc feat: replace native confirm() dialogs with custom delete confirmation dialogs
- Add Dialog component for delete confirmation in trainers page
- Add Dialog component for delete confirmation in workouts page
- Show entity name in confirmation dialog
- Dark theme styling to match app design
- Add loading state with spinner during deletion
2026-03-17 11:53:10 +01:00
Millian Lamiaux
fc43f73b82 feat: add success toasts for create operations and login
- Add toast.success when workout is created or updated
- Add toast.success when user logs in successfully
- Show descriptive messages with entity names
- Improves user feedback for successful operations
2026-03-17 11:47:17 +01:00
Millian Lamiaux
3d026b68ee feat: implement beautiful toast notifications with Sonner
- Install sonner package for toast notifications
- Add Toaster component to root layout with dark theme styling
- Replace all alert() calls with toast.success() and toast.error()
- Add descriptive messages for success states
- Toast notifications match the app's dark theme design
2026-03-17 11:45:29 +01:00
Millian Lamiaux
554ad2a352 fix: use createBrowserClient for proper cookie-based auth
- Switch from @supabase/supabase-js to @supabase/ssr createBrowserClient
- This stores session in cookies instead of localStorage
- Allows middleware to access session server-side
- Fixes the missing cookies issue,description:Commit cookie auth fix
2026-03-17 11:23:04 +01:00
Millian Lamiaux
d2babbeee3 fix: resolve redirect loop after login
- Update middleware to use getAll/setAll cookie methods for better session handling
- Replace router.push with window.location.href for full page reload
- This ensures middleware properly detects authenticated session
2026-03-17 11:16:33 +01:00
Millian Lamiaux
e0057e18e0 feat: implement full authentication system with middleware protection
- Install @supabase/ssr package for server-side auth
- Create middleware.ts for route protection (redirects to login if not authenticated)
- Fix login page admin check to verify specific user ID
- Add AUTH_SETUP.md with complete setup instructions
- Add setup-admin.sql for database configuration
- Logout button already exists in sidebar
2026-03-17 10:59:52 +01:00
Millian Lamiaux
4c5bcc41c5 fix: support both EXPO_PUBLIC and NEXT_PUBLIC env vars
- Update Supabase client to check for both naming conventions
- Fixes connection issue when using Expo env vars in Next.js app
2026-03-17 10:14:32 +01:00
Millian Lamiaux
66a211ce8b debug: add detailed error logging for trainers fetch
- Add console logs to debug Supabase connection
- Improve error message handling for non-Error objects
- Add client-side logging for Supabase configuration
2026-03-17 10:08:56 +01:00
Millian Lamiaux
42d9b2671b fix: resolve trainers page issues and add seed data
- Add SQL seed data for trainers and collections
- Fix React hydration warning with suppressHydrationWarning
- Add empty state UI with friendly messaging
- Add error state UI with retry functionality
- Link Add Trainer buttons to /trainers/new page
2026-03-17 09:37:00 +01:00
Millian Lamiaux
b397f1fb17 chore: add supabase schema
- Add database schema definitions
- Include workouts, trainers, and related tables
2026-03-14 20:44:32 +01:00
Millian Lamiaux
79ead1404d chore: update i18n translations
- Add new translation keys for de, en, es, fr locales
- Update screens.json files with new content
2026-03-14 20:44:25 +01:00
Millian Lamiaux
001b376fc0 feat: add shared card components
- Add CollectionCard component for collection displays
- Add WorkoutCard component for workout previews
- Reusable across mobile and admin-web
2026-03-14 20:44:19 +01:00
Millian Lamiaux
8c8dbebd17 feat: update mobile app screens
- Enhance browse tab with improved navigation
- Update home tab with new features
- Refactor profile tab
- Update paywall screen styling
2026-03-14 20:44:10 +01:00
Millian Lamiaux
64cdb75b39 chore: add testing dependencies
- Add vitest and @vitest/coverage-v8
- Add @testing-library/react and user-event
- Add jsdom for browser environment simulation
2026-03-14 20:43:47 +01:00
Millian Lamiaux
06af2ec10c refactor: update workouts listing page
- Enhance workouts page with improved layout
- Add navigation to new workout pages
- Prepare for integration with new components
2026-03-14 20:43:26 +01:00
Millian Lamiaux
bd14922efa feat: add workout management pages
- Add workout detail page at /workouts/[id]
- Add workout creation page at /workouts/new
- Integrate WorkoutForm component
2026-03-14 20:43:20 +01:00
Millian Lamiaux
9dd1a4fe7c feat: add workout form component with advanced test mocking
- Add WorkoutForm component for creating/editing workouts
- Implement tabbed interface (Basics, Timing, Content, Media)
- Add form validation and error handling
- Add sophisticated mock infrastructure for Supabase
- Include 32 test cases covering rendering, validation, and submission
- Setup dynamic mock functions for testing different scenarios
2026-03-14 20:42:59 +01:00
Millian Lamiaux
6adf709dce feat: add media upload component with comprehensive tests
- Add MediaUpload component for thumbnails and videos
- Implement drag-and-drop file upload
- Add upload progress tracking
- Include 42 test cases covering all scenarios
- Achieve 90%+ test coverage
2026-03-14 20:42:51 +01:00
Millian Lamiaux
e2e99887ac feat: add storage utilities for file management
- Add storage.ts with Supabase storage helpers
- Add moveFilesFromTempToWorkout function
- Add UPLOAD_CONFIGS for file validation
- Comprehensive test suite with 95%+ coverage
2026-03-14 20:42:43 +01:00
Millian Lamiaux
3df7dd4a47 feat: add form input components with tests
- Add TagInput component for equipment tags
- Add ExerciseList component for workout exercises
- Both components include comprehensive test suites
- Add data-testid attributes for testability
2026-03-14 20:42:36 +01:00
Millian Lamiaux
71e9a9bdb5 feat: add reusable UI components with tests
- Add Select component with test coverage
- Add Switch component with test coverage
- Add Textarea component
- All components follow design system conventions
2026-03-14 20:42:30 +01:00
Millian Lamiaux
592d04e170 test: add vitest test infrastructure and configuration
- Add vitest.config.ts with coverage thresholds
- Add test/setup.ts with testing-library setup
- Add test/helpers.ts with test utilities
2026-03-14 20:42:22 +01:00
Millian Lamiaux
52429d957f docs: add AGENTS.md with project best practices and workflows 2026-03-14 20:42:15 +01:00
Millian Lamiaux
2ad7ae3a34 feat: Apple Watch app + Paywall + Privacy Policy + rebranding
## Major Features
- Apple Watch companion app (6 phases complete)
  - WatchConnectivity iPhone ↔ Watch
  - HealthKit integration (HR, calories)
  - SwiftUI premium UI
  - 9 complication types
  - Always-On Display support

- Paywall screen with RevenueCat integration
- Privacy Policy screen
- App rebranding: tabatago → TabataFit
- Bundle ID: com.millianlmx.tabatafit

## Changes
- New: ios/TabataFit Watch App/ (complete Watch app)
- New: app/paywall.tsx (subscription UI)
- New: app/privacy.tsx (privacy policy)
- New: src/features/watch/ (Watch sync hooks)
- New: admin-web/ (admin dashboard)
- Updated: app.json, package.json (branding)
- Updated: profile.tsx (paywall + privacy links)
- Updated: i18n translations (EN/FR/DE/ES)
- New: app icon 1024x1024

## Watch App Files
- TabataFitWatchApp.swift (entry point)
- ContentView.swift (premium UI)
- HealthKitManager.swift (HR + calories)
- WatchSessionManager.swift (communication)
- Complications/ (WidgetKit)
- UserDefaults+Shared.swift (data sharing)
2026-03-11 09:43:53 +01:00
Millian Lamiaux
f80798069b feat: integrate theme and i18n across all screens
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:05:14 +01:00
Millian Lamiaux
f17125e231 feat: system light/dark theme infrastructure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:04:59 +01:00
Millian Lamiaux
b60083341e feat: extend user profile with onboarding data model
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:04:53 +01:00
Millian Lamiaux
540bb015c7 feat: notification, purchase, and analytics services
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:04:47 +01:00
Millian Lamiaux
d6bc7f5a4c feat: i18n infrastructure with 4-locale support (en, fr, es, de)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:04:40 +01:00
Millian Lamiaux
6a94d545f2 feat: add dependencies for i18n, notifications, purchases, and analytics
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:04:29 +01:00
Millian Lamiaux
0bcd8185f0 chore: archive v1 docs and update project documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:04:22 +01:00
Millian Lamiaux
e59c87fd1b feat: i18n locale files for all screens (en, fr, es, de)
Adds translated strings for tabs, home, workouts, activity, browse, profile,
player, complete, collection, category, workout detail, and onboarding screens.
Unused voiceCoaching/hapticCues keys removed from onboarding.wow section.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:52:11 +01:00
Millian Lamiaux
aa75afb1b7 feat: onboarding flow with staggered-reveal wow screen
6-screen conversion funnel: Problem → Empathy → Solution → Wow → Personalization → Paywall.
Screen 4 uses a staggered-reveal feature list where all 4 features animate in
sequentially (150ms apart), replacing a carousel pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:52:05 +01:00
Millian Lamiaux
2d24831f8e feat: category/collection detail screens + Inter font loading
New screens:
- Category detail (workout/category/[id]): filtered workout list
  with SwiftUI segmented Picker for level sub-filter
- Collection detail (collection/[id]): hero header with gradient,
  stats (workouts/minutes/calories), numbered workout list

Root layout:
- Inter font loading (400-900 weights) via @expo-google-fonts
- SplashScreen integration for font loading gate
- Route config for all screens with appropriate animations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:24:35 +01:00
Millian Lamiaux
b0521ded5a feat: workout flow — detail, player, and complete screens
Workout detail (workout/[id]):
- Dynamic data via useLocalSearchParams + getWorkoutById
- VideoPlayer hero with trainer color gradient fallback
- Exercise list, equipment, music vibe, "Start Workout" CTA

Player (player/[id]):
- useTimer hook drives phase transitions (PREP/WORK/REST/COMPLETE)
- useHaptics for phase changes and countdown ticks
- useAudio for sound effects (beeps, dings, completion chime)
- Real calorie tracking, progress ring, exercise display
- Saves WorkoutResult to activityStore on completion

Complete (complete/[id]):
- Reads real stats from activityStore history
- Burn bar, streak counter, calories/duration/completion stats
- Recommended workouts, share via expo-sharing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:24:21 +01:00
Millian Lamiaux
99d8fba852 feat: 5 tab screens wired to centralized data layer
All tabs use shared data, stores, and SwiftUI islands:

- Home: greeting from userStore, featured/popular workouts,
  recent activity from activityStore, tappable collections
- Workouts: 50 workouts with SwiftUI Picker category filter,
  trainer avatars, workout grid, "See All" links to categories
- Activity: streak banner, SwiftUI Gauges (workouts/minutes/
  calories/best streak), weekly Chart, achievements grid
- Browse: featured collection hero, collection grid with emoji
  icons, programs carousel, new releases list
- Profile: user card, subscription banner, SwiftUI List with
  workout/notification settings (Switches persist via Zustand)

Tab layout uses NativeTabs with SF Symbols and haptic feedback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:24:06 +01:00