Tournament UI Implementation Plan
Overview
This document outlines the complete UI implementation plan for tournament features in the Archery Apprentice app. The plan is organized by implementation phases and priority levels based on our established repository layer and database foundation.
Implementation Foundation ✅
Completed Infrastructure
- Database Layer: Migration 27→28 completed with tournament integration fields
- Repository Layer: Three tournament repository implementations completed
FirebaseTournamentRepository- Online tournament operations with FirestoreOfflineTournamentRepository- Full offline tournament functionalityHybridTournamentRepository- Offline-first with automatic sync
- Data Models: Complete tournament domain models with security, privacy, and anti-cheating
- Authentication Foundation: Firebase Auth integration with account linking ready
Phase 1: Core Tournament Discovery & Creation (Priority: HIGH)
1.1 Tournament Discovery Screen
File: app/src/main/java/com/archeryapprentice/ui/tournament/TournamentDiscoveryScreen.kt
Features:
- Real-time tournament search and filtering
- Location-based tournament discovery (within radius)
- Tournament category filtering (Indoor, Outdoor, Field, 3D)
- Distance and skill level filters
- Tournament status indicators (Open, Full, In Progress, Completed)
UI Components:
@Composable
fun TournamentDiscoveryScreen(
navController: NavHostController,
tournamentRepository: TournamentRepository,
viewModel: TournamentDiscoveryViewModel
)
// Key composables:
- TournamentSearchBar()
- TournamentFilterChips()
- TournamentListItem()
- LocationPermissionHandler()
- EmptyDiscoveryState()1.2 Tournament Creation Screen
File: app/src/main/java/com/archeryapprentice/ui/tournament/TournamentCreationScreen.kt
Features:
- Multi-step tournament creation wizard
- Basic info: name, description, location, dates
- Format configuration: category, division, scoring system
- Participant settings: capacity, skill requirements, registration deadline
- Privacy controls: public/private, invite-only options
- Anti-cheating settings: witness requirements, verification rules
UI Components:
@Composable
fun TournamentCreationScreen(
navController: NavHostController,
tournamentRepository: TournamentRepository,
viewModel: TournamentCreationViewModel
)
// Key composables:
- CreationWizardStepper()
- BasicInfoForm()
- FormatConfigurationForm()
- ParticipantSettingsForm()
- PrivacyControlsForm()
- AntiCheatSettingsForm()
- TournamentPreview()1.3 Tournament Details Screen
File: app/src/main/java/com/archeryapprentice/ui/tournament/TournamentDetailsScreen.kt
Features:
- Complete tournament information display
- Participant list and registration status
- Round schedule and format details
- Leaderboard preview (if tournament started)
- Registration/withdrawal actions
- Tournament sharing capabilities
UI Components:
@Composable
fun TournamentDetailsScreen(
navController: NavHostController,
tournamentId: String,
tournamentRepository: TournamentRepository,
viewModel: TournamentDetailsViewModel
)
// Key composables:
- TournamentHeader()
- ParticipantList()
- RoundSchedule()
- RegistrationActions()
- LeaderboardPreview()
- ShareTournamentButton()Phase 2: Tournament Registration & Management (Priority: HIGH)
2.1 Tournament Registration Flow
File: app/src/main/java/com/archeryapprentice/ui/tournament/TournamentRegistrationScreen.kt
Features:
- Division and category selection
- Equipment verification and declaration
- Witness designation (for verification requirements)
- Terms and conditions acceptance
- Registration confirmation
2.2 My Tournaments Screen
File: app/src/main/java/com/archeryapprentice/ui/tournament/MyTournamentsScreen.kt
Features:
- Organized tournament views: Registered, Hosting, Completed
- Tournament status tracking and notifications
- Quick actions: view details, withdraw, manage
- Tournament history and statistics
2.3 Tournament Management Screen (Host View)
File: app/src/main/java/com/archeryapprentice/ui/tournament/TournamentManagementScreen.kt
Features (Host Only):
- Participant management: approve/reject registrations
- Tournament settings modification
- Round schedule management
- Communication tools: announcements, messages
- Tournament control: start, pause, end
Phase 3: Tournament Scoring Integration (Priority: HIGH)
3.1 Tournament Round Selection
Integration: Extend existing RoundScoringScreen.kt
Features:
- Tournament round selection during round creation
- Automatic tournament format application
- Participant verification for tournament rounds
- Round synchronization indicators
UI Changes:
// Add to existing RoundCreationScreen:
- TournamentRoundSelector()
- TournamentFormatApplier()
- ParticipantVerificationStep()
- SyncStatusIndicator()3.2 Tournament Scoring Enhancements
Integration: Extend existing ActiveScoringScreen.kt
Features:
- Tournament mode indicator and constraints
- Real-time leaderboard position tracking
- Witness verification prompts (when required)
- Tournament sync status and conflict resolution
UI Enhancements:
// Add to existing ActiveScoringScreen:
- TournamentModeHeader()
- LeaderboardPositionIndicator()
- WitnessVerificationDialog()
- SyncConflictResolver()3.3 Tournament Round Details
Integration: Extend existing RoundDetailsScreen.kt
Features:
- Tournament context display
- Leaderboard position and ranking
- Tournament-specific statistics
- Score verification status
- Sync history and status
Phase 4: Leaderboards & Results (Priority: MEDIUM)
4.1 Tournament Leaderboard Screen
File: app/src/main/java/com/archeryapprentice/ui/tournament/TournamentLeaderboardScreen.kt
Features:
- Real-time tournament standings
- Division and category filtering
- Round-by-round score progression
- Participant performance analytics
- Export and sharing capabilities
4.2 Tournament Results Screen
File: app/src/main/java/com/archeryapprentice/ui/tournament/TournamentResultsScreen.kt
Features:
- Final tournament results and awards
- Performance analytics and insights
- Comparison with historical performance
- Certificate and achievement generation
- Social sharing capabilities
Phase 5: Advanced Features (Priority: LOW)
5.1 Tournament Analytics Dashboard
Features:
- Tournament hosting analytics (for organizers)
- Participation history and trends
- Performance metrics across tournaments
- Comparative analysis tools
5.2 Tournament Social Features
Features:
- Tournament chat and communication
- Photo sharing and gallery
- Participant profiles and connections
- Tournament reviews and ratings
5.3 Tournament Notifications
Integration: Extend existing notification system
Features:
- Tournament registration confirmations
- Round start notifications
- Leaderboard position updates
- Tournament announcements
- Score verification requests
ViewModel Architecture
Core ViewModels to Implement
// Discovery and browsing
class TournamentDiscoveryViewModel(
private val tournamentRepository: TournamentRepository,
private val locationService: LocationService
)
// Tournament lifecycle management
class TournamentCreationViewModel(
private val tournamentRepository: TournamentRepository,
private val authRepository: AuthenticationRepository
)
class TournamentDetailsViewModel(
private val tournamentRepository: TournamentRepository
)
// Tournament participation
class MyTournamentsViewModel(
private val tournamentRepository: TournamentRepository,
private val authRepository: AuthenticationRepository
)
// Tournament scoring integration
class TournamentScoringViewModel(
private val tournamentRepository: TournamentRepository,
private val roundRepository: RoundRepository
)
// Results and analytics
class TournamentLeaderboardViewModel(
private val tournamentRepository: TournamentRepository
)
// Management (host features)
class TournamentManagementViewModel(
private val tournamentRepository: TournamentRepository,
private val authRepository: AuthenticationRepository
)Navigation Integration
Tournament Navigation Graph
File: app/src/main/java/com/archeryapprentice/ui/tournament/navigation/TournamentNavGraph.kt
@Composable
fun TournamentNavGraph(
navController: NavHostController,
repositoryFactory: RepositoryFactory
) {
navigation(
startDestination = "tournament_discovery",
route = "tournament"
) {
composable("tournament_discovery") { /* TournamentDiscoveryScreen */ }
composable("tournament_creation") { /* TournamentCreationScreen */ }
composable("tournament_details/{tournamentId}") { /* TournamentDetailsScreen */ }
composable("tournament_registration/{tournamentId}") { /* TournamentRegistrationScreen */ }
composable("my_tournaments") { /* MyTournamentsScreen */ }
composable("tournament_management/{tournamentId}") { /* TournamentManagementScreen */ }
composable("tournament_leaderboard/{tournamentId}") { /* TournamentLeaderboardScreen */ }
composable("tournament_results/{tournamentId}") { /* TournamentResultsScreen */ }
}
}Implementation Timeline
Week 1-2: Foundation & Discovery
- TournamentDiscoveryScreen implementation
- TournamentDetailsScreen implementation
- Basic navigation setup
Week 3-4: Creation & Registration
- TournamentCreationScreen implementation
- TournamentRegistrationScreen implementation
- MyTournamentsScreen implementation
Week 5-6: Scoring Integration
- Tournament mode integration with existing scoring screens
- Tournament round creation and management
- Sync status and conflict resolution UI
Week 7-8: Leaderboards & Results
- TournamentLeaderboardScreen implementation
- TournamentResultsScreen implementation
- Analytics and reporting features
Week 9-10: Advanced Features & Polish
- Tournament management features (host view)
- Social features and communications
- Performance optimization and testing
Success Criteria
Phase 1 Success Metrics
- Users can discover and view tournament details
- Tournament creation flow completes successfully
- Registration process works end-to-end
- Tournament data syncs correctly between online/offline modes
Phase 2 Success Metrics
- Tournament rounds integrate seamlessly with existing scoring
- Real-time leaderboards update correctly
- Offline tournament functionality works without network
- Score verification and anti-cheating measures function properly
Phase 3 Success Metrics
- Complete tournament lifecycle supported (creation → participation → results)
- Tournament host management tools functional
- Tournament analytics and reporting available
- Social features and community engagement working
Related Documentation
- Firebase-Integration-Plan - Complete Firebase integration strategy
- Tournament-Discovery - Phase 2 tournament discovery implementation
- Firebase-Setup - Firebase configuration guide
- System-Architecture - Overall system architecture
Last Updated: 2025
Source: docs/tournament/TOURNAMENT_UI_IMPLEMENTATION_PLAN.md