nextjs-rewrite #5
@@ -1,36 +1,168 @@
|
||||
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
||||
# 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
|
||||
|
||||
First, run the development server:
|
||||
### Prerequisites
|
||||
|
||||
- Node.js 22+
|
||||
- npm or yarn
|
||||
|
||||
### Installation
|
||||
|
||||
1. **Clone the repository**
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
bun dev
|
||||
git clone <repository-url>
|
||||
cd euchre_camp
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
2. **Install dependencies**
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
||||
3. **Set up the database**
|
||||
```bash
|
||||
npx prisma db push
|
||||
```
|
||||
|
||||
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
||||
4. **Start the development server**
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## Learn More
|
||||
### Environment Variables
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
Create a `.env` file:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
```env
|
||||
DATABASE_URL="file:./dev.db"
|
||||
NEXTAUTH_SECRET="your-secret-key-here"
|
||||
NEXTAUTH_URL="http://localhost:3000"
|
||||
```
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
||||
## Usage
|
||||
|
||||
## Deploy on Vercel
|
||||
### Creating a Tournament
|
||||
1. Navigate to `/admin/tournaments`
|
||||
2. Click "Create Tournament"
|
||||
3. Fill in tournament details
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
### Uploading Match Results via CSV
|
||||
1. Navigate to `/admin/matches/upload`
|
||||
2. Select a tournament
|
||||
3. Upload CSV file with Euchre format
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
||||
### 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
|
||||
|
||||
Reference in New Issue
Block a user