2096489fd1022b20262a371772806b575b5951bb
SwimBuddy
Swimming workout tracker with Apple Watch and WearOS companion apps.
Features
- Create and manage swimming workout templates
- Track workouts with detailed set/rep/lap data
- Apple Watch companion for real-time workout tracking
- WearOS companion for Android smartwatches
- HealthKit integration (iOS) and Health Services (WearOS)
- Multi-language support (EN, NL, DE, FR, IT, ES, PL, PT, DK)
- SWOLF score calculation
- Workout history and statistics
Tech Stack
- Framework: Expo 57 + React Native 0.86
- Styling: NativeWind v5 (TailwindCSS for React Native)
- Database: expo-sqlite + Drizzle ORM
- Navigation: React Navigation 7
- State: react-native-mmkv (settings), SQLite (workouts)
- Watch: Swift/SwiftUI (Apple Watch), Kotlin/Compose (WearOS)
Prerequisites
- Node.js 18+
- Expo CLI (
npm install -g expo-cli) - Xcode 15+ (for iOS/Watch development)
- Android Studio (for WearOS development)
- CocoaPods (for iOS)
Installation
# Install dependencies
npm install
# Generate database migrations
npm run db:generate
# Start development server
npm start
Development
# Start Expo dev server
npm start
# Run on iOS
npm run ios
# Run on Android
npm run android
Building
iOS & Apple Watch
# Build for iOS
npx expo run:ios
# Open in Xcode for Watch target
open ios/SwimBuddy.xcworkspace
WearOS
# Build debug APK
./scripts/build-wearos.sh debug
# Build release APK
./scripts/build-wearos.sh release
# Generate launcher icons
./scripts/generate-wearos-icon.sh assets/icon.png
Project Structure
src/
├── components/ # Shared UI primitives
├── config/ # App configuration
├── constants/ # Stroke types, pool lengths, colors
├── db/ # Drizzle schema, migrations, operations
├── features/
│ ├── active-workout/ # Live workout tracking
│ ├── history/ # Workout history
│ ├── settings/ # App settings
│ ├── templates/ # Workout template management
│ └── workout-builder/ # Create/edit workout templates
├── hooks/ # Shared React hooks
├── i18n/ # Translations (en, nl, de, fr, it, es, pl, pt, dk)
├── modules/
│ ├── watch-connectivity/ # Apple Watch WCSession bridge
│ └── wear-connectivity/ # WearOS Data Layer bridge
├── navigation/ # React Navigation setup
├── providers/ # DatabaseProvider, SettingsProvider
├── types/ # TypeScript types
└── utils/ # Utility functions
targets/
├── watch/ # Apple Watch app (Swift/SwiftUI)
└── wearos/ # WearOS app (Kotlin/Compose)
Database
The app uses SQLite via Drizzle ORM with the following tables:
templates- Workout templates with JSON dataworkouts- Completed workout sessionssets- Individual sets within workoutslaps- Lap data for each set
Schema Changes
After modifying src/db/schema.ts, regenerate migrations:
npm run db:generate
Watch Integration
Apple Watch
- Uses WCSession for phone↔watch communication
- HealthKit for swim workout tracking
- App Groups for data sharing between iPhone and Watch
- Real-time sync during workouts
WearOS
- Uses Wear Data Layer API for communication
- Health Services for swim tracking
- Jetpack Compose with Wear OS Compose libraries
Internationalization
Supported languages:
- English (en)
- Dutch (nl)
- German (de)
- French (fr)
- Italian (it)
- Spanish (es)
- Polish (pl)
- Portuguese (pt)
- Danish (dk)
Translation files are in src/i18n/{locale}/.
License
MIT
Languages
TypeScript
42%
Kotlin
29.7%
Swift
21.7%
JavaScript
5%
Shell
1.3%
Other
0.2%