Find your perfect sports partner, anytime, anywhere!
Sports Buddy is a comprehensive mobile application that connects sports enthusiasts based on location, skill level, and shared interests. Whether you're looking for a tennis partner, organizing a basketball game, or joining a running group, Sports Buddy makes it easy to discover and connect with like-minded athletes in your area.
- ๐ Secure Authentication - JWT-based auth with automatic token refresh
- ๐ Location-Based Discovery - Find sports partners and matches nearby using PostGIS
- ๐ Sports & Skill Management - Track 14+ sports with skill level progression
- โก Real-Time Invitations - Bidirectional invitation system with instant notifications
- ๐ฅ Social Features - Friend system, user reviews, and match ratings
- ๐ Match Management - Create, join, leave, and manage sports matches
- ๐จ Theme System - Light/dark mode with dynamic theming
- ๐ก๏ธ Row-Level Security - Comprehensive database security policies
- ๐ฑ Responsive Design - Safe area aware UI for all device types
- ๐ Smart Search - Search by location, creator, sport, or skill level
- ๐ Geospatial Queries - Efficient location-based matching with spatial indexes
sports-buddy-app/
โโโ ๐ฑ mobile/SportsMonkey/ # React Native Expo App
โ โโโ src/
โ โ โโโ ๐จ components/ # Reusable UI components
โ โ โโโ ๐ contexts/ # React Context (Auth, Theme, etc.)
โ โ โโโ ๐ช hooks/ # Custom React hooks
โ โ โโโ ๐งญ navigation/ # React Navigation setup
โ โ โโโ ๐ฑ screens/ # App screens and pages
โ โ โโโ ๐ ๏ธ services/ # API service layer
โ โ โโโ ๐จ theme/ # Design system and themes
โ โ โโโ ๐ค types/ # TypeScript definitions
โ โ โโโ ๐ ๏ธ utils/ # Utility functions
โ โโโ App.tsx
โโโ ๐ฅ๏ธ backend/ # Express.js API Server
โ โโโ src/
โ โ โโโ โ๏ธ config/ # Database and app config
โ โ โโโ ๐ฎ controllers/ # API route handlers
โ โ โโโ ๐ก๏ธ middleware/ # Security and auth middleware
โ โ โโโ ๐ค๏ธ routes/ # API route definitions
โ โ โโโ ๐ scripts/ # Database seed scripts
โ โ โโโ ๐ค types/ # TypeScript definitions
โ โ โโโ app.ts # Express application
โโโ ๐ shared/ # Shared TypeScript types
โ โโโ src/
โ โ โโโ types.ts # Common type definitions
โ โ โโโ api.ts # API interfaces
โ โ โโโ constants.ts # Shared constants
โ โ โโโ utils.ts # Utility functions
โ โ โโโ validation.ts # Input validation
โโโ ๐๏ธ *.sql # Database schema and migrations
- ๐ข Node.js + TypeScript - Modern JavaScript runtime with type safety
- โก Express.js - Fast, unopinionated web framework
- ๐ก๏ธ Security Middleware - Helmet, CORS, rate limiting, authentication
- ๐ Supabase - PostgreSQL database with real-time subscriptions
- ๐ PostGIS - Spatial extension for location-based queries
- ๐ JWT Authentication - Secure token-based authentication
- ๐ฑ React Native + Expo - Cross-platform mobile development
- ๐จ React Native Elements (RNE) - Consistent UI component library
- ๐งญ React Navigation v6 - Native navigation with type safety
- ๐ Context API - State management for auth, theme, and data
- ๐พ AsyncStorage - Persistent local storage
- ๐ง TypeScript - Full type safety across the application
- ๐ PostgreSQL - Robust relational database with JSON support
- ๐ PostGIS - Advanced geospatial capabilities
- ๐ Row-Level Security - Fine-grained access control
- ๐ Spatial Indexing - Optimized location-based queries
- โก Real-time Subscriptions - Live data updates
Mobile App (No DB Credentials)
โ JWT Tokens
Express API (Rate Limited + Authenticated)
โ Service Role Key
Supabase (Row-Level Security + Policies)
โ Secure Queries
PostgreSQL Database
- ๐ JWT Token Management - Automatic refresh and secure storage
- ๐ก๏ธ API Rate Limiting - Protection against abuse and spam
- ๐ Row-Level Security - Database-level access control
- ๐ ๏ธ Input Validation - Server-side validation for all inputs
- ๐ Resource Ownership - Users can only access their own data
- ๐ CORS Protection - Secure cross-origin resource sharing
Our sophisticated invitation system supports both directions of match participation:
- Search & Invite - Match creators search for users and send invitations
- Real-time Notifications - Invited users receive instant notification banners
- Quick Actions - Accept or decline invitations with one tap
- Status Tracking - Real-time updates on invitation status
- Request to Join - Players can request to join open matches
- Creator Approval - Match creators receive and manage join requests
- Notification System - Both parties receive status updates
- Automatic Matching - System handles capacity and skill level matching
- ๐ฏ Proximity Matching - Find matches within customizable radius (1-50km)
- ๐ Real-time Location - Optional location sharing for enhanced matching
- ๐บ๏ธ Interactive Maps - View match locations with tap-to-navigate
- ๐ Smart Filtering - Filter by sport, skill level, time, and distance
- ๐ค User Profiles - Comprehensive profiles with sports preferences
- โญ Review System - Rate and review other players after matches
- ๐ค Friend System - Send/accept friend requests and build networks
- ๐ฌ Match Chat - In-app messaging for confirmed match participants
- ๐ Theme Support - Light and dark modes with system preference detection
- ๐ฑ Responsive UI - Safe area aware design for all device types
- ๐จ Consistent Styling - Design tokens for spacing, colors, and typography
- โฟ Accessibility - Screen reader support and accessibility best practices
- Node.js 18+ and npm
- Expo CLI (
npm install -g @expo/cli) - Supabase account and project
- iOS Simulator (Mac) or Android Studio (development)
# Clone and setup entire project
git clone <repository-url>
cd sports-buddy-app
# Install all dependencies
npm run setup:all
# Configure environment (see detailed setup below)
# Then start development
npm run dev:all# 1. Navigate to backend
cd backend
# 2. Install dependencies
npm install
# 3. Configure environment
cp .env.example .envEnvironment Configuration (.env):
# Server Configuration
PORT=3000
NODE_ENV=development
# Supabase Configuration
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your_anon_key_here
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key_here
# Security Configuration (Optional)
JWT_SECRET=your_jwt_secret_here
API_RATE_LIMIT=1000
AUTH_RATE_LIMIT=10# 4. Set up database
npm run db:setup # Runs FINAL_DATABASE_SCHEMA.sql
# 5. Start development server
npm run dev# 1. Navigate to mobile app
cd mobile/SportsMonkey
# 2. Install dependencies
npm install
# 3. Configure Supabase
# Update src/config/index.ts with your Supabase credentials
# 4. Start Expo development server
npm startMobile Configuration (src/config/index.ts):
export const config = {
supabase: {
url: 'https://your-project.supabase.co',
anonKey: 'your_anon_key_here',
},
api: {
baseUrl: 'http://localhost:3000', // or your deployed API URL
},
};# Build shared types (required for development)
cd shared
npm install
npm run buildPOST /api/auth/signup # Create new user account
POST /api/auth/signin # Sign in user
POST /api/auth/signout # Sign out user
POST /api/auth/refresh # Refresh JWT token
GET /health # API health checkGET /api/profiles/me # Get current user profile
PUT /api/profiles/me # Update current user profile
GET /api/profiles/:id # Get specific user profile
GET /api/profiles/search # Search users by location/sport
POST /api/profiles/sports # Add sport to user profile
PUT /api/profiles/sports/:id # Update user sport preferences
DELETE /api/profiles/sports/:id # Remove sport from profileGET /api/sports # Get all available sports
GET /api/sports/:id # Get specific sport details
GET /api/sports/popular # Get sports popularity statisticsGET /api/matches # Get matches with filtering
POST /api/matches # Create new match
GET /api/matches/:id # Get specific match details
PUT /api/matches/:id # Update match (creator only)
DELETE /api/matches/:id # Delete match (creator only)
GET /api/matches/user # Get user's matches (created & joined)POST /api/matches/:id/join # Request to join match
POST /api/matches/:id/leave # Leave match
POST /api/matches/:id/invite # Invite user to match (creator only)
POST /api/matches/:id/respond # Respond to invitation (accept/decline)
GET /api/matches/invitations/received # Get pending invitations
GET /api/matches/requests/received # Get join requests (creator only)
POST /api/matches/requests/:id/accept # Accept join request
POST /api/matches/requests/:id/decline # Decline join requestGET /api/friends # Get user's friends list
GET /api/friends/requests # Get pending friend requests
POST /api/friends/request # Send friend request
POST /api/friends/:id/accept # Accept friend request
POST /api/friends/:id/decline # Decline friend request
DELETE /api/friends/:id # Remove friendGET /api/location/nearby # Get nearby users/matches
POST /api/location/update # Update user location
GET /api/location/search # Search by location nameprofiles- User profiles with location data (PostGIS)sports- Available sports (14 included by default)user_sports- User-sport preferences with skill levelsmatches- Sports matches with geospatial datamatch_participants- Invitation/join request managementuser_connections- Friend system relationshipsmessages- Match-based messaginguser_reviews- Player ratings and reviews
- PostGIS Integration - Spatial queries and location indexing
- Row-Level Security - Comprehensive access control policies
- Automatic Triggers -
updated_attimestamp management - Performance Indexes - 20+ optimized indexes for common queries
- Data Integrity - Foreign keys, constraints, and business logic
Tennis, Basketball, Football/Soccer, Volleyball, Badminton, Table Tennis, Running, Cycling, Swimming, Golf, Baseball, Hockey, Cricket, Rugby
- Themed Components - Light/dark mode support
- Safe Area Design - Works with notches and dynamic islands
- Interactive Notifications - Real-time invitation banners
- Smart Navigation - Context-aware navigation flows
- Responsive Cards - Match and user profile cards
- Location Integration - Native map integration
- Auth Context - User authentication state
- Theme Context - UI theme and preferences
- Location Context - User location management
- Match Invitations Context - Real-time invitation handling
- Friends Context - Social connections management
App Navigator
โโโ Auth Stack (Unauthenticated)
โ โโโ Login Screen
โ โโโ Register Screen
โ โโโ Loading Screen
โโโ Main Stack (Authenticated)
โโโ Tab Navigator
โ โโโ Dashboard
โ โโโ Nearby Matches
โ โโโ Profile
โ โโโ Friends
โโโ Create Match
โโโ Match Details
โโโ User Search
โโโ Match Search
# Backend Development
cd backend
npm run dev # Start with nodemon hot reload
npm run build # Compile TypeScript
npm run type-check # Check types without compilation
npm run lint # ESLint checking
# Mobile Development
cd mobile/SportsMonkey
npm start # Start Expo dev server
npm run android # Run on Android
npm run ios # Run on iOS Simulator
npm run type-check # TypeScript checking
npm run lint # ESLint checking
# Shared Types
cd shared
npm run build # Build shared types
npm run dev # Watch mode for development- Unit Tests - Jest for business logic testing
- Integration Tests - API endpoint testing with Supertest
- E2E Tests - Detox for mobile app testing
- Type Safety - Comprehensive TypeScript coverage
- Manual Testing - Device testing on iOS and Android
- Production: Deploy to Railway, Heroku, or AWS
- Database: Managed Supabase PostgreSQL
- Environment: Production environment variables
- Monitoring: Health checks and error tracking
- iOS: App Store via Expo Application Services (EAS)
- Android: Google Play Store via EAS
- OTA Updates: Expo Over-The-Air updates for React Native code
- ๐ Authentication System - JWT-based with auto-refresh
- ๐ฑ Core Mobile App - Complete UI with navigation
- ๐๏ธ Database Schema - Production-ready with RLS policies
- ๐ฏ Invitation System - Bidirectional invites and requests
- ๐จ Theme System - Light/dark mode with design tokens
- ๐ Location Services - PostGIS-based proximity matching
- ๐ฅ Social Features - Friends, reviews, and messaging foundation
- ๐ก๏ธ Security Implementation - Rate limiting, validation, and protection
- ๐ฌ Real-time Messaging - Live chat for match participants
- ๐ Analytics Dashboard - Match statistics and insights
- ๐ Push Notifications - Native mobile notifications
- ๐บ๏ธ Interactive Maps - Enhanced location visualization
- โก Performance Optimization - Caching and query optimization
- ๐ Advanced Search - AI-powered match recommendations
- ๐ฑ Offline Support - Offline-first architecture
- ๐ฎ Gamification - Achievement system and leaderboards
- ๐ Social Integration - Share matches on social platforms
- Fork the repository and create feature branches
- Follow TypeScript - Strict type checking required
- Test your changes - Unit and integration tests
- Update documentation - Keep README and code comments current
- Security first - Never expose credentials or sensitive data
- ESLint + Prettier for consistent formatting
- Conventional Commits for clear git history
- Component naming - PascalCase for React components
- File organization - Feature-based folder structure
- Create feature branch from
main - Implement changes with tests
- Update documentation if needed
- Submit PR with clear description
- Address review feedback
This project is licensed under the MIT License. See LICENSE file for details.
- Documentation: Check DEVELOPMENT.md for development guidance
- Issues: Create GitHub issues for bugs and feature requests
- Architecture: Review API_ARCHITECTURE.md for technical details
Built with โค๏ธ for the sports community