169 lines
4.2 KiB
Markdown
169 lines
4.2 KiB
Markdown
# 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
|
|
- [x] User registration with email confirmation
|
|
- [x] Login with credentials
|
|
- [x] Password reset flow
|
|
- [x] Session management with JWT
|
|
- [x] Role-based access control
|
|
|
|
### Epic 2: Player Profile & Analytics
|
|
- [x] Player profile page with statistics
|
|
- [x] Partnership performance table
|
|
- [x] Win rate and Elo display
|
|
|
|
### Epic 3: Rankings & Public Data
|
|
- [x] Player rankings page
|
|
- [x] Sortable rankings table
|
|
- [x] Public player profiles
|
|
|
|
### Epic 4: Tournament Management
|
|
- [x] Create tournaments
|
|
- [x] Manage participants
|
|
- [x] Create teams
|
|
- [x] View tournament details
|
|
|
|
### Epic 5: Match Recording & CSV Import
|
|
- [x] Record match results via API
|
|
- [x] CSV upload for batch processing
|
|
- [x] Automatic Elo calculation
|
|
- [x] Partnership tracking
|
|
|
|
## Getting Started
|
|
|
|
### Prerequisites
|
|
|
|
- Node.js 22+
|
|
- npm or yarn
|
|
|
|
### Installation
|
|
|
|
1. **Clone the repository**
|
|
```bash
|
|
git clone <repository-url>
|
|
cd euchre_camp
|
|
```
|
|
|
|
2. **Install dependencies**
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
3. **Set up the database**
|
|
```bash
|
|
npx prisma db push
|
|
```
|
|
|
|
4. **Start the development server**
|
|
```bash
|
|
npm run dev
|
|
```
|
|
|
|
### Environment Variables
|
|
|
|
Create a `.env` file:
|
|
|
|
```env
|
|
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
|
|
|
|
```bash
|
|
# 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
|