david 123df671f5 nextjs-rewrite (#5)
Reviewed-on: #5
Co-authored-by: David Gwilliam <dhgwilliam@gmail.com>
Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00
2026-03-30 02:30:13 +00:00

EuchreCamp

A comprehensive tournament management and partnership analytics system for the card game Euchre, built with Next.js, TypeScript, and Prisma.

Overview

EuchreCamp is a full-stack web application that provides:

  • Tournament Management: Create and manage round-robin, single elimination, double elimination, and Swiss-style tournaments
  • Partnership Analytics: Track partnership performance, win rates, and Elo changes between players
  • Player Profiles: Display individual player statistics and partnership breakdowns
  • Admin Dashboard: Centralized management interface for tournaments, players, and matches
  • CSV Import: Batch import match results from CSV files
  • Authentication & Authorization: Role-based access control with player, tournament_admin, and club_admin roles

Tech Stack

  • Framework: Next.js 16 (App Router)
  • Language: TypeScript
  • Database: Prisma ORM with SQLite
  • Styling: Tailwind CSS
  • Authentication: NextAuth.js
  • Form Handling: React Hook Form + Zod validation
  • CSV Parsing: PapaParse

Project Structure

euchre_camp/
├── src/
│   ├── app/
│   │   ├── api/          # API routes
│   │   ├── auth/         # Authentication pages
│   │   ├── admin/        # Admin pages
│   │   ├── players/      # Player pages
│   │   ├── components/   # Shared components
│   │   └── lib/          # Utilities and configuration
│   └── types/            # TypeScript type definitions
├── prisma/               # Prisma schema and migrations
├── docs/                 # Documentation
└── public/               # Static assets

Features Implemented

Epic 1: Authentication & User Management

  • User registration with email confirmation
  • Login with credentials
  • Password reset flow
  • Session management with JWT
  • Role-based access control

Epic 2: Player Profile & Analytics

  • Player profile page with statistics
  • Partnership performance table
  • Win rate and Elo display

Epic 3: Rankings & Public Data

  • Player rankings page
  • Sortable rankings table
  • Public player profiles

Epic 4: Tournament Management

  • Create tournaments
  • Manage participants
  • Create teams
  • View tournament details

Epic 5: Match Recording & CSV Import

  • Record match results via API
  • CSV upload for batch processing
  • Automatic Elo calculation
  • Partnership tracking

Getting Started

Prerequisites

  • Node.js 22+
  • npm or yarn

Installation

  1. Clone the repository

    git clone <repository-url>
    cd euchre_camp
    
  2. Install dependencies

    npm install
    
  3. Set up the database

    npx prisma db push
    
  4. Start the development server

    npm run dev
    

Environment Variables

Create a .env file:

DATABASE_URL="file:./dev.db"
NEXTAUTH_SECRET="your-secret-key-here"
NEXTAUTH_URL="http://localhost:3000"

Usage

Creating a Tournament

  1. Navigate to /admin/tournaments
  2. Click "Create Tournament"
  3. Fill in tournament details

Uploading Match Results via CSV

  1. Navigate to /admin/matches/upload
  2. Select a tournament
  3. Upload CSV file with Euchre format

Viewing Player Profiles

Navigate to /players/[id]/profile to see statistics, partnerships, and recent games.

API Endpoints

Tournaments

  • GET /api/tournaments - List all tournaments
  • POST /api/tournaments - Create new tournament
  • GET /api/tournaments/[id] - Get tournament details

Matches

  • GET /api/matches - List matches
  • POST /api/matches - Create match result
  • POST /api/matches/upload - Upload CSV with match results

Development

# Development mode
npm run dev

# Production build
npm run build
npm start

User Stories

User stories are organized into epics in docs/USER_STORIES.md:

  1. Authentication & User Management
  2. Player Profile & Analytics
  3. Rankings & Public Data
  4. Tournament Management
  5. Match Recording & CSV Import
  6. Club Administration
  7. Mobile Responsiveness
  8. Data Management & Export

License

MIT License

S
Description
No description provided
Readme 5.6 MiB
2026-03-31 23:35:21 +00:00
Languages
TypeScript 88.4%
JavaScript 8.2%
Gherkin 1.6%
Just 0.9%
Shell 0.5%
Other 0.3%