A comprehensive multiplayer checkers platform built with the T3 Stack, featuring real-time gameplay, tournament systems, social features, and multiple game variants.
๐งช BETA STATUS: Multiplayer features are currently in beta with known issues. See Known Issues section below.
- โ Single-Player vs AI: Multiple difficulty levels with intelligent move evaluation
- โ Local Multiplayer: Hot-seat gameplay for two players
- ๐งช Online Multiplayer (BETA): Real-time gameplay with invitation system
- โ Multiple Variants: American, Brazilian, International, and Canadian rules
- โ Game Analysis: Move history, notation, and post-game review
- โ Friend System: Add friends, send messages, manage relationships
- โ Real-time Notifications: Unified event system for instant updates
- โ Messaging: Private conversations between players
- โ User Profiles: Avatars, statistics, and match history
- โ Tournament System: Swiss and Round Robin formats
- โ Rating System: ELO-based rankings per variant and play mode
- โ Match History: Complete game records and statistics
- ๐ง Spectating (IN PROGRESS): Watch live games in real-time
- โ Guest Accounts: Play without registration, convert to full account later
- โ Mobile Responsive: Optimized touch controls and responsive design
- โ Keyboard Navigation: Full accessibility support
- โ Multiple Themes: Customizable board skins and piece sets
- Node.js 18+ and pnpm
- PostgreSQL database
- (Optional) AWS S3 for avatar uploads
# Clone the repository
git clone <repository-url>
cd checkers
# Install dependencies
pnpm install
# Set up environment variables
cp .env.example .env
# Edit .env with your database URL and other configurationCreate a .env file with the following variables:
# Database (Required)
DATABASE_URL="postgresql://username:password@localhost:5432/checkers"
# Authentication (Required)
NEXTAUTH_SECRET="your-secret-key"
NEXTAUTH_URL="http://localhost:3000"
# Discord OAuth (Optional - for Discord login)
DISCORD_CLIENT_ID="your-discord-client-id"
DISCORD_CLIENT_SECRET="your-discord-client-secret"
# AWS S3 (Optional - for avatar uploads)
AWS_REGION="us-east-1"
AWS_ACCESS_KEY_ID="your-access-key"
AWS_SECRET_ACCESS_KEY="your-secret-key"
AWS_S3_BUCKET="your-bucket-name"
# Email (Optional - for notifications)
RESEND_API_KEY="your-resend-api-key"# Generate Prisma client
pnpm db:generate
# Push schema to database
pnpm db:push
# Seed database with sample data (optional)
pnpm db:seed
pnpm db:seed:games# Start development server
pnpm dev
# Run tests
pnpm test
# Type checking
pnpm typecheck
# Linting
pnpm lintVisit http://localhost:3000 to start playing!
This application is built with the T3 Stack and additional tools:
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe JavaScript
- React 19 - User interface library
- tRPC - End-to-end typesafe APIs
- Prisma - Database ORM
- PostgreSQL - Production database
- NextAuth.js - Authentication
- Tailwind CSS - Utility-first CSS framework
- Shadcn/ui - Re-usable component library
- Framer Motion - Animation library
- Lucide React - Icon library
- Unified Event System - Real-time updates via tRPC subscriptions (SSE)
- AWS S3 - Avatar and file storage
- Resend - Email notifications
- Comprehensive Testing Documentation - Detailed guide to all testing aspects
- Vitest - Unit and integration testing
- Playwright - End-to-end testing
- ESLint - Code linting
- Prettier - Code formatting
The platform supports multiple official checkers variants:
- 8ร8 board with 32 dark squares
- 12 pieces per player
- Kings can move and capture backwards
- Flying kings (long-range moves)
- 10ร10 board with 50 dark squares
- 20 pieces per player
- Mandatory capturing with maximum capture rule
- Flying kings with long-range moves
- 8ร8 board (same as American)
- International rules on smaller board
- Flying kings and maximum capture rule
- 12ร12 board with 72 dark squares
- 30 pieces per player
- International rules on largest board
- Swiss System: Players paired by performance, fixed number of rounds
- Round Robin: Every player plays every other player
- Single Elimination: Traditional bracket tournament (coming soon)
- Double Elimination: Losers bracket for second chances (coming soon)
- ELO-based ratings separate for each variant and play mode
- Provisional ratings for new players (first 20 games)
- Peak rating tracking and historical performance
- Leaderboards by variant and timeframe
The application uses tRPC for type-safe API communication:
auth- Authentication and user managementuser- User profiles, friends, and social featuresgame- Game creation, moves, and state managementmultiplayerGame- Real-time multiplayer functionalitygameInvite- Game invitations and matchmakingfriendRequest- Friend request managementmessage- Private messaging systemnotification- Notification managementgameNotes- Game analysis and notesevents- Unified real-time event subscription
- Single tRPC Subscription -
api.events.onAllEventshandles all real-time data - Event-driven Architecture - Notifications, messages, game moves, and presence updates
- Automatic Reconnection - Built-in recovery with exponential backoff
- Guest Games: Currently do not fully support online multiplayer features to play anonymously in a game lobby
- First Move Sync: The very first move in an online match may not sync properly until page refresh (fix deployed, monitoring ongoing)
- Sync conflicts may occur with rapid consecutive moves
- Connection drops can cause temporary desync (auto-recovery implemented)
- Move validation occasionally allows illegal moves under race conditions
- Spectator permissions still being refined
- Spectating system - UI components ready, backend integration in progress
- Tournament brackets - Tournament logic complete, visualization pending
- Push notifications - Server-side ready, client registration needed
- Mobile drag optimization - Touch handling improvements planned
- Large game history can slow down game loading (pagination planned)
- Simultaneous tournaments may impact database performance
- Real-time scaling tested up to 50 concurrent games (unified event system)
- Node.js 18+ with pnpm package manager
- PostgreSQL 13+ database
- AWS S3 bucket (optional, for avatar uploads)
- SMTP service (optional, for email notifications)
# Build for production
pnpm build
# Start production server
pnpm start
# Or build and preview locally
pnpm preview# Run migrations in production
pnpm db:migrate
# Generate Prisma client
pnpm db:generateThis application can be deployed on:
- Vercel - Recommended for Next.js applications
- Railway - Easy PostgreSQL hosting
- PlanetScale - Serverless MySQL alternative
- Supabase - PostgreSQL with additional features
- Docker - Containerized deployment
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Run tests (
pnpm test) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the existing code style and conventions
- Add tests for new features
- Update documentation as needed
- Ensure TypeScript strict mode compliance
- Social Components Readme - Documentation for social features and components
- Multiplayer UI Readme - Documentation for multiplayer game UI components
- Notifications Readme - Documentation for the notification system
- Testing Readme - Documentation for Testing
This project is licensed under the MIT License - see the LICENSE file for details.