GitHunt
SU

SudarshanaSRao/sports-on-the-go-4c575e84

A full-stack web app (built with React, TypeScript, Supabase, and OpenStreetMap for real-time game discovery) for discovering and organizing local pickup sports games with real-time maps and user authentication.

SquadUp πŸƒβ€β™‚οΈ

Find and join pickup sports games in your area

SquadUp is a community-driven platform that connects athletes and sports enthusiasts for pickup games. Whether you're looking to join a basketball game, host a soccer match, or find tennis partners, SquadUp makes it easy to discover and organize local sports activities.

MIT License
Made with Lovable

Find more information about this website here

🌟 Features

For Players

  • Discover Games: Browse and search for pickup games in your area using an interactive map
  • Filter by Sport & Skill Level: Find games that match your preferences and abilities
  • Join Games: Sign up for games with one click and connect with other players
  • Review System: Rate and review players after games to build community trust
  • Friend System: Connect with regular players and build your sports network
  • Leaderboard: Track your stats including games played, ratings, and community standing
  • AI Assistant: Sporty is a Gemini AI chatbot for personalized game recommendations and natural-language match search

For Hosts

  • Host Games: Create and organize pickup games with detailed information
  • Auto-Location: Geocoding integration to automatically map your game location
  • Community Creation: Each game automatically creates a community for participants
  • Player Management: Track who's joining your games and manage participants
  • Flexible Settings: Set skill levels, player limits, duration, and game rules

Social Features

  • Friend Requests: Send and receive friend requests from other players
  • User Profiles: View player stats, ratings, and game history
  • Community Pages: Each game has its own community page for discussions
  • Notifications: Stay updated on friend requests and game activities

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

Installation

  1. Clone the repository

    git clone https://github.com/SudarshanaSRao/sports-on-the-go-4c575e84.git
    cd sports-on-the-go-4c575e84
  2. Install dependencies

    npm install
    # or
    bun install
  3. Set up environment variables

    The project uses Lovable Cloud (Supabase) for backend services. The .env file is auto-configured when deployed through Lovable, but for local development, you'll need:

    VITE_SUPABASE_URL=your_supabase_url
    VITE_SUPABASE_PUBLISHABLE_KEY=your_supabase_anon_key
    VITE_SUPABASE_PROJECT_ID=your_project_id
  4. Start the development server

    npm run dev
    # or
    bun run dev
  5. Open your browser

    Navigate to http://localhost:5173 to see the application running.

πŸ—οΈ Architecture

The following diagram illustrates the system architecture and data flow of SquadUp:

SquadUp Architecture

Architecture Overview

SquadUp follows a modern client-server architecture with the following key components:

  • Client Side: React frontend built with Vite and TypeScript, handling user interactions and UI rendering
  • Authentication Context: Manages user authentication state with email and Google OAuth support
  • Content Moderation: Edge function that filters user-generated content for safety
  • Geocode Function: Edge function that converts addresses to coordinates for map display
  • Row Level Security: PostgreSQL database with RLS policies ensuring secure data access
  • Core Database Tables:
    • profiles: Stores user profile information
    • games: Stores game details and statistics
    • rsvps: Manages event attendance
    • communities: Auto-created for each game
    • reviews: Player ratings and feedback

Data Flow

  1. User Authentication: Users sign up/login via Lovable Cloud Auth (email or Google)
  2. Game Creation: Host creates game β†’ Geocode function validates address β†’ Game stored in database
  3. Game Discovery: Users browse games β†’ Map displays locations β†’ Filter by sport/skill level
  4. RSVP System: User joins game β†’ RSVP recorded β†’ Player count updated β†’ Community auto-created
  5. Social Features: Friend requests β†’ Accepted friendships β†’ Enhanced game visibility
  6. Review System: Post-game reviews β†’ Ratings calculated β†’ User profiles updated

πŸ› οΈ Tech Stack

Frontend

  • React 18 - UI library
  • TypeScript - Type safety
  • Vite - Build tool and dev server
  • Tailwind CSS - Utility-first styling
  • Shadcn/ui - Accessible component library
  • React Router - Client-side routing
  • React Query - Server state management
  • React Leaflet - Interactive maps

Backend (Lovable Cloud/Supabase)

  • PostgreSQL - Database
  • Row Level Security - Data security
  • Edge Functions - Serverless functions
  • Authentication - User management
  • Storage - File storage

Key Libraries

  • Zod - Schema validation
  • React Hook Form - Form management
  • date-fns - Date manipulation
  • Leaflet - Map visualization
  • Lucide React - Icon library

πŸ“ Project Structure

squadup/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/        # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ ui/           # Shadcn UI components
β”‚   β”‚   β”œβ”€β”€ Navbar.tsx    # Navigation component
β”‚   β”‚   β”œβ”€β”€ GameMap.tsx   # Map component
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ pages/            # Page components
β”‚   β”‚   β”œβ”€β”€ Index.tsx     # Home page
β”‚   β”‚   β”œβ”€β”€ Discover.tsx  # Game discovery
β”‚   β”‚   β”œβ”€β”€ HostGame.tsx  # Host a game
β”‚   β”‚   β”œβ”€β”€ MyGames.tsx   # User's games
β”‚   β”‚   β”œβ”€β”€ Friends.tsx   # Friends management
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ contexts/         # React contexts
β”‚   β”‚   └── AuthContext.tsx
β”‚   β”œβ”€β”€ hooks/            # Custom React hooks
β”‚   β”œβ”€β”€ utils/            # Utility functions
β”‚   β”œβ”€β”€ integrations/     # Third-party integrations
β”‚   β”‚   └── supabase/     # Supabase client
β”‚   └── main.tsx          # Application entry point
β”œβ”€β”€ supabase/
β”‚   β”œβ”€β”€ functions/        # Edge functions
β”‚   β”‚   β”œβ”€β”€ geocode/      # Geocoding service
β”‚   β”‚   └── moderate-content/  # Content moderation
β”‚   └── config.toml       # Supabase configuration
β”œβ”€β”€ public/               # Static assets
└── ...

🎯 How It Works

For New Users

  1. Sign Up: Create an account using email or Google authentication
  2. Set Username: Choose your unique username
  3. Discover: Browse the map or list view to find games
  4. Join: Click on games that interest you and join them
  5. Connect: Add friends and build your sports network
  6. Play: Attend games and meet fellow athletes
  7. Review: Rate your experience and help build community trust

For Game Hosts

  1. Create Game: Click "Host Game" and fill in details
    • Sport type and skill level
    • Date, time, and duration
    • Location (auto-geocoded)
    • Player limits and requirements
  2. Manage: Track participants and game details
  3. Community: Use the auto-created community page to communicate
  4. Review: Rate players after the game

πŸ” Security & Privacy

  • Row Level Security (RLS): All database tables are protected with RLS policies
  • Authentication Required: Most features require user authentication
  • Data Privacy: User data is protected and only shared with game participants
  • Content Moderation: Edge functions help moderate user-generated content

🀝 Contributing

We welcome contributions from the community! Please see our CONTRIBUTING.md guide for details on:

  • Code of conduct
  • How to submit issues
  • How to submit pull requests
  • Coding standards

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support

If you encounter any issues or have questions:

πŸ—ΊοΈ Roadmap

Future features we're considering:

  • Mobile app (React Native)
  • Team tournaments
  • Weather integration
  • Push notifications
  • Multi-language support
  • Advanced matchmaking algorithms

πŸ’» Development

Running Tests

npm run test
# or
bun test

Building for Production

npm run build
# or
bun run build

Linting

npm run lint
# or
bun run lint

🌐 Deployment

This project can be deployed on various platforms:

  • Lovable (Recommended): One-click deployment
  • Vercel: Import GitHub repository
  • Netlify: Connect GitHub repository
  • Self-hosted: Build and deploy to your own server

For detailed deployment instructions, see DEPLOYMENT.md.


Made with ❀️ by the SquadUp community

SudarshanaSRao/sports-on-the-go-4c575e84 | GitHunt