Quick Start
Prerequisites
Before setting up BBX, ensure you have the following installed:
- Node.js (v18.0 or higher)
- npm or pnpm
- A Supabase account for database and authentication
- An OpenRouter API key (optional, for AI-enhanced features)
1. Clone the Repository
Start by cloning the project and navigating into the web directory:
git clone https://github.com/JovanR007/BBX.git
cd BBX/web
2. Environment Setup
Create a .env file in the web directory. You will need to provide your Supabase credentials and OpenRouter API key:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# OpenRouter Configuration (AI features)
OPENAI_API_KEY=your_openrouter_api_key
# Local Testing (Optional)
TEST_TOURNAMENT_ID=your_active_tournament_uuid
3. Database Configuration
BBX relies on Supabase for real-time tournament tracking. Ensure your Supabase project has the following tables and views configured:
- tournaments: Stores name, status, and cut size (e.g., Top 8, Top 16).
- participants: Stores player names and their associated tournament IDs.
- matches: Stores match pairings, scores, and status (pending/complete).
- swiss_standings (View): A database view that calculates ranks based on wins, Buchholz scores, and point differentials.
4. Install Dependencies & Launch
Install the required packages and start the development server:
npm install
npm run dev
The application will be available at http://localhost:3000.
5. Host Your First Tournament
Once the app is running, follow these steps to launch a tournament:
Create the Tournament
- Navigate to the Host a Tournament page (
/create). - Enter a Tournament Name and an optional URL Slug.
- Click Launch Tournament.
Manage Registration
- Access the Admin Console via the tournament dashboard.
- Use the Registration Management section to add participants.
- Once all players are registered, click Start Tournament to generate the first round of Swiss pairings.
Run the Event
- Reporting Scores: Use the Admin Console to input match results (e.g., Score A vs Score B).
- Advancing Rounds: After all matches in a round are complete, use the Advance Bracket button to generate the next set of pairings.
- Top Cut: Once Swiss rounds are finished, the system allows you to transition to a single-elimination bracket based on the
cut_sizedefined during setup.
Public View
Participants can track their progress in real-time by visiting the tournament's public URL (e.g., /t/your-slug/bracket), which displays live standings and the current bracket state.