A full-stack React Native mobile app built with Expo that helps small groups (2-5 friends) stay consistent with workouts through daily check-ins, streak tracking, and AI-powered motivation.
GymBro/
โโโ frontend/ # Expo React Native app
โ โโโ app/ # Expo Router pages
โ โ โโโ (tabs)/ # Tab navigation screens
โ โ โโโ auth/ # Authentication screens
โ โ โโโ _layout.tsx
โ โโโ components/ # Reusable UI components
โ โโโ lib/ # Utilities and configurations
โ โโโ store/ # Zustand state management
โ โโโ types/ # TypeScript type definitions
โโโ backend/ # Cloudflare Worker API
โ โโโ src/
โ โ โโโ routes/ # API route handlers
โ โ โโโ types/ # Shared types
โ โ โโโ index.ts # Main Worker entry point
โ โโโ schema.sql # D1 database schema
โ โโโ wrangler.toml
โโโ docs/ # Documentation
- Framework: Expo (React Native + TypeScript)
- Navigation: Expo Router
- Styling: NativeWind (TailwindCSS for RN)
- UI Components: React Native Paper
- State Management: Zustand
- Server Sync: React Query (TanStack)
- Notifications: Expo Notifications
- Media: Expo ImagePicker
- Runtime: Cloudflare Workers
- Database: Cloudflare D1 (SQLite)
- Caching: Cloudflare KV
- Storage: Cloudflare R2
- Scheduled Jobs: Cloudflare Cron Triggers
- Authentication: Supabase
- Google Gemini API: Motivational messages and summaries
- DigitalOcean Gradient: Analytics and insights
- Node.js 18+
- Expo CLI (
npm install -g @expo/cli) - Cloudflare account
- Supabase account
- Google Gemini API key
-
Navigate to backend directory:
cd backend -
Install dependencies:
npm install
-
Configure Cloudflare:
- Create a Cloudflare account
- Get your Account ID from the dashboard
- Create a D1 database:
wrangler d1 create gymbro-db - Create KV namespace:
wrangler kv:namespace create "PUSH_TOKENS" - Create R2 bucket:
wrangler r2 bucket create gymbro-images
-
Update wrangler.toml:
- Replace
your-database-id-herewith your actual D1 database ID - Replace
your-kv-namespace-id-herewith your KV namespace ID - Update other configuration values
- Replace
-
Set up environment variables:
cp env.example .env # Edit .env with your actual values -
Deploy the database schema:
wrangler d1 migrations apply gymbro-db
-
Deploy the Worker:
wrangler deploy
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Set up Supabase:
- Create a new Supabase project
- Get your project URL and anon key
- Update authentication settings to allow your domain
-
Configure environment variables:
cp env.example .env # Edit .env with your actual values -
Start the development server:
npx expo start
-
Run on device/simulator:
- Install Expo Go app on your phone
- Scan the QR code from the terminal
- Or press
ifor iOS simulator,afor Android emulator
- Group Management: Create/join workout groups (2-5 friends)
- Daily Check-ins: Photo or text updates
- Streak Tracking: Visual progress tracking
- AI Motivation: Personalized encouragement messages
- Push Notifications: Gentle reminders and updates
- Social Feed: See group members' progress
POST /auth/link- Link Supabase user to GymBro databaseGET /auth/profile- Get user profilePUT /auth/profile- Update user profile
POST /groups- Create a new groupGET /groups- Get user's groupsGET /groups/:id- Get group detailsPOST /groups/join- Join group by invite codeDELETE /groups/:id/leave- Leave group
POST /posts- Create a new postGET /posts/group/:groupId- Get group postsGET /posts/user- Get user's postsDELETE /posts/:id- Delete post
GET /motivate/group/:groupId- Get motivational messagesPOST /motivate/generate- Generate custom messageGET /motivate/streaks/:groupId- Get group streak summary
POST /notify/register-token- Register push tokenDELETE /notify/unregister-token- Unregister push tokenGET /notify/settings- Get notification settings
POST /upload/url- Get upload URL for imagesPOST /upload/complete- Complete multipart uploadGET /upload/user- Get user's imagesDELETE /upload/:fileName- Delete image
# Cloudflare Configuration
CLOUDFLARE_ACCOUNT_ID=your-cloudflare-account-id
CLOUDFLARE_API_TOKEN=your-cloudflare-api-token
# Database Configuration
D1_DATABASE_ID=your-d1-database-id
D1_DATABASE_NAME=gymbro-db
# KV Namespace IDs
KV_PUSH_TOKENS_ID=your-kv-namespace-id
# R2 Configuration
R2_BUCKET_NAME=gymbro-images
R2_ACCESS_KEY_ID=your-r2-access-key
R2_SECRET_ACCESS_KEY=your-r2-secret-key
R2_PUBLIC_URL=https://your-r2-domain.com
# Supabase Configuration
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key
# AI Services
GEMINI_API_KEY=your-google-gemini-api-key
# JWT Configuration
JWT_SECRET=your-jwt-secret-key-here
# Environment
ENVIRONMENT=development# Supabase Configuration
EXPO_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
EXPO_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
# API Configuration
EXPO_PUBLIC_API_URL=https://your-worker-domain.workers.dev
# App Configuration
EXPO_PUBLIC_APP_NAME=GymBro
EXPO_PUBLIC_APP_VERSION=1.0.0
# Development
EXPO_PUBLIC_ENVIRONMENT=developmentcd backend
wrangler deploycd frontend
# Build for production
eas build --platform all
# Submit to app stores
eas submit --platform all# Backend tests (when implemented)
cd backend && npm test
# Frontend tests (when implemented)
cd frontend && npm test- TypeScript strict mode enabled
- ESLint configuration included
- Prettier formatting (when configured)
MIT License - see LICENSE file for details
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For support and questions:
- Create an issue in the GitHub repository
- Check the documentation in the
/docsfolder - Review the API documentation
- Voice message support
- Workout plan sharing
- Integration with fitness trackers
- Advanced analytics
- Group challenges and competitions
- Meal planning integration
- Progress photos comparison
- Social features (likes, comments)
- Achievement badges
- Export data functionality